1 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3 Fix some Darwin-7.9.0 porting problems reported by Bruno Haible in
4 <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00063.html>.
5 * dirchownmod.c: Include lchown.h.
6 * lchown.c: Don't include files that lchown.h now includes.
7 Don't declare chown, since lchown.h now does that.
8 * lchown.h: Include errno.h, sys/types.h, unistd.h.
9 (lchown): Define to rpl_chown if lchown is declared but
10 does not exist. Declare using a prototype if lchown is not
11 declared. Add a copyright notice.
12 * mkstemp.h: Include <unistd.h>.
13 * openat.c: Include lchown.h.
15 * fcntl_.h (O_NOFOLLOW): Don't depend on O_NOFOLLOW_IS_INEFFECTIVE;
16 we now test for that separately.
17 * fts.c (fts_safe_changedir): Inspect HAVE_WORKING_O_NOFOLLOW
18 rather than O_NOFOLLOW, when testing whether it's possible to
19 avoid a race condition reliably.
20 * savewd.c (savewd_chdir): Likewise.
22 Remove macros that are no longer needed now that stdint.h is
24 * fsusage.c (UINTMAX_MAX): Remove.
25 * human.c (SIZE_MAX, UINTMAX_MAX): Remove.
26 * utimecmp.c (SIZE_MAX): Remove.
28 2006-10-03 Bruno Haible <bruno@clisp.org>
30 * gl_list.h (gl_list_search_from, gl_list_search_from_to,
31 gl_list_indexof_from, gl_list_indexof_from_to): New declarations.
32 (struct gl_list_implementation): Add fields search_from_to,
33 indexof_from_to. Remove fields search, indexof.
34 (gl_list_search): Use the search_from_to method.
35 (gl_list_search_from, gl_list_search_from_to): New functions.
36 (gl_list_indexof): Use the indexof_from_to method.
37 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
38 * gl_list.c (gl_list_search): Use the search_from_to method.
39 (gl_list_search_from, gl_list_search_from_to): New functions.
40 (gl_list_indexof): Use the indexof_from_to method.
41 (gl_list_indexof_from, gl_list_indexof_from_to): New functions.
42 * gl_array_list.c (gl_array_indexof_from_to): Renamed from
43 gl_array_indexof. Add start_index, end_index arguments.
44 (gl_array_search_from_to): Renamed from gl_array_search. Add
45 start_index, end_index arguments.
46 (gl_array_remove, gl_array_list_implementation): Update.
47 * gl_carray_list.c (gl_carray_indexof_from_to): Renamed from
48 gl_carray_indexof. Add start_index, end_index arguments.
49 (gl_carray_search_from_to): Renamed from gl_carray_search. Add
50 start_index, end_index arguments.
51 (gl_carray_remove, gl_carray_list_implementation): Update.
52 * gl_anylinked_list2.h (gl_linked_search_from_to): Renamed from
53 gl_linked_search. Add start_index, end_index arguments.
54 (gl_linked_indexof_from_to): Renamed from gl_linked_indexof. Add
55 start_index, end_index arguments.
56 (gl_linked_remove): Update.
57 * gl_linked_list.c (gl_linked_list_implementation): Update.
58 * gl_linkedhash_list.c (gl_linkedhash_list_implementation): Update.
59 * gl_anytree_list1.h (iterstack_item_t): Change type of 'rightp' field
61 * gl_anytree_list2.h (gl_tree_search_from_to): Renamed from
62 gl_tree_search. Add start_index, end_index arguments.
63 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
64 start_index, end_index arguments.
65 (gl_tree_remove): Update.
66 * gl_avltree_list.c (gl_avltree_list_implementation): Update.
67 * gl_rbtree_list.c (gl_rbtree_list_implementation): Update.
68 * gl_anytreehash_list1.h (compare_position_threshold): New function.
69 * gl_anytreehash_list2.h (gl_tree_search_from_to): Renamed from
70 gl_tree_search. Add start_index, end_index arguments.
71 (gl_tree_indexof_from_to): Renamed from gl_tree_indexof. Add
72 start_index, end_index arguments.
73 * gl_avltreehash_list.c (gl_avltreehash_list_implementation): Update.
74 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Update.
76 2006-10-04 Bruno Haible <bruno@clisp.org>
78 * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
80 2006-10-03 Bruno Haible <bruno@clisp.org>
82 * gl_oset.h (gl_setelement_threshold_fn): New type.
83 (gl_oset_search_atleast): New declaration.
84 (struct gl_oset_implementation): Add field 'search_atleast'.
85 (gl_oset_search_atleast): New inline function.
86 * gl_oset.c (gl_oset_search_atleast): New function.
87 * gl_array_oset.c (gl_array_search_atleast): New function.
88 (gl_array_oset_implementation): Update.
89 * gl_anytree_oset.h (gl_tree_search_atleast): New function.
90 * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
91 * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
93 2006-10-04 Jim Meyering <jim@meyering.net>
95 * fts.c (fts_open): Tiny comment change.
97 2006-10-03 Bruno Haible <bruno@clisp.org>
99 * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
100 from gl_avltreehash_list_implementation.
102 2006-10-03 Bruno Haible <bruno@clisp.org>
104 * gl_oset.c (gl_oset_add): Fix return type.
106 2006-10-02 Dmitry V. Levin <ldv@altlinux.org>
108 * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
110 2006-10-02 Paolo Bonzini <bonzini@gnu.org> (tiny change)
112 * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
114 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
116 Work around bug in Solaris 10 /proc file system:
117 /proc/self/fd/NNN/.. isn't the parent directory of
118 the directory whose file descriptor is NNN. This needs to
119 be worked around at run time, not compile time, since a
120 program might be built on Solaris 8, where things work, and
122 * openat-priv.h (BUILD_PROC_NAME): Remove. All callers changed
123 to use the following interface instead:
124 (OPENAT_BUFFER_SIZE): New macro.
125 (openat_proc_name): New function.
126 * at-func.c (AT_FUNC_NAME): Adjust to above changes.
127 * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
129 * openat-proc.c: New file.
131 2006-09-29 Bruno Haible <bruno@clisp.org>
133 * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
134 * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
135 argument. Set stdout_closed before testing for ferror, not after.
136 (fwriteerror, fwriteerror_no_ebadf): New functions.
138 2006-09-28 Bruno Haible <bruno@clisp.org>
140 * strndup.h: Simplify the redefinition of strndup.
141 (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
143 2006-09-28 Bruno Haible <bruno@clisp.org>
145 * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
146 * gl_linkedhash_list.c: Likewise.
147 * gl_rbtreehash_list.c: Likewise.
149 2006-09-28 Jim Meyering <jim@meyering.net>
151 * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
154 2006-09-27 Jim Meyering <jim@meyering.net>
156 This file could end up with a definition for a function
157 named __strndup, rather than rpl_strndup on a system with
158 incomplete weak_alias support.
159 * strndup.c (strndup): Rename from __strndup.
160 Remove #defines that used to map __strndup to strndup.
161 Don't use K&R prototypes.
162 Remove LIBC-related code, since this file is not sync'd with glibc.
163 * strndup.h: Revamp, accordingly.
165 2006-09-27 Paul Eggert <eggert@cs.ucla.edu>
167 * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
170 * __fpending.h: Don't include <stdio_ext.h> unless
171 HAVE_DECL___FPENDING. This avoids a bug with lsbcc, where
172 it causes <stdio_ext.h> to cause a compile-time error.
173 Problem reported by Nelson H. F. Beebe.
174 * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
175 of HAVE_DECL___PENDING.
177 2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
179 * savewd.c: Include <signal.h>, for 'raise'.
181 2006-09-26 Eric Blake <ebb9@byu.net>
183 * verror.c: Include <config.h> unconditionally.
185 2006-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
187 * gl_anylinked_list2.h [lint] (gl_linked_iterator)
188 (gl_linked_iterator_from_to): Initialize struct completely.
189 * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
190 (gl_tree_iterator_from_to): Likewise
191 * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
192 * gl_array_list.c [lint] (gl_array_iterator)
193 (gl_array_iterator_from_to): Likewise.
194 * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
195 * gl_carray_list.c [lint] (gl_carray_iterator)
196 (gl_carray_iterator_from_to): Likewise.
198 * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
199 * md4.c (md4_process_block): Remove unused variable.
200 * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
201 parentheses for clarity.
203 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
205 Import this patch from libc:
207 2006-09-06 Jakub Jelinek <jakub@redhat.com>
209 * regex_internal.c (re_string_reconstruct): Handle
210 offset < pstr->valid_raw_len && pstr->offsets_needed case.
211 Ensure no bytes read before raw_mbs array. Pass a saved copy of
212 pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
213 re_string_context_at.
215 2006-09-20 Bruno Haible <bruno@clisp.org>
217 * mkdtemp.c: Import from libc.
218 2006-04-07 Ulrich Drepper <drepper@redhat.com>
219 * sysdeps/posix/tempname.c (__gen_tempname): Change
220 attempts_min into a macro. Use preprocessor to decide how to
221 initialize attempts [Coverity CID 67].
222 2001-11-27 Paul Eggert <eggert@twinsun.com>
223 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
224 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
226 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
228 * mkstemp.h: New file, since some standard headers
230 * mkstemp.c: Revamp to put the !_LIBC code together.
232 Make the _LIBC code resemble glibc original more,
234 * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
235 (mkstemp): Remove, since mkstemp.h does this for us.
236 * stdlib--.h: Include mkstemp.h.
238 Import this patch from libc:
240 2006-04-07 Ulrich Drepper <drepper@redhat.com>
242 * tempname.c (__gen_tempname): Change attempts_min
243 into a macro. Use preprocessor to decide how to initialize
244 attempts [Coverity CID 67].
246 2006-09-18 Bruno Haible <bruno@clisp.org>
248 * javaversion.c: Include configmake.h.
250 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
252 * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
253 that prevented coreutils 6.1 from building. Problem reported
254 by Petter Reinholdtsen.
256 2006-09-18 Jim Meyering <jim@meyering.net>
258 * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
260 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
262 * dirchownmod.c: Don't include fcntl.h; no longer needed.
263 (dirchownmod): New arg FD. All callers changed.
264 Use FD rather than opening the directory ourself, as opening is
265 now the caller's responsibility.
266 * dirchownmod.h: Likewise.
267 * mkancesdirs.c: Include <sys/types.h>, for portability to older
268 hosts that require <sys/types.h> before <sys/stat.h>. Include
269 fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
271 (mkancesdirs): Return length of prefix of FILE that has already
272 been made, or -2 if there is a child doing the work. Redo
273 algorithm so that it is O(N) rather than O(N**2). Optimize away
274 ".", and treat ".." specially since it might stray back into
275 already-created areas. Use a subprocess if necessary. New arg
276 WD; all users changed. MAKE_DIR function should now return 1
277 if it creates a directory that is not readable. Return -2 if
278 a child process is spun off.
279 * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
280 Adjust signature to match code.
281 * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
282 (make_dir_parents): Use a subprocess if necessary. New arg WD;
284 * savewd.c, savewd.h: New files.
286 2006-09-15 Jim Meyering <jim@meyering.net>
288 * rename-dest-slash.c (has_trailing_slash): Use
289 FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
290 (rpl_rename_dest_slash): Perform the cheaper trailing slash
291 test before testing whether SRC is a directory.
292 Suggestions from Bruno Haible.
294 Avoid a warning about an unused variable.
295 * regex_internal.c (re_dfa_add_node): Move declaration of "type"
296 into the #ifdef block where it's used.
298 * rename-dest-slash.c: New file.
300 2006-09-14 Bruno Haible <bruno@clisp.org>
302 * allocsa.c: Include <config.h> unconditionally.
303 * asnprintf.c: Likewise.
304 * asprintf.c: Likewise.
305 * c-strcasecmp.c: Likewise.
306 * c-strcasestr.c: Likewise.
307 * c-strncasecmp.c: Likewise.
308 * c-strstr.c: Likewise.
309 * classpath.c: Likewise.
310 * clean-temp.c: Likewise.
311 * concatpath.c: Likewise.
312 * copy-file.c: Likewise.
313 * csharpcomp.c: Likewise.
314 * csharpexec.c: Likewise.
315 * execute.c: Likewise.
316 * fatal-signal.c: Likewise.
317 * findprog.c: Likewise.
318 * fwriteerror.c: Likewise.
319 * gl_array_list.c: Likewise.
320 * gl_array_oset.c: Likewise.
321 * gl_avltree_list.c: Likewise.
322 * gl_avltree_oset.c: Likewise.
323 * gl_avltreehash_list.c: Likewise.
324 * gl_carray_list.c: Likewise.
325 * gl_linked_list.c: Likewise.
326 * gl_linkedhash_list.c: Likewise.
327 * gl_list.c: Likewise.
328 * gl_oset.c: Likewise.
329 * gl_rbtree_list.c: Likewise.
330 * gl_rbtree_oset.c: Likewise.
331 * gl_rbtreehash_list.c: Likewise.
332 * imaxabs.c: Likewise.
333 * imaxdiv.c: Likewise.
334 * javacomp.c: Likewise.
335 * javaexec.c: Likewise.
336 * javaversion.c: Likewise.
337 * linebreak.c: Likewise.
338 * localcharset.c: Likewise.
340 * mbchar.c: Likewise.
341 * mbswidth.c: Likewise.
342 * mkdtemp.c: Likewise.
344 * printf-args.c: Likewise.
345 * printf-parse.c: Likewise.
346 * progname.c: Likewise.
347 * progreloc.c: Likewise.
348 * readlink.c: Likewise.
349 * sh-quote.c: Likewise.
350 * stpcpy.c: Likewise.
351 * stpncpy.c: Likewise.
352 * strcasecmp.c: Likewise.
353 * strcasestr.c: Likewise.
354 * strcspn.c: Likewise.
355 * striconv.c: Likewise.
356 * strncasecmp.c: Likewise.
357 * strnlen1.c: Likewise.
358 * strstr.c: Likewise.
359 * strtok_r.c: Likewise.
361 * tmpdir.c: Likewise.
362 * unicodeio.c: Likewise.
363 * unsetenv.c: Likewise.
364 * vasnprintf.c: Likewise.
365 * vasprintf.c: Likewise.
366 * wait-process.c: Likewise.
367 * xallocsa.c: Likewise.
368 * xsetenv.c: Likewise.
369 * xstriconv.c: Likewise.
371 2006-09-13 Eric Blake <ebb9@byu.net>
373 * getopt.c: Fix typo in last commit.
375 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
377 * _fpending.c: Include <config.h> unconditionally, since we no
378 longer worry about uses that don't define HAVE_CONFIG_H.
379 * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
380 * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
381 * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
382 * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
383 * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
384 * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
385 * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
386 * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
387 * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
388 * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
389 * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
390 * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
391 * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
392 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
393 * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
394 * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
395 * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
396 * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
397 * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
398 * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
399 * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
400 * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
401 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
402 * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
403 * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
404 * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
405 * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
406 * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
407 * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
408 * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
409 * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
410 * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
411 * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
412 * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
415 2006-09-12 Jim Meyering <jim@meyering.net>
417 * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
418 compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
419 Reported by Nelson H. F. Beebe.
421 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
423 * argp-help.c (argp_doc): Make sure NULL is not passed to
426 2006-09-10 Bruno Haible <bruno@clisp.org>
428 * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
430 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
432 * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
433 program_invocation_name and program_invocation_short_name are
435 * argp-namefrob.h: Move declarations of program_invocation_name
436 and program_invocation_short_name to argp.h, so they are visible
440 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
442 * argp.h (struct argp): Document the N_("..") "\v" N_("..")
443 convention. Text proposed by Bruno Haible.
444 (struct argp_option): Document the use of N_() wrappers.
446 * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
447 and translate the two parts separately, instead of feeding
448 the whole string to gettext. This allows to exclude
449 '\v' from the strings visible to the translator by writing doc
450 strings as N_("..") "\v" N_("..").
452 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
454 * mktime.c (guess_time_tm): Fix bug where mktime
455 returned the maximum time_t value rather than (time_t) -1.
456 Problem originally reported by William Bardwell
457 <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
459 * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
461 * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
464 2006-09-06 Bruno Haible <bruno@clisp.org>
466 * striconv.h: New file.
467 * striconv.c: New file, merging iconvme.c with GNU gettext's
469 * xstriconv.h: New file.
470 * xstriconv.c: New file.
472 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
474 * argz_.h: Sync from Libtool.
476 2006-09-04 George Bosilca <bosilca@cs.utk.edu>
477 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
479 * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
481 2006-09-05 Davide Angelocola <davide.angelocola@tiscali.it>
486 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
488 * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
489 Problem reported by Ralf Wildenhues in
490 <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
492 * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
493 HAVE_STRUCT_STATFS_F_FSTYPENAME.
495 2006-08-31 Paul Eggert <eggert@cs.ucla.edu>
497 * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
498 or stdbool.h, because they might not exist while configuring.
500 * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
501 Don't include unistd.h or limits.h; not needed, since chdir-long.h
503 (O_DIRECTORY): Remove.
505 2006-08-30 Paul Eggert <eggert@cs.ucla.edu>
507 Work around a bug in both the Linux and SunOS 64-bit kernels:
508 nanosleep mishandles sleeps for longer than 2**31 seconds.
509 Problem reported by Frank v Waveren in
510 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
511 * nanosleep.c (BILLION): New constant.
512 (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
513 (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
515 2006-08-30 Jim Meyering <jim@meyering.net>
517 * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
520 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
522 * isapipe.c, isapipe.h: New files.
524 2006-08-29 Eric Blake <ebb9@byu.net>
526 * error.c (error_at_line, print_errno_message): Match libc, after
527 resolution of upstream bug 3044.
529 2006-08-29 Bruno Haible <bruno@clisp.org>
531 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
533 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
537 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
539 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
540 sharing with gnulib. Report by Eric Blake.
542 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
544 * fcntl_.h: New file.
545 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
547 * dirchownmod.c: Likewise.
550 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
551 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
552 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
553 just before including <inttypes.h>, to avoid circular inclusion.
555 2006-08-28 Bruno Haible <bruno@clisp.org>
557 * inttypes_.h (SCNX*): Remove definitions.
558 Reported by Eric Blake.
560 2006-08-26 Bruno Haible <bruno@clisp.org>
562 * vasnprintf.c (EOVERFLOW): Remove definition.
563 (VASNPRINTF): Return a string of length > INT_MAX without failing.
564 * vasprintf.c: Include errno.h, limits.h.
565 (EOVERFLOW): New fallback definition.
566 (vasprintf): Test here whether the string length is > INT_MAX.
567 * vsnprintf.c: Include errno.h, limits.h.
568 (EOVERFLOW): New fallback definition.
569 (vsnprintf): Fix bug when generated string was too long for the buffer.
570 Test here whether the string length is > INT_MAX.
572 2006-08-26 Bruno Haible <bruno@clisp.org>
573 Simon Josefsson <jas@extundo.com>
576 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
578 2006-08-28 Bruno Haible <bruno@clisp.org>
580 * c-strstr.h: New file, from GNU gettext.
581 * c-strstr.c: New file, from GNU gettext.
583 2006-08-26 Bruno Haible <bruno@clisp.org>
585 * inttypes_.h: New file.
586 * inttypes.h: Remove file.
587 * stdint_.h: Include <inttypes.h> through its absolute filename.
589 * imaxabs.c: New file.
591 * imaxdiv.c: New file.
593 2006-08-22 Bruno Haible <bruno@clisp.org>
595 * readutmp.h: Skip most definitions if neither <utmp.h> nor
598 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
601 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
602 Problem reported by Bruno Haible.
604 2006-08-21 Bruno Haible <bruno@clisp.org>
607 * mbchar.h: Include <wctype.h> only if it exists.
609 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
611 * cycle-check.h: Include <stdint.h> unconditionally, since we
612 now assume the stdint module. Do not include inttypes.h.
613 * fsusage.h: Likewise.
614 * getndelim2.c: Likewise.
616 * inttostr.h: Likewise.
617 * obstack.c: Likewise.
618 * regex_internal.h: Likewise.
619 * tempname.c: Likewise.
620 * utimecmp.c: Likewise.
621 * xstrtol.h: Likewise.
623 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
625 * strtoimax.c: Adjust to macro name changes in Autoconf,
626 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
629 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
631 * fchmodat.c: New file, from coreutils. This was inadvertently
632 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
634 2006-08-18 Bruno Haible <bruno@clisp.org>
636 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
637 (ME_DUMMY): Treat "kernfs" as a dummy.
638 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
640 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
642 Update from coreutils.
644 * __fpending.h: Add copyright notice.
645 * fprintftime.h: Likewise.
646 * savedir.c: Use (C) in copyright notice.
647 * savedir.h: Likewise.
649 2006-08-15 Jim Meyering <jim@meyering.net>
651 * at-func.c: New file, with the logic of all emulated at-functions.
652 * openat-priv.h: Include <errno.h> and define ENOSYS,
653 in support of the EXPECTED_ERRNO macro.
654 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
655 Instead, define the appropriate symbols and include "at-func.c".
656 * mkdirat.c (mkdirat): Likewise.
657 * fchmodat.c (fchmodat): Likewise.
658 (ENOSYS): Remove definition.
659 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
660 Don't include "unistd--.h" -- it wasn't ever used.
662 2006-01-17 Jim Meyering <jim@meyering.net>
664 Rewrite fts.c not to change the current working directory,
665 by using openat, fstatat, fdopendir, etc..
667 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
668 (HAVE_OPENAT_SUPPORT): Define.
669 [_LIBC] (fchdir): Don't undef or define; no longer used.
670 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
671 Now, this `function' always succeeds, and consumes its file descriptor
672 parameter -- so callers must not close such FDs. Update callers.
673 (diropen_fd, opendirat, cwd_advance_fd): New functions.
674 (diropen): Add parameter, SP. Adjust all callers.
675 Implement using diropen_fd, rather than open.
676 (fts_open): Initialize new member, fts_cwd_fd.
677 Remove fts_rft-setting code.
678 (fts_close): Close fts_cwd_fd, if necessary.
679 (__opendir2): Define in terms of opendir or opendirat,
680 depending on whether the FST_NOCHDIR flag is set.
681 (fts_build): Since fts_safe_changedir consumes its FD, and since
682 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
683 and close the dup'd file descriptor upon failure.
684 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
685 (fts_safe_changedir): Tweak semantics to reflect that this function
686 now calls cwd_advance_fd and hence consumes its FD argument.
687 * fts_.h [struct FTS] (fts_cwd_fd): New member.
688 [struct FTS] (fts_rft): Remove now-unused member.
689 [struct FTS] (fts_cycle.state): Improve comment.
691 * openat.c (openat_needs_fchdir): New function.
692 * openat.h (openat_needs_fchdir): Declare it.
694 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
696 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
697 Problem and fix reported by Pádraig Brady in
698 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
700 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
702 * memcoll.c (memcoll): Optimize for the common case where the
703 arguments are bytewise equal.
705 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
707 Change copyright notice from LGPL 2 to GPL 2, since that's the
708 standard form used in the gnulib repository.
709 * lock.c: LGPL -> GPL.
711 * strnlen1.c: Likewise.
712 * strnlen1.h: Likewise.
715 * tmpdir.c: Likewise.
717 * TODO: Remove; this belongs only in coreutils.
719 2006-08-14 Eric Blake <ebb9@byu.net>
721 Import the following change from libc:
723 2006-08-12 Ulrich Drepper <drepper@redhat.com>
726 * misc/error.c: Add space between program name and message if file
729 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
731 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
732 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
734 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
735 in wchar_t. Problem reported by Eric Blake.
737 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
738 LEN is smaller than SIZE. Suggested by Bruno Haible.
739 Also, help the compiler to keep LEN in a register.
741 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
743 * .cppi-disable: Add snprintf.h, socket_.h.
744 * snprintf.c: Include <errno.h> and <limits.h>.
745 (EOVERFLOW): Define if the system does not.
746 Do not include "minmax.h"; it wasn't used.
747 (snprintf): Don't assume size_t promotes to an unsigned type.
748 Fix bug when generated string was too long for the buffer: the
749 buffer's contents are supposed to be the initial prefix of the
750 output. Don't assume vasnprintf returns EOVERFLOW if the size
751 exceeds INT_MAX; do the check ourselves.
753 Import the following changes from libc:
755 2006-06-02 Jakub Jelinek <jakub@redhat.com>
757 * posix/regex_internal.c (re_string_skip_chars): If no character has
758 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
759 to the byte which couldn't be converted.
760 (re_string_reconstruct): Don't clear valid_raw_len before calling
761 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
762 tip_context using re_string_context_at.
764 2006-05-02 Ulrich Drepper <drepper@redhat.com>
766 * posix/regex.h: g++ still cannot handled [restrict].
768 2006-04-21 Ulrich Drepper <drepper@redhat.com>
770 * posix/regex.h: Remove special handling for VMS.
772 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
776 2006-07-19 Mike Frysinger <vapier@gentoo.org>
778 * mountlist.c [ME_REMOTE]: Filter out cifs.
779 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
781 2006-08-08 Eric Blake <ebb9@byu.net>
783 * verror.c (verror_at_line): Work around glibc bug 2997, so that
784 verror_at_line output complies with GNU Coding Standards even when
787 2006-08-08 Eric Blake <ebb9@byu.net>
789 * verror.h, verror.c: New files.
791 2006-08-07 Bruno Haible <bruno@clisp.org>
793 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
795 Reported by Ralf Wildenhues.
797 2006-08-06 Eric Blake <ebb9@byu.net>
799 * error.h: Fold in some upstream changes from glibc.
802 2006-07-29 Bruno Haible <bruno@clisp.org>
804 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
806 2006-07-29 Bruno Haible <bruno@clisp.org>
808 * setenv.c: Undo unintended modification done on 2006-02-27.
810 2006-07-28 Eric Blake <ebb9@byu.net>
812 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
815 2006-07-28 Simon Josefsson <jas@extundo.com>
817 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
820 2006-07-28 Simon Josefsson <jas@extundo.com>
822 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
825 2006-07-28 Bruno Haible <bruno@clisp.org>
827 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
829 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
831 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
834 2006-07-28 Bruno Haible <bruno@clisp.org>
836 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
837 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
839 Avoids link error on FreeBSD 4.x.
840 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
842 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
844 * mbswidth.c (iswcntrl): Likewise.
846 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
848 * modechange.c (mode_compile): Numeric modes now affect setuid and
849 setgid on directories only if they set these bits.
850 * modechange.h: Remove obsolete comment about masks.
852 2006-07-27 Bruno Haible <bruno@clisp.org>
854 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
855 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
858 2006-07-26 Eric Blake <ebb9@byu.net>
860 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
861 like mingw that lack mkstemp.
862 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
863 avoid compilation warning on mingw.
865 2006-07-25 Bruno Haible <bruno@clisp.org>
867 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
868 <stdarg.h> or config.h.
870 2006-07-24 Bruno Haible <bruno@clisp.org>
872 * clean-temp.h: New file, from GNU gettext.
873 * clean-temp.c: New file, from GNU gettext.
875 2006-07-24 Bruno Haible <bruno@clisp.org>
877 * tmpdir.h: New file, from GNU gettext.
878 * tmpdir.c: New file, from GNU gettext.
880 2006-07-23 Bruno Haible <bruno@clisp.org>
882 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
883 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
884 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
885 gl_linked_remove_at): Use it.
887 2006-07-23 Eric Blake <ebb9@byu.net>
889 * tmpfile-safer.c: New file.
890 * stdio-safer.h (fopen_safer): Add prototype.
891 * stdio--.h (tmpfile): Make safer.
893 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
895 * close-stream.c, close-stream.h: New files.
897 2006-07-22 Bruno Haible <bruno@clisp.org>
899 Merge from GNU gettext 0.15.
901 2005-07-05 Bruno Haible <bruno@clisp.org>
903 * printf-args.c (printf_fetchargs): Work around broken
904 definition of wint_t on mingw.
906 2005-02-12 Bruno Haible <bruno@clisp.org>
908 * xallocsa.h: Add extern "C" for C++.
910 2006-05-17 Bruno Haible <bruno@clisp.org>
913 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
915 2006-04-30 Bruno Haible <bruno@clisp.org>
917 * progreloc.c: Include <mach-o/dyld.h> if available.
918 (find_executable): Use _NSGetExecutablePath when possible.
920 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
922 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
925 2005-12-29 Bruno Haible <bruno@clisp.org>
927 * progreloc.c (set_program_name_and_installdir): Fix
930 2005-12-04 Bruno Haible <bruno@clisp.org>
933 * progreloc.c: Include <windows.h> also on Cygwin.
934 (find_executable): Add support for Cygwin.
935 (set_program_name_and_installdir): Handle also platforms with
938 2006-07-11 Bruno Haible <bruno@clisp.org>
940 * javacomp.c: Fix a comment.
941 Reported by Jim Meyering.
943 2006-04-30 Bruno Haible <bruno@clisp.org>
945 * javacomp.h (compile_java_class): Add source_version,
946 target_version arguments.
947 * javacomp.c: Rewritten to choose only a compiler that
948 respects the specified source_version and target_version.
950 2006-06-27 Bruno Haible <bruno@clisp.org>
952 Assume correct S_ISDIR macro.
953 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
955 2006-07-22 Bruno Haible <bruno@clisp.org>
957 * javaversion.h: New file, from GNU gettext.
958 * javaversion.c: New file, from GNU gettext.
959 * javaversion.java: New file, from GNU gettext.
960 * javaversion.class: New file, from GNU gettext.
962 2006-05-17 Bruno Haible <bruno@clisp.org>
965 * javaexec.c (execute_java_class): Test for jview program
968 2006-04-09 Bruno Haible <bruno@clisp.org>
970 * fatal-signal.c: Don't include string.h.
971 (at_fatal_signal): Use a copying loop instead of memcpy.
973 2005-12-04 Bruno Haible <bruno@clisp.org>
975 * csharpexec.c: Add support for 'clix' launcher (untested).
976 (execute_csharp_using_sscli): New function.
977 (execute_csharp_program): Call it.
979 2006-06-21 Bruno Haible <bruno@clisp.org>
981 Avoid warnings from recent versions of mcs.
982 * csharpcomp.c (compile_csharp_using_mono): Don't use options
983 -o, -L, -r any more. Use options documented since mcs-1.0
984 instead. Similarly for -g.
986 2005-07-09 Bruno Haible <bruno@clisp.org>
988 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
990 Reported by Mark Junker <mjscod@gmx.de>.
992 2006-06-17 Bruno Haible <bruno@clisp.org>
994 * config.charset: Update for NetBSD 3.0.
996 2006-05-17 Bruno Haible <bruno@clisp.org>
999 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
1001 2006-05-16 Bruno Haible <bruno@clisp.org>
1003 * localcharset.c [CYGWIN]: Include <windows.h>.
1004 (get_charset_aliases): For Cygwin, return the same CPxxx
1005 aliases list as under WIN32.
1006 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
1007 the environment variables. Fall back to GetACP().
1009 2006-04-05 Bruno Haible <bruno@clisp.org>
1011 * config.charset: Update Juan Manuel Guerrero's address.
1013 2005-02-12 Bruno Haible <bruno@clisp.org>
1015 * allocsa.h: Add extern "C" for C++.
1017 2005-02-10 Bruno Haible <bruno@clisp.org>
1019 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
1020 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
1022 2006-07-22 Bruno Haible <bruno@clisp.org>
1024 * gettext.h: Update to GNU gettext-0.15.
1026 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1027 and Simon Josefsson <jas@extundo.com>
1029 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
1031 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
1033 2006-07-21 Eric Blake <ebb9@byu.net>
1035 * stdlib-safer.h: New file from coreutils, required by
1038 2006-07-19 Derek R. Price <derek@ximbiot.com>
1040 * getaddrinfo.h: Don't define unimplemented AI_* flags.
1041 Reindent and repaginate.
1043 2006-07-17 Bruno Haible <bruno@clisp.org>
1045 * gl_list.h: New file.
1046 * gl_list.c: New file.
1047 * gl_array_list.h: New file.
1048 * gl_array_list.c: New file.
1049 * gl_carray_list.h: New file.
1050 * gl_carray_list.c: New file.
1051 * gl_linked_list.h: New file.
1052 * gl_linked_list.c: New file.
1053 * gl_anylinked_list1.h: New file.
1054 * gl_anylinked_list2.h: New file.
1055 * gl_avltree_list.h: New file.
1056 * gl_avltree_list.c: New file.
1057 * gl_anyavltree_list1.h: New file.
1058 * gl_anyavltree_list2.h: New file.
1059 * gl_rbtree_list.h: New file.
1060 * gl_rbtree_list.c: New file.
1061 * gl_anyrbtree_list1.h: New file.
1062 * gl_anyrbtree_list2.h: New file.
1063 * gl_anytree_list1.h: New file.
1064 * gl_anytree_list2.h: New file.
1065 * gl_linkedhash_list.h: New file.
1066 * gl_linkedhash_list.c: New file.
1067 * gl_anyhash_list1.h: New file.
1068 * gl_anyhash_list2.h: New file.
1069 * gl_avltreehash_list.h: New file.
1070 * gl_avltreehash_list.c: New file.
1071 * gl_rbtreehash_list.h: New file.
1072 * gl_rbtreehash_list.c: New file.
1073 * gl_anytreehash_list1.h: New file.
1074 * gl_anytreehash_list2.h: New file.
1076 * gl_oset.h: New file.
1077 * gl_oset.c: New file.
1078 * gl_array_oset.h: New file.
1079 * gl_array_oset.c: New file.
1080 * gl_avltree_oset.h: New file.
1081 * gl_avltree_oset.c: New file.
1082 * gl_rbtree_oset.h: New file.
1083 * gl_rbtree_oset.c: New file.
1084 * gl_anytree_oset.h: New file.
1086 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
1088 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1090 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1091 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1092 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
1093 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1094 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
1095 callers changed. Revamp internals significantly, by not
1096 attempting to create directories that are temporarily more
1097 permissive than the final results. Do not attempt to use
1098 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1099 This removes some race conditions, fixes some bugs, and simplifies
1100 things. Use new dirchownmod function to do owner and mode changes.
1101 * mkdir-p.h: Likewise.
1102 * modechange.c (octal_to_mode): New function.
1103 (struct mode_change): New member mentioned.
1104 (make_node_op_equals): New arg mentioned. All callers changed.
1105 (mode_compile): Keep track of which mode bits the user has explicitly
1107 (mode_adjust): New arg DIR, so that we implement the X op correctly.
1108 New arg PMODE_BITS, to keep track of which mode bits the user
1109 mentioned; it treats S_ISUID and S_ISGID speciall.
1110 All callers changed.
1111 * modechange.h: Likewise.
1113 2006-07-11 Derek R. Price <derek@ximbiot.com>
1115 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1117 2006-07-10 Derek R. Price <derek@ximbiot.com>
1119 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1120 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
1121 macros into the GNU _D_EXACT_NAMLEN.
1122 * savedir.c: Likewise.
1123 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1125 2006-07-09 Jim Meyering <jim@meyering.net>
1127 * argp-pv.c: Remove a doubled word in a comment.
1128 * check-version.c (check_version): Likewise.
1129 * javacomp.c (compile_java_class): Likewise.
1131 2006-07-08 Jim Meyering <jim@meyering.net>
1133 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1135 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1137 * getaddrinfo.c: Changes to compile under MSVC6: changed
1138 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1139 brackets. Other minor changes to suppress some compiler
1142 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1144 * getloadavg.c: Use __VMS, not VMS.
1145 * getopt.c: Likewise.
1146 * getpagesize.h: Likewise.
1147 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1148 probably does not work.
1150 2006-07-06 Derek R. Price <derek@ximbiot.com>
1151 and Paul Eggert <eggert@cs.ucla.edu>
1153 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1154 Don't worry about this obsolete case any more.
1155 (HAVE_DIR): Remove. All uses removed; we now assume you can read
1157 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1158 worry about this obsolete case any more.
1160 * getcwd.c: Likewise.
1162 * savedir.c: Likewise.
1164 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
1166 * .cppi-disable: Add wcwidth.
1167 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
1168 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1169 (ISGRAPH): Remove. All uses changed to isgraph.
1170 (FOLD) [!defined _LIBC]: Remove special case.
1171 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1172 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1174 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1176 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1178 * strtod.c (strtod): cast the argument of tolower to unsigned char.
1180 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
1182 * memcasecmp.c: Include <limits.h>.
1183 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1184 * strtod.c (strtod): Don't assume isspace works on negative chars.
1185 Don't assume isdigit succeeds only on '0' through '9'.
1187 2006-07-05 Derek R. Price <derek@ximbiot.com>
1189 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1190 All uses of is_space replaced by isspace.
1191 * exit.h: Don't talk about STDC_HEADERS.
1192 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
1193 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1194 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
1195 replaced by isprint etc.
1196 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1197 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1198 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1199 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1200 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1201 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1203 2006-07-05 Eric Blake <ebb9@byu.net>
1205 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1206 missing from netdb.h.
1207 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1209 2006-06-27 Bruno Haible <bruno@clisp.org>
1211 Assume ANSI C header files and <ctype.h> functions.
1212 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1213 (mbsnwidth): Use isprint, iscntrl instead.
1215 2006-07-03 Jim Meyering <jim@meyering.net>
1217 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1218 macro is used before the first cycle_check call.
1220 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
1222 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1223 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
1224 reported by Mark D. Baushke, one in
1225 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1227 Merge from coreutils.
1229 * .cppi-disable: Add stdint_.h.
1230 * .cvsignore: Add stdint.h.
1232 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
1234 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1235 both double and long double versions.
1236 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
1237 * xstrtold.c: New file.
1238 * xstrtod.h (xstrtold): New decl.
1240 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1242 * filemode.c (setst): Remove.
1243 (strmode): Rewrite to avoid setst. This makes the code shorter,
1244 (arguably) clearer, and the generated code is a bit smaller on my
1245 Debian GNU/Linux stable x86 host.
1247 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
1249 * filemode.c: Include "filemode.h" first, to test the interface.
1250 Assume that filemode.h includes sys/types.h and sys/stat.h.
1251 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1252 (ftypelet): Reorder to put common cases first, for efficiency.
1253 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
1255 (strmode): Renamed from mode_string, and now stores 12 bytes instead
1256 of 10, for compatibility with FreeBSD. All callers changed.
1257 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1258 that can't be deduced solely from st_mode. First arg is now a const
1260 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1261 (strmode): Renamed from mode_string.
1262 (filemodestring): New decl.
1263 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1264 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1265 (S_ISPORT, S_ISWHT): New macros, if not already defined.
1267 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
1269 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1270 fsusage.h now does that. Include fsusage.h first, to test interface.
1271 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
1272 at most one method (the old code could have generated decls that
1273 didn't conform to C89, not that this was ever exercised).
1274 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1276 2006-03-19 Jim Meyering <jim@meyering.net>
1278 Work even in a chroot where d_ino values for entries in "/"
1279 don't match the stat.st_ino values for the same names.
1280 * getcwd.c (__getcwd): When no d_ino value matches the target inode
1281 number, iterate through all entries again, using lstat instead.
1282 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1283 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1285 * getcwd.c (__getcwd): Clarify a comment.
1286 Use memcpy in place of a call to strcpy.
1288 2006-03-12 Jim Meyering <jim@meyering.net>
1290 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1291 that of the current directory (which we're about to chdir ".." out of),
1292 then save the dev-ino of the parent, instead.
1294 * same-inode.h (SAME_INODE): New file/macro.
1295 * chdir-safer.c (SAME_INODE): Remove definition.
1296 Include "same-inode.h", instead.
1298 * cycle-check.h: Include "same-inode.h".
1299 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1300 * cycle-check.c (SAME_INODE): Remove definition.
1301 * root-dev-ino.h: Include "same-inode.h".
1303 2006-03-11 Eric Blake <ebb9@byu.net>
1305 * same.c (same_name): s/base_name/last_component/
1306 * backupfile.c (check_extension, numbered_backup): Likewise.
1307 * filenamecat.c (file_name_concat): Likewise.
1309 2006-03-11 Eric Blake <ebb9@byu.net>,
1310 Paul Eggert <eggert@cs.ucla.edu>
1312 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1313 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1315 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1316 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1317 (last_component): New method.
1318 * dirname.c (dir_len): Determine when drive letters need a
1319 subsequent slash. Preserve // when it is special.
1320 (dir_name): Don't append dot when drive letter is absolute.
1321 [TEST_DIRNAME]: Move into a full-blown gnulib test.
1322 * basename.c (base_name): New semantics - malloc the result.
1323 Preserve // when it is special. Preserve relative files that look
1325 (base_len): Preserve // when it is special.
1326 (last_component): New method, similar to old base_name semantics.
1327 * stripslash.c (strip_trailing_slashes): Use last_component, not
1328 base_name. Strip redundant slashes from ///.
1330 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
1332 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1333 both are 64 bits, since this seems to be the tradition, and this
1334 prevents gcc -Wformat from warning about usages with PRIuMAX. If
1335 we ever run into a host that prefers long long to long in this
1336 case, we'll need another configure-time test. Problem reported by
1339 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
1341 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1342 possible collision with system files.
1343 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1344 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1345 WCHAR_MIN and WCHAR_MAX in this case.
1346 (<stddef.h>): Do not include; no longer needed.
1347 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1348 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1349 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1350 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1351 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1352 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1353 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1354 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1355 !defined(__c99))]: Include in this case too, since it's harmless
1357 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1359 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1360 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1361 (_STDINT_MIN, _STDINT_MAX): New macros.
1362 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1363 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1364 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1365 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1366 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1367 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1368 macros, not typedefs; this simplifies things quite a bit.
1369 Use long int for all types narrower than int64_t.
1370 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1371 Define in terms of long long int or int64_t or long int,
1372 not int64_t or int32_t. This saves some compile-time testing.
1373 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1374 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1375 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1376 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1377 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1378 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1379 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1380 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1381 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1382 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1383 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1384 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1385 undef any previous version and define our own version, for
1386 simplicity and consistency with the new macros for types.
1387 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1388 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1389 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1390 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
1391 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1392 @WINT_T_SUFFIX@ to keep things simple here.
1393 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1394 Simplify by assuming typical 8/16/32/64 host, since we're
1395 already doing that elsewhere anyway.
1396 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1397 and assume long long int is 64 bits if available. This
1398 speeds up 'configure'.
1400 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1402 * getaddrinfo.c: fixed typo
1404 2006-06-29 Eric Blake <ebb9@byu.net>
1406 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1407 unused static function.
1409 2006-06-29 Eric Blake <ebb9@byu.net>
1411 * stat_.h: New file.
1413 2006-06-29 Derek R. Price <derek@ximbiot.com>
1415 * strftime.c: Assume strftime() exists.
1417 2006-06-28 Bruno Haible <bruno@clisp.org>
1419 * getaddrinfo.h: Fix POSIX URL.
1420 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1421 (use_win32_p): Make static.
1422 (getaddrinfo): Reject service name if it is empty or does not consist
1423 solely of decimal digits, or if its value is > 65535.
1424 (getnameinfo): Remove useless casts.
1426 2006-06-28 Derek R. Price <derek@ximbiot.com>
1428 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
1429 Autoconf 2.60 says this stuff was obsolete.
1431 2006-05-12 Bruno Haible <bruno@clisp.org>
1433 * mkdtemp.c [MINGW]: Include <io.h>.
1434 (mkdir): Define using _mkdir.
1436 2006-06-28 Bruno Haible <bruno@clisp.org>
1438 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1439 declaration for wcwidth.
1440 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1442 2006-06-28 Eric Blake <ebb9@byu.net>
1444 * xvasprintf.h: Fix comments.
1446 2006-06-28 Eric Blake <ebb9@byu.net>
1448 * mbchar.h (wcwidth): Include wcwidth.h.
1449 * mbswidth.c (wcwidth): Move from here...
1450 * wcwidth.h: ...to this new file.
1452 2006-06-28 Simon Josefsson <jas@extundo.com>
1454 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1455 functions there. It will succeed on Windows XP, but on Windows
1456 2000 and (presumably) earlier, it will fail, and use the internal
1458 (use_win32_p): New function.
1459 (getaddrinfo): Use strtoul on servname, to support numeric ports.
1460 Support AI_NUMERICSERV to disable getservbyname.
1461 (getnameinfo): New function, only supports
1462 NI_NUMERICHOST|NI_NUMERICSERV for now.
1464 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1465 only have some of them. Add AI_NUMERICSERV. Add prototype for
1468 2006-06-27 Bruno Haible <bruno@clisp.org>
1470 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1472 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
1474 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1475 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
1476 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1478 2006-06-26 Bruno Haible <bruno@clisp.org>
1480 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1482 Reported by Mark D. Baushke and Larry Jones.
1484 2006-06-26 Bruno Haible <bruno@clisp.org>
1486 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1488 Suggested by Mark D. Baushke and Larry Jones.
1490 2006-06-23 Mark D. Baushke <mdb@gnu.org>
1492 * stdint_.h: Treat BSD/OS like OpenBSD.
1494 2006-06-23 Bruno Haible <bruno@clisp.org>
1496 * stdint_.h: Treat IRIX like OpenBSD.
1498 2006-06-23 Bruno Haible <bruno@clisp.org>
1500 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1501 ISO C 99 Technical Corrigendum 1.
1503 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
1505 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1506 Some compiler complained about some of them. Problem reported by
1508 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1510 2006-06-21 Simon Josefsson <jas@extundo.com>
1512 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1515 * socket_.h: Don't define WINVER.
1517 * inet_pton.h, inet_pton.c: New file, taken from glibc but
1518 slightly modified to work in gnulib.
1520 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1522 * read-file.c (fread_file): Start with buffer allocation of
1523 0 bytes rather than 1 byte; this simplifies the code.
1524 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1525 code to free buffer and save/restore errno.
1526 (internal_read_file): Remove unused local.
1528 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1530 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1531 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1532 Problem reported by Denis Excoffier in
1533 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1535 2006-06-19 Simon Josefsson <jas@extundo.com>
1537 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1539 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1541 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1543 2006-06-17 Bruno Haible <bruno@clisp.org>
1545 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1547 2006-06-17 Bruno Haible <bruno@clisp.org>
1549 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1550 problem on Solaris 2.5.1.
1552 2006-06-16 Eric Blake <ebb9@byu.net>
1554 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1555 * unicodeio.c [!defined errno]: Likewise.
1556 * strtol.c [!defined errno]: Likewise.
1557 * strtod.c [!defined errno]: Likewise.
1559 2006-06-15 Bruno Haible <bruno@clisp.org>
1561 * stdint_.h: Rewritten to be fully auto-configured.
1562 Fixes bug on HP-UX/IA64.
1564 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1566 * getdate.y (__attribute__): Don't define if already defined.
1567 Problem reported by Larry Jones.
1568 * utimens.c (__attribute__): Likewise.
1570 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1572 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1573 reported by Andreas Schwab.
1575 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1576 Bruno Haible <bruno@clisp.org>
1578 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1580 2006-05-26 Martin Lambers <marlam@marlam.de>
1582 * getpass.c: Updates the test for the native W32 API, and adds
1583 missing includes, thus fixing compilation warnings.
1585 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1587 * tempname.c (small_open, large_open): New macros.
1588 (__open, __open64) [!_LIBC]: Remove.
1589 (__gen_tempname): Use small_open and large_open instead of __open
1590 and __open64. This fixes a portability bug on HP-UX 11.11i
1591 reported by Simon Wing-Tang in
1592 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1594 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1596 * exclude.c (exclude_fnmatch): New function.
1597 (excluded_file_name): Call exclude_fnmatch.
1598 * exclude.h (excluded_file_name): New prototype
1600 2006-05-24 Bruno Haible <bruno@clisp.org>
1602 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1603 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1604 Reported by Thorsten Maerz <torte@netztorte.de> via
1605 Aaron Stone <aaron@serendipity.cx>.
1607 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1609 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1610 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1611 (my_usleep): Don't mishandle maximum value.
1613 2006-05-19 Jim Meyering <jim@meyering.net>
1615 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1617 2006-05-17 Bruno Haible <bruno@clisp.org>
1620 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1622 2006-05-17 Bruno Haible <bruno@clisp.org>
1624 * stdint_.h: Fix recognition of Cygwin.
1626 2006-05-11 Jim Meyering <jim@meyering.net>
1628 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1630 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1632 * crc.c (crc32_update): Remove unnecessary L suffix.
1633 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1634 unwanted sign propagation, e.g., on hosts with 64-bit int.
1635 There still are some problems with reeelly weird theoretical hosts
1636 (e.g., 33-bit int) but it's not worth worrying about now.
1637 * sha1.c (rol): Likewise.
1638 (K1, K2, K3, K4): Remove unnecessary L suffix.
1640 2006-05-10 Bruno Haible <bruno@clisp.org>
1642 * des.c: Cast to avoid warnings.
1644 2006-05-10 Simon Josefsson <jas@extundo.com>
1646 * md4.c: Typo fix, update copyright years.
1647 (K1, K2): Don't use L because it turn computations into 64-bit on
1650 2006-05-09 Bruno Haible <bruno@clisp.org>
1652 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1653 (EOVERFLOW): Define fallback value.
1654 (xstrcat): New function.
1655 (xvasprintf): Recognize the special case of a string concatenation.
1657 2006-05-01 Bruno Haible <bruno@clisp.org>
1659 * stdint_.h: Shorter URL.
1660 * inttypes.h: Likewise.
1662 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1664 * verify.h: Document the internals better. Most of this change
1665 was written by Bruno Haible.
1667 2006-04-29 Bruno Haible <bruno@clisp.org>
1669 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1670 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1672 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1674 * getdate.y (get_date): When adding relative date, start with the
1675 initial time, not with the result of the first mktime call.
1677 2006-04-23 Bruno Haible <bruno@clisp.org>
1679 * copy-file.c: Include <unistd.h> unconditionally.
1680 * execute.c: Likewise.
1681 * fatal-signal.c: Likewise.
1682 * findprog.c: Likewise.
1683 * mkdtemp.c: Likewise.
1686 * wait-process.h: Likewise.
1688 2006-04-23 Bruno Haible <bruno@clisp.org>
1690 * fwriteerror.c (fwriteerror): Call fclose also when an error
1691 condition was already detected.
1692 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1694 2006-04-19 Derek Price <derek@ximbiot.com>
1695 Eric Blake <ebb9@byu.net>
1697 * inttypes.h: Correct grammar in comment.
1699 2006-04-18 Derek Price <derek@ximbiot.com>
1700 Paul Eggert <eggert@cs.ucla.edu>
1702 * inttypes.h: New file.
1703 * strtoimax.c: Assume <inttypes.h>.
1705 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1707 * utimens.c (futimens): glibc futimesat messes up if /proc
1708 isn't mounted. Problem reported by Kir Kolyshkin.
1710 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1712 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1713 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1714 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1716 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1718 Merge regex changes from libc, removing some of our
1719 POSIX-conformance changes that were rejected and redoing them in a
1722 * regcomp.c (re_compile_internal, init_dfa):
1723 Length arg is now size_t, not Idx. All uses changed.
1724 (peek_token): Forward decl now says internal_function.
1725 (__re_error_msgid, __re_error_msgid_idx):
1726 Now static rather than extern with attribute_hidden.
1727 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1728 For some reason libc prefers K&R style defns for external functions.
1729 (regerror) [!defined _LIBC]: Likewise.
1730 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1731 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1732 (build_range_exp, build_collating_symbol):
1734 (re_compile_fastmap): Use '\0' to memset, not 0.
1735 (utf8_sb_map): Make the calculations more obvious.
1736 (init_dfa, parse_bracket_exp, build_charclass_op):
1737 Call calloc and cast result, as glibc does.
1738 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1739 (build_range_exp, build_collating_symbol):
1740 Now internal functions.
1742 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1744 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1745 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1746 Don't depend on VMS; depend on __VMS instead, for POSIX
1747 namespace cleanness.
1748 (regoff_t): Define to ssize_t, not long int.
1750 Remove the REG_ macros named below. Instead, make the old names
1751 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1753 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1754 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1755 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1756 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1757 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1758 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1759 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1760 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1761 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1762 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1763 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1764 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1765 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1766 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1767 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1768 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1769 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1771 Remove. All uses replaced by the old RE_* names.
1772 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1773 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1774 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1775 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1776 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1777 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1778 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1779 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1780 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1781 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1782 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1783 Don't bother having these macros be independent of each others'
1784 values, since they no longer exist in the POSIX name space.
1786 Rename the following member names back to their old names,
1787 unless !__USE_GNU_REGEX. All uses changed back.
1788 (buffer): Renamed from re_buffer.
1789 (allocated): Renamed from re_allocated.
1790 (used): Renamed from re_used.
1791 (syntax): Renamed from re_syntax.
1792 (fastmap): Renamed from re_fastmap.
1793 (translate): Renamed from re_translate.
1794 (can_be_null): Renamed from re_can_be_null.
1795 (regs_allocated): Renamed from re_regs_allocated.
1796 (fastmap_accurate): Renamed from re_fastmap_accurate.
1797 (no_sub): Renamed from re_no_sub.
1798 (not_bol): Renamed from re_not_bol.
1799 (not_eol): Renamed from re_not_eol.
1800 (newline_anchor): Renamed from re_newline_anchor.
1801 (num_regs): Renamed from rm_num_regs.
1802 (start): Renamed from rm_start.
1803 (end): Renamed from rm_end.
1805 (free_state): Move up a bit.
1807 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1808 #define to be empty.
1809 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1810 when that is what is intended.
1811 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1812 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1814 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1815 All uses changed back to re_malloc, etc. It's now the caller's
1816 responsibility to check for overflow; all callers changed.
1817 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1818 (re_x2nrealloc): Remove.
1819 (free_state): Remove decl.
1821 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1822 (re_set_registers, re_exec):
1825 2006-01-31 Roland McGrath <roland@redhat.com>
1827 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1828 Reported by Mike Frysinger <vapier@gentoo.org>.
1830 2006-01-15 Andreas Jaeger <aj@suse.de>
1833 * regex_internal.c (re_string_reconstruct): Adjust for
1834 build_wcs_upper_buffer change.
1835 (build_wcs_upper_buffer): Change return type.
1837 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1839 * regex_internal.h: Include <stdint.h> if available.
1841 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1843 * regex_internal.h (SIZE_MAX): Provide a default definition.
1845 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1847 * regcomp.c: Adjust for changed secondary hash function.
1849 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1851 * regex.h: Pretty printing.
1852 Clean up namespace a bit.
1854 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1856 * regexec.c (update_cur_sifted_state, check_arrival,
1857 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1859 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1860 Ulrich Drepper <drepper@redhat.com>
1863 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1864 (bitset_word_t): Renamed from bitset_word. All uses changed.
1866 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1869 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1870 * regcomp.c: Remove unnecessary uses of
1871 unsigned RE_TRANSLATE_TYPE.
1872 * regex_internal.h: Likewise.
1873 * regex_internal.c: Likewise.
1874 * regexec.c: Likewise.
1875 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1877 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1879 * regexec.c (find_recover_state): Remove unnecessary
1881 (transit_state_bkref): Make DFA a const pointer.
1882 (get_subexp): Likewise.
1883 (check_arrival): Likewise.
1884 (update_cur_sifted_state): Likewise.
1885 (re_search_internal): Likewise.
1886 (prune_impossible_nodes): Likewise.
1887 (acquire_init_state_context): Likewise.
1888 (proceed_next_node): Likewise.
1889 (set_regs): Likewise.
1890 (free_fail_stack_return): Likewise.
1891 (check_arrival_expand_ecl): Mark DFA parameter as const.
1892 (check_arrival_expand_ecl_sub): Likewise.
1893 (check_subexp_limits): Likewise.
1894 (sub_epsilon_src_nodes): Likewise.
1895 (add_epsilon_src_nodes): Likewise.
1896 (merge_state_array): Likewise.
1897 (update_regs): Likewise.
1898 (build_trtable): Likewise.
1899 (sift_states_backward): Mark MCTX parameter as const.
1900 (build_sifted_states): Likewise.
1901 (update_cur_sifted_state): Likewise.
1902 (sift_states_mkref): Likewise.
1903 (check_arrival_expand_ecl): Mark eclosure as const.
1904 (check_dst_limits_calc_pos_1): Likewise.
1905 * regex_internal.h (re_match_context_t): Make dfa a const
1908 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1910 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1911 (transit_state_sb): Likewise.
1912 (transit_state_mb): Likewise.
1913 (sift_states_iter_mb): Likewise.
1914 (check_arrival_add_next_nodes): Likewise.
1915 (check_node_accept_bytes): Change first parameter to pointer-to-const.
1916 [_LIBC] (re_search_2_stub): Use mempcpy.
1918 * regex_internal.c (re_string_reconstruct): Avoid calling
1919 mbrtowc for very simple UTF-8 case.
1921 * regex_internal.c (re_acquire_state): Make DFA pointer arg
1923 (re_acquire_state_context): Likewise.
1924 * regex_internal.h: Adjust prototypes.
1926 * regex.c: Prevent using C++ compilers.
1928 * regex_internal.c (re_acquire_state): Minor code rearrangement.
1929 (re_acquire_state_context): Likewise.
1931 2006-03-29 Mark D. Baushke <mdb@gnu.org>
1932 Bruno Haible <bruno@clisp.org>
1934 * stdint_.h: On OpenBSD, don't redefine types already included in
1935 <sys/types.h> and <inttypes.h>.
1937 2006-03-24 Eric Blake <ebb9@byu.net>
1939 * time_r.c (copy_string_result): Remove, as it is no longer used.
1941 2006-03-24 Simon Josefsson <jas@extundo.com>
1943 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1944 including some doc fixes.
1945 (base64_encode_alloc): Fix +1 bug on allocation failures.
1947 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1949 * base64.c (base64_encode): Do not read past end of array with
1950 unsanitized input on systems with CHAR_BIT > 8.
1952 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1954 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1955 Typedef to long int, not to off_, as POSIX will likely change
1958 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
1960 * argp-help.c (validate_uparams): Fix typo
1961 * argp-parse.c (argp_default_options): Consistently begin help
1962 messages with a lowercase letter.
1964 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
1966 * time_r.h (asctime_r, ctime_r): Remove. These functions can
1967 overrun buffers and shouldn't be used (much as gets shouldn't be
1969 * time_r.c (asctime_r, ctime_r): Likewise.
1971 2006-03-08 Simon Josefsson <jas@extundo.com>
1973 * gc-gnulib.c (randomize): Don't open files called 'no', they
1974 signal that configure disabled the device.
1976 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
1978 * c-stack.c: Include unistd.h unconditionally, since we now assume
1980 * getlogin_r.c: Likewise.
1981 * getlogin_r.h: Likewise.
1983 * pagealign_alloc.c: Likewise.
1984 * unistd_.h: Remove; no longer needed.
1986 2006-03-07 Simon Josefsson <jas@extundo.com>
1988 * unistd_.h: New file.
1990 2006-03-07 Simon Josefsson <jas@extundo.com>
1992 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1994 2006-03-01 Simon Josefsson <jas@extundo.com>
1996 * readline.c: Fix typo, tiny patch from Stepan Kasal
1999 2006-02-28 Simon Josefsson <jas@extundo.com>
2001 * getopt.c: Protect #include of unistd.h, for MSVS.
2003 2006-02-27 Simon Josefsson <jas@extundo.com>
2005 * base64.h: Indent #define's. From Jim Meyering
2008 2006-02-27 Jim Meyering <jim@meyering.net>
2010 Revert the change of 2006-02-24, so these files can continue
2011 to be sync'd from gettext.
2012 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
2015 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
2017 * glob.c: Say "invalid" rather than "illegal" in comments.
2019 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2021 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
2023 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
2025 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
2026 AT_FDCWD exceeds INT_MAX.
2027 * openat.h (AT_FDCWD): Likewise.
2029 2006-02-14 Jim Meyering <jim@meyering.net>
2031 Sync from coreutils.
2033 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
2034 failure on deficient systems, and simplify gnulib lgpl dependencies.
2035 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
2036 xmalloc/lstat combination. Based on a patch from Bruno Haible.
2038 * xalloc-die.c: Remove unused definition of N_.
2040 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
2042 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
2044 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
2046 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
2047 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2049 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
2051 * argp-namefrob.h: Restore changes accidentally lost during the
2052 "autoupdate" on 2005-12-12.
2054 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2056 * fnmatch.c (L_): Renamed from L, to work around a bug in
2057 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
2058 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
2061 2006-01-26 Simon Josefsson <jas@extundo.com>
2063 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
2064 prototype is visible on mingw32.
2066 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
2069 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
2072 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
2074 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
2075 attempt to open for write; this always fails, at least on POSIX
2076 hosts. This reinstates the 2006-01-09 change, which was
2077 inadvertently removed.
2079 2006-01-26 Bruno Haible <bruno@clisp.org>
2080 Paul Eggert <eggert@cs.ucla.edu>
2082 * stdbool_.h (_Bool)
2083 [(! (defined __cplusplus || defined __BEOS__)
2084 && !defined __GNUC__
2085 && !(defined __HP_cc || defined __xlc__
2086 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2087 || defined __sgi))]:
2088 #define to signed char in these cases too; this simplifies
2089 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2090 etc., separately) and makes it more conservative.
2092 2006-01-21 Jim Meyering <jim@meyering.net>
2094 Sync from the stable (b5) branch of coreutils:
2096 * fts.c (fts_children): Don't let close() clobber errno from
2099 * fts.c (fts_stat): When following a symlink-to-directory,
2100 don't necessarily interpret stat-fails+lstat-succeeds as indicating
2101 a dangling symlink. That can also happen at least for ELOOP.
2102 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2103 FYI, this bug predates the inclusion of fts.c in coreutils.
2105 * fts.c (fts_open): Put new maxarglen declaration and uses
2106 in their own block, so pre-c99 compilers don't object.
2108 Avoid the double-free (first in fts_read, second in fts_close) that
2109 would occur when an `active' directory is made inaccessible (e.g.,
2110 via chmod a-x) during a traversal.
2111 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2112 before returning. Reproduce this failure by
2113 mkdir -p a/b; cd a; chmod a-x . b
2114 Reported by Stavros Passas.
2116 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
2118 * argp-namefrob.h: Bugfix. Remove stray #
2120 2006-01-25 Bruno Haible <bruno@clisp.org>
2122 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2124 Reported by Paul Eggert.
2126 2006-01-25 Jim Meyering <jim@meyering.net>
2128 * fileblocks.c: Remove more useless parentheses.
2129 * readutmp.h: Likewise.
2131 2006-01-24 Bruno Haible <bruno@clisp.org>
2133 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2135 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
2138 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2139 to avoid problems with the built-in _Bool type.
2140 Reported by Paul Eggert on 2005-11-26.
2142 2006-01-24 Jim Meyering <jim@meyering.net>
2144 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2146 2006-01-24 Simon Josefsson <jas@extundo.com>
2148 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2151 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2153 Work around porting bugs reported by Dieter in
2154 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2155 * getopt.c (_NOPROTO): Remove; no longer needed.
2156 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2157 Include "getopt.h" first, to check interface.
2158 (getenv): Declare only if defined HAVE_DECL_GETENV &&
2160 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2161 (__strndup): Revert to K&R-style function dfns, the glibc style.
2162 * strnlen.c: Don't claim it's taken from glibc; it's not.
2163 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2164 Include strnlen.h first, to get prototype properly.
2165 (strnlen): Renamed from __strnlen.
2168 2006-01-23 Ulrich Drepper <drepper@redhat.com>
2170 These changes imported from libc.
2171 * getopt.c: Use __fxprintf instead of inline stream orientation
2172 test and two separate function calls.
2173 * strndup.c (__strndup): Add libc_hidden_def.
2175 2006-01-22 Bruno Haible <bruno@clisp.org>
2177 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2178 temporary buffer for sprintf, take into account the precision also
2179 for 'd', 'i', 'u', 'o', 'x', 'X'.
2181 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2183 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2184 to pacify gcc -Wswitch-default.
2186 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2188 * argp-help.c (usage_long_opt): Do not print DOC options.
2189 (__argp_base_name): Removed
2190 * argp-namefrob.h (__argp_basename): Removed definition. Was a
2192 (__argp_base_name): Provide macro definition or extern declaration
2193 depending on the configuration
2195 2006-01-20 Simon Josefsson <jas@extundo.com>
2197 * inet_ntop.h: Unconditionally include sys/socket.h.
2199 2006-01-19 Simon Josefsson <jas@extundo.com>
2201 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2203 2006-01-12 Simon Josefsson <jas@extundo.com>
2205 * base64.c: Fix warning, reported by Bruno Haible
2206 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2208 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
2210 Sync from coreutils.
2211 * md5.c: Fix commentary typos.
2212 (alignof, UNALIGNED_P): No need for a GCC-specific version.
2213 * md5.h (__attribute__): Remove; unused.
2214 * sha1.c: Fix commentary to match md5 better.
2215 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2216 so that we don't need to worry about alignment. All uses changed.
2217 This merges the 2005-10-28 md5 change into sha1.
2219 2006-01-11 Jim Meyering <jim@meyering.net>
2221 Sync from coreutils.
2222 * md5.c (OP): Fix spacing.
2224 2006-01-11 Simon Josefsson <jas@extundo.com>
2226 * stdint_.h (SIZE_MAX): Add missing (.
2228 2006-01-10 Bruno Haible <bruno@clisp.org>
2230 * argp.h (__const): Remove macro. Use const instead.
2231 * argp-fmtstream.h (__const): Likewise.
2232 * glob_.h (__const): Remove macro.
2233 * glob-libc.h: Use const instead of __const.
2235 2006-01-10 Jim Meyering <jim@meyering.net>
2237 Avoid the double-free (first in fts_read, second in fts_close) that
2238 would occur when an `active' directory is made inaccessible (e.g.,
2239 via chmod a-x) during a traversal.
2240 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2241 before returning. Reproduce this failure by
2242 mkdir -p a/b; cd a; chmod a-x . b
2243 Reported by Stavros Passas.
2245 Sync from coreutils.
2246 * sha1.c: Tweak grammar in a comment.
2248 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
2250 * regex_internal.h (BITSET_WORD_BITS):
2251 Work around a bug in 64-bit PGC (before version 6.1-2), where the
2252 preprocessor mishandles large unsigned values as if they were signed.
2253 Problem reported by Claudio Fontana in
2254 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2256 2006-01-10 Simon Josefsson <jas@extundo.com>
2258 * socket_.h: New file.
2260 2006-01-10 Bruno Haible <bruno@clisp.org>
2262 * localcharset.c: Update from GNU gettext.
2264 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
2266 Sync from coreutils.
2267 * chdir-long.c (cdb_free): Don't bother trying to open directory
2268 for write access: POSIX says that must fail.
2269 * fts.c (diropen): Likewise.
2270 * save-cwd.c (save_cwd): Likewise.
2271 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2272 well, for minor improvements on hosts that lack O_DIRECTORY.
2273 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2274 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2275 Fall back on chown if open failed with EACCES.
2277 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2278 Report an error at compile-time if only a 1-second nominal clock
2279 resolution is found.
2281 * lchmod.h: New file.
2282 * mkdir-p.c: Include lchmod.h, lchown.h.
2283 (make_dir_parents): Use lchown rather than chown, and
2284 lchmod rather than chmod.
2286 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2287 too. Problem with "none" reported by Bob Proulx. Problem with
2288 "proc" reported by n0dalus.
2290 * mountlist.c: Include <limits.h>.
2291 (dev_from_mount_options)
2292 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2293 New function. It no longer assumes "dev=" has the System V meaning
2294 on Linux (since it doesn't). It also parses "dev=" more carefully.
2295 (read_file_system_list)
2296 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2297 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2300 * posixtm.h (PDS_PRE_2000): New macro.
2301 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2302 All usages changed. Reject dates outside the range 1969-1999 if
2303 PDS_PRE_2000 is used.
2305 2006-01-09 Jim Meyering <jim@meyering.net>
2307 Sync from coreutils.
2309 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2311 * chdir-safer.h, chdir-safer.c: New files.
2313 * modechange.c (mode_compile): Reject an invalid mode string
2314 that starts with an octal digit. From Andreas Gruenbacher.
2316 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2317 and dup to open_safer and dup_safer, respectively.
2318 (openat_permissive): Fix typo in comment.
2320 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2321 "gettext.h"; either no longer needed or are guaranteed by openat.h.
2322 (_): Remove; no longer needed.
2323 (openat): Renamed from rpl_openat; no need for rpl_openat
2324 since openat.h renames openat for us.
2325 Replace most of the body with a call to openat_permissive,
2326 to avoid duplicate code.
2327 Port to (probably hypothetical) environments were mode_t is
2329 (openat_permissive): Require mode arg, so that we can check
2330 types better. Put it just after flags. Change cwd failure
2331 indicator from pointer-to-bool to pointer-to-errno-value.
2332 All callers changed.
2333 Invoke openat_save_fail and/or openat_restore_fail if
2334 cwd_errno is null, so that openat can call us.
2335 (openat_permissive, fdopendir, fstatat, unlinkat):
2336 Simplify errno handling to avoid some duplicate code,
2337 as it's OK to set errno on success.
2338 * openat.h: Revamp code so that function macros depend on
2339 __OPENAT_PREFIX only, not also on AT_FDCWD.
2340 (openat_ro): Remove. Caller changed to use openat_permissive.
2341 (openat_permissive): Now a macro, if not a function.
2342 (openat_restore_fail, openat_save_fail): Now always functions,
2343 since mkdirat needs them even if __OPENAT_PREFIX is defined.
2345 * openat-priv.h: New file, defining macros used by mkdirat.c
2347 * mkdirat.c: Include openat-priv.h.
2348 Remove definitions of macros defined therein.
2349 * openat.c: Likewise.
2351 * mkdirat.c (mkdirat): New file and function.
2352 * openat.h (mkdirat): Declare.
2354 * openat.c (fdopendir): Don't change errno when returning non-NULL.
2356 * openat.h (openat_permissive): Declare.
2357 (openat_ro): Define.
2359 * openat.c (EXPECTED_ERRNO): New macro.
2360 (openat_permissive): New function -- used in remove.c rewrite.
2361 (all functions): Set errno just before returning, only if there
2362 was an actual failure.
2363 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2365 Emulate openat-family functions using Linux's procfs, if possible.
2366 Idea and some code based on Ulrich Drepper's glibc changes.
2368 * openat.c: (BUILD_PROC_NAME): New macro.
2369 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2370 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2371 before falling back on save_cwd and restore_cwd.
2372 (fdopendir, fstatat, unlinkat): Likewise.
2374 * openat.c (fstatat, unlinkat): Perform the syscall directly,
2375 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2377 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2378 as second argument to va_arg. Otherwise, some versions of gcc
2379 warn that `if this code is reached, the program will abort'.
2381 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
2383 Sync from coreutils.
2385 Add POSIX ACL support
2386 * acl.h (copy_acl, set_acl): Add declarations.
2387 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2388 systems other than Linux.
2389 (chmod_or_fchmod): New function: use fchmod when possible,
2390 and chmod otherwise.
2391 (file_has_acl): Add a POSIX ACL implementation, with a
2392 Linux-specific subcase.
2393 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2394 S_ISVTX from one file to another. Fall back to fchmod/chmod when
2395 acls are unsupported.
2396 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2397 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
2400 2006-01-09 Bruno Haible <bruno@clisp.org>
2402 * sysexit_.h (EX_OK): New macro.
2403 Suggested by Martin Lambers <marlam@marlam.de>.
2405 2006-01-09 Bruno Haible <bruno@clisp.org>
2407 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2408 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2409 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2410 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2412 2006-01-09 Bruno Haible <bruno@clisp.org>
2414 * stdint_.h (SIZE_MAX): Write the value without involving negative
2417 2005-10-16 Bruno Haible <bruno@clisp.org>
2419 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2420 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2422 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2424 * strftime.c (tzname): Don't declare if it is already #defined.
2425 Problem reported for Mingw by Mark Junker.
2427 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2429 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2430 long int, not int, for nanosecond counts, so that people who are
2431 used to POSIX struct timespec won't be surprised. Reported by Jim
2434 2005-12-16 Jim Meyering <jim@meyering.net>
2436 * fprintftime.c, fprintftime.h: New files.
2438 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
2440 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2441 * argp-help.c (fill_in_uparams): Check if the constructed
2442 struct uparams is valid. Fall back to the default values if it is
2445 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
2447 * argp-help.c (__argp_base_name): New function
2448 (__argp_short_program_name): Rewrite using __argp_base_name
2449 * argp-namefrob.h: Define program_invocation_name and
2450 program_invocation_short_name if requested
2451 (__argp_base_name): Add prototype
2452 * argp-parse.c (argp_def): Use gettext wrappers
2453 (argp_default_parser): Use __argp_base_name
2454 * argp-pin.c: New file. Defines program_invocation_name and
2455 program_invocation_short_name on systems that lack them.
2457 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2459 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2460 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2461 porting problem reported by Georg Schwarz in
2462 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2464 2005-07-09 Bruno Haible <bruno@clisp.org>
2466 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2467 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2468 Reported by Mark Junker <mjscod@gmx.de>.
2470 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
2472 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2473 (uintmax_t) [defined uintmax_t]: Do not declare.
2474 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2475 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2476 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
2477 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2478 sake of portability to weird hosts that C allows (though we don't
2479 know of any practical examples).
2481 * savedir.h (fdsavedir): New decl.
2482 * savedir.c (fdsavedir, savedirstream): New functions; the latter
2483 contains most of the former guts of savedir.
2484 (savedir): Use savedirstream.
2487 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
2489 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2490 coreutils no longer futzes with rounding modes.
2492 2005-11-14 Jim Meyering <jim@meyering.net>
2494 * mkstemp-safer.c: Include <config.h>, required for possible
2495 replacement of mkstemp.
2497 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
2499 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2501 (gethrxtime) [! (HAVE_NANOUPTIME
2502 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2503 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2504 our own approximation.
2506 2005-11-10 Simon Josefsson <jas@extundo.com>
2508 * readline.c: Remove EOL.
2510 2005-11-08 Eric Blake <ebb9@byu.net>
2512 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2514 2005-11-08 Eric Blake <ebb9@byu.net>
2516 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2518 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2520 Fix porting problem reported by Theodoros V. Kalamatianos.
2521 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2522 Don't assume that futimes failing means we must fail.
2524 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2526 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2527 leave errno alone. Problem reported by Dmitry V. Levin.
2529 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2531 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2532 errno alone. Problem reported by Frederic Jolliton.
2534 2005-10-28 Simon Josefsson <jas@extundo.com>
2536 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2537 "restrict" keywords, as per POSIX. Protect the function
2538 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2539 Don't use K&R prototypes. Check the sprintf return values.
2540 Re-define EAFNOSUPPORT if not present. Indent.
2542 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2543 suggested by Bruno Haible <bruno@clisp.org>.
2545 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2547 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2549 * gc-libgcrypt.c: Add MD2 (which is not available through
2552 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2554 * md2.h, md2.c: New files.
2556 2005-10-24 Simon Josefsson <jas@extundo.com>
2558 * md4.h: Shrink buffer size, now that we changed the type.
2560 2005-10-22 Simon Josefsson <jas@extundo.com>
2562 * arcfour.h, arcfour.c: Use fixed size indices in the
2563 arcfour_context struct (simplify test vector testing in GNU
2566 2005-10-22 Simon Josefsson <jas@extundo.com>
2568 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2569 suggested by Bruno Haible <bruno@clisp.org>.
2571 2005-10-22 Simon Josefsson <jas@extundo.com>
2573 * crc.h: Include stddef.h, for size_t.
2575 2005-10-21 Simon Josefsson <jas@extundo.com>
2577 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2578 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2580 2005-10-21 Simon Josefsson <jas@extundo.com>
2582 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2585 2005-10-21 Simon Josefsson <jas@extundo.com>
2587 * gc-gnulib.c: Support ARCTWO in CBC mode.
2589 2005-10-21 Simon Josefsson <jas@extundo.com>
2591 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2594 * hmac-sha1.c (hmac_sha1): Likewise.
2596 * crc.c (crc32_update): Actually use crc parameter, suggested by
2597 Bruno Haible <bruno@clisp.org>.
2599 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2602 2005-10-21 Simon Josefsson <jas@extundo.com>
2604 * des.h, des.c: New files.
2606 * gc-gnulib.c: Support DES.c
2608 2005-10-21 Simon Josefsson <jas@extundo.com>
2610 * arctwo.h, arctwo.c: New files.
2612 * gc-gnulib.c: Support ARCTWO.
2614 2005-10-21 Simon Josefsson <jas@extundo.com>
2616 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2618 2005-10-19 Simon Josefsson <jas@extundo.com>
2620 * gc-gnulib.c: Support ARCFOUR.
2622 2005-10-19 Simon Josefsson <jas@extundo.com>
2624 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2627 * gc.h: Add ECB enum type.
2629 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2631 2005-10-19 Simon Josefsson <jas@extundo.com>
2633 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2635 2005-10-18 Simon Josefsson <jas@extundo.com>
2637 * md4.h, md4.c: New files, based on md5.?.
2639 2005-10-17 Simon Josefsson <jas@extundo.com>
2641 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2643 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2645 2005-10-17 Simon Josefsson <jas@extundo.com>
2647 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2649 2005-10-17 Simon Josefsson <jas@extundo.com>
2651 * gc.h, gc-libgcrypt.c: Add ciphers.
2653 2005-10-17 Simon Josefsson <jas@extundo.com>
2655 * sha1.c: Use uint32_t instead of md5_uint32.t
2657 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2660 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2662 * md5.h: Use stdint.h and uint32_t. Doc fix.
2664 2005-10-15 Simon Josefsson <jas@extundo.com>
2666 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2668 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2670 2005-10-14 Simon Josefsson <jas@extundo.com>
2672 * arcfour.h, arcfour.c: New files.
2674 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2676 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2677 include <wchar.h>; no longer needed.
2679 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2680 and Ulrich Drepper <drepper@redhat.com>
2683 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2684 instead of inline stream orientation test and two separate
2685 function calls. Pay no attention to USE_IN_LIBIO.
2687 2005-10-14 Roland McGrath <roland@redhat.com>
2689 Import from libc. [BZ #1331]
2690 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2692 Reported by Matej Vela <vela@debian.org>.
2694 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2696 * mkdir-p.c (make_dir_parents): Don't report an error if an
2697 intermediate directory is in a read-only file system. Problem
2698 reported by Eric Blake.
2700 2005-10-13 Simon Josefsson <jas@extundo.com>
2702 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2703 Move memory allocation outside of loop.
2705 2005-10-12 Simon Josefsson <jas@extundo.com>
2707 * gc-pbkdf2-sha1.c: New file.
2709 * gc.h: Add gc_pbkdf2_sha1 prototype.
2711 2005-10-12 Simon Josefsson <jas@extundo.com>
2713 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2714 suggested by Bruno Haible <bruno@clisp.org>.
2716 2005-10-12 Simon Josefsson <jas@extundo.com>
2718 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2720 * gc-gnulib.c (gc_hmac_sha1): New function.
2722 2005-10-12 Simon Josefsson <jas@extundo.com>
2724 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2726 2005-10-12 Simon Josefsson <jas@extundo.com>
2728 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2729 GC_USE_HMAC_MD5, respectively.
2731 * gc-libgcrypt.c (gc_md5): Fix assert call.
2734 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2736 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2738 * gc-gnulib.c (gc_hash_buffer): Ditto.
2740 2005-10-11 Bruno Haible <bruno@clisp.org>
2742 * c-strcasestr.h: New file, from GNU gettext.
2743 * c-strcasestr.c: New file, from GNU gettext.
2745 2005-10-11 Bruno Haible <bruno@clisp.org>
2747 * c-strcase.h: New file, from GNU gettext.
2748 * c-strcasecmp.c: New file, from GNU gettext.
2749 * c-strncasecmp.c: New file, from GNU gettext.
2751 2005-10-11 Simon Josefsson <jas@extundo.com>
2753 * crc.h, crc.c: New files.
2755 * gc.h (gc_hash_buffer): Add doc.
2757 2005-10-08 Simon Josefsson <jas@extundo.com>
2759 * gc.h: Add gc_hash and gc_hash_buffer.
2761 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2763 * gc-libgcrypt.c (gc_hash_buffer): Add.
2765 2005-10-11 Bruno Haible <bruno@clisp.org>
2767 * strcasecmp.c: Include limits.h.
2768 (strcasecmp): Avoid integer overflow on exotic platforms.
2769 * strncasecmp.c: Include limits.h.
2770 (strncasecmp): Avoid integer overflow on exotic platforms.
2771 Reported by Paul Eggert.
2773 2005-10-06 Simon Josefsson <jas@extundo.com>
2775 * hmac-md5.c: New file.
2779 2005-10-06 Simon Josefsson <jas@extundo.com>
2781 * memxor.c (memxor): Avoid casts and warnings.
2783 2005-10-05 Derek Price <derek@ximbiot.com>
2785 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2787 2005-10-05 Simon Josefsson <jas@extundo.com>
2789 * memxor.c (memxor): Fix compiler error.
2791 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2792 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2794 * memxor.h, memxor.c: New files.
2796 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2797 we assume all systems have it, suggested by Jim Meyering
2798 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2799 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2800 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2803 2005-10-04 Bruno Haible <bruno@clisp.org>
2805 * verify.h (verify_true): Provide alternative definition for C++.
2807 2005-10-04 Simon Josefsson <jas@extundo.com>
2809 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2810 D. Baushke" <mdb@gnu.org>.
2812 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2814 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2815 (SSIZE_MAX): New macro, if not already defined.
2816 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2819 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2821 * exclude.c: Include verify.h.
2822 (verify): Remove. All callers changed to use verify.h's version.
2823 * strtoimax.c: Likewise.
2824 * utimecmp.c: Likewis.e
2826 Sync from coreutils.
2827 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2828 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2829 * .cvsignore: Add fts.h, search.h, t-fpending.
2830 * settime.c (settime): Fix { typo in previous patch. Also, don't
2831 bother returning ENOSYS if settimeofday or stime fails; just let
2832 them return whatever errno they want to return.
2833 * utimens.c: Include unistd.h, for dup2.
2834 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2835 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2837 2005-10-02 Jim Meyering <jim@meyering.net>
2839 Sync from coreutils.
2840 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2841 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2842 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2843 Remove AT_FDCWD test.
2844 Do not consume the fd unless successful.
2845 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2846 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2847 block, so that we don't even try to compile it if settimeofday is
2848 available. This works around a compilation failure on OSF1 V5.1,
2849 due to stime requiring a `long int*' while tv_sec is `int'.
2851 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2853 * getdelim.c (getdelim): Remove unused variables.
2855 2005-10-01 Simon Josefsson <jas@extundo.com>
2857 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2858 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2859 AI_* and EAI_* definitions. Protect function declarations.
2861 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2863 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2864 so that the code works even with ancient cpp. Portability problem
2865 with GCC 2.7.2.1 reported by Thomas M.Ott.
2867 2005-09-27 Jim Meyering <jim@meyering.net>
2869 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2871 * intprops.h (signed_type_or_expr__): Define.
2872 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2875 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2877 * verify.h (verify_expr): Remove, replacing with:
2878 (verify_true): New macro that returns true instead of void.
2879 (verify_type__): Remove.
2880 (verify): Use verify_true rather than verify_type__.
2882 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2884 * utimens.c (ENOSYS): Define if not already defined.
2885 (futimens): Support having a null PATH if the file descriptor
2888 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2890 (__attribute): Define to empty unless GCC 3.1 or later.
2891 This works around a core dump on OpenBSD 3.4, which has GCC
2892 2.95.3, which dumps core when given __attribute__(()). It also
2893 simplifies other tests, since we really don't want to bother with
2894 worrying about which ancient version of GCC supported what.
2895 Original problem reported by Yoann Vandoorselaere, with part of
2896 the fix suggested by Derek Price.
2898 2005-09-24 Jim Meyering <jim@meyering.net>
2900 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2901 so we can once again use a positive bitfield width of 1 -- now we
2902 don't have to explain why we were using a bitfield width of 2.
2904 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2906 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2907 Problem reported by Eric Blake.
2908 (getaddrinfo): Initialize se so that it's not garbage.
2909 Redo internal storage allocation so that it doesn't make unportable
2910 assumptions about alignment.
2913 * utimens.c (futimens): Use futimesat if available.
2914 Prefer it to futimes since it doesn't have the futimes bug.
2916 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2917 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2918 Instead, declare a function that returns a pointer to an array,
2919 and use verify_type__ to declare the size of the array.
2920 Problem and germ of a solution reported by Bruno Haible.
2921 (verify_type__): Use 2, not 1, for bitfield size, to avoid
2922 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
2924 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
2926 Sync from coreutils.
2928 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2930 * argmatch.h: Include verify.h
2931 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2932 (ARGMATCH_ASSERT): Remove; unused.
2933 * canonicalize.c: Assume STDC_HEADERS.
2934 * exclude.c: Include "strcase.h".
2935 * regex_internal.h [!defined _LIBC]: Likewise.
2936 * getusershell.c: Include stdio--.h rather than stdio.h
2938 (getusershell): Call fopen, not fopen_safer.
2939 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2940 Do not include unistd-safer.h.
2941 (save_cwd): Don't call fd_safer; no longer needed
2942 now that we include fcntl--.h.
2944 * getdate.y (relative_time): New type.
2945 (RELATIVE_TIME_0): New constant.
2946 (parser_control): Use relative_time instead of doing it ourselves.
2947 (%union): Add new relative_time rel member.
2948 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2950 (relunit, relunit_snumber): Now of type rel.
2951 (zone, rel, relunit, get_date): Adjust to above changes.
2953 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2954 Do not include unistd-safer.h.
2955 (getloadavg): Don't call fd_safer; no longer needed
2956 now that we include fcntl--.h.
2958 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2959 (make_dir_parents): Treat ENOSYS like EEXIST.
2961 Improve quality of diagnostics on restore_cwd failure.
2962 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
2963 (make_dir_parents): Last arg is now int * (for errno), not bool *.
2964 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2965 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2966 each time through the loop. Do not diagnose restore_cwd failure;
2967 that is the caller's job (and perhaps the caller does not care).
2969 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2970 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2971 If the file already exists but is not a directory, don't bother
2972 to try to make its parents.
2973 Close potential file descriptor leak if we can't chdir("/") (!).
2974 Don't always return true if chdir($PWD) fails; return true only
2975 if the requested action was done successfully (except for the
2977 Don't log final directory unless we actually made it.
2978 Refactor to avoid duplicate code to fix up permissions.
2979 Don't attempt to fix up parent permissions if chdir($PWD) fails.
2981 * strftime.c (my_strftime): Rewrite the previous change slightly,
2982 to make it a bit faster and (I hope) clearer.
2983 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2984 Fix bug in formats like %2N.
2986 * verify.h: New file.
2988 2005-09-22 Jim Meyering <jim@meyering.net>
2990 Sync from coreutils.
2992 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2994 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2995 the .tm_year member, since otherwise gcc-4.0 would now warn about
2996 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2998 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2999 order to avoid an unsuppressible warning from gcc on 64-bit systems.
3001 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
3002 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
3003 when run in a time zone for which daylight savings time is in effect
3004 for the starting date.
3006 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
3007 stop us from restricting permissions of just-created absolute-named
3009 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
3010 to restore initial working directory.
3011 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
3012 to tell caller if/when we change the working directory and are
3013 unable to return to the initial one.
3014 * mkdir-p.h (make_dir_parents): Update prototype.
3015 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
3016 `return false'. This fixes a bug introduced on 2004-07-30.
3018 * openat.c (fdopendir): Be sure to close the supplied
3019 file descriptor before returning. This makes our replacement
3020 implementation a little closer to Solaris's, where fdopendir
3021 ties the file descriptor to the returned DIR* pointer.
3022 * openat.c (unlinkat): New function.
3023 * openat.h (unlinkat): Add prototype.
3024 * openat-die.c (openat_save_fail): Rename from openat_save_die.
3025 (openat_restore_fail): Rename from openat_restore_die.
3026 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
3028 Provide an alternative to exiting immediately upon save_cwd or
3029 restore_cwd failure. Now, an application can arrange e.g.,
3030 to perform a longjump in that case.
3031 * openat.c: Include dirname.h.
3032 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
3033 (rpl_openat, fdopendir, fstatat): Call openat_save_die
3034 and openat_restore_die rather than calling error directly.
3035 Don't include "error.h" or "exitfail.h"; they're no longer needed.
3037 * openat-die.c (openat_save_die, openat_restore_die): New file.
3038 * openat.h (openat_save_die, openat_restore_die): Declare and define.
3040 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
3041 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
3042 int utc, int nanoseconds);
3044 date should not have to allocate a megabyte of virtual memory to
3045 handle a format argument like +%1048575T. When implemented with
3046 strftime, it must allocate such a buffer, use strftime to fill it
3047 in, print it, then free it.
3048 With fprintftime, it simply prints everything and exits.
3049 With no need for memory allocation, that's one fewer way to fail.
3050 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
3051 optional field width, not before, so we accept %9:z, not %:9z.
3052 (my_strftime): Be sure to use L_('x') for literals.
3054 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
3055 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
3056 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
3057 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
3058 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
3059 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
3060 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
3061 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
3062 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
3064 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3065 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
3066 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3067 and don't include <sys/file.h>).
3069 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
3071 Sync from coreutils.
3073 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
3074 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3075 [!LDAV_DONE]: Avoid unused variable warning.
3077 2005-09-21 Bruno Haible <bruno@clisp.org>
3079 * unicodeio.h (unicode_to_mb): New declaration.
3081 2005-09-20 Derek Price <derek@ximbiot.com>
3083 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3085 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3087 Use a consistent style for including <config.h>.
3088 * __fpending.c, acl.c, argmatch.c,
3089 argp-help.c, argp-parse.c,
3090 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3091 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3092 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3093 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3094 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3095 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3096 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3097 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3098 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3099 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3100 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3101 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3102 modechange.c, mountlist.c, open-safer.c, physmem.c,
3103 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3104 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3105 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3106 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3107 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3108 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3109 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3110 userspec.c, utimecmp.c, version-etc-fsf.c,
3111 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3112 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3113 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3114 Standardize inclusion of config.h.
3115 * __fpending.h, dirfd.h, getdate.h, human.h,
3116 inttostr.h: Removed inclusion of config.h from header files.
3117 * inttostr.c: Adjusted in-tree users.
3118 * timespec.h: Remove superfluous warning to include config.h.
3119 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3120 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3121 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3122 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3124 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3126 * stat-time.h: New file.
3127 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3128 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
3130 (timespec_cmp): New function.
3131 * utimecmp.c: Include stat-time.h.
3132 (SYSCALL_RESOLUTION): Depend on whether various struct stat
3133 members exist, not on the obsolescent ST_MTIM_NSEC.
3134 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3136 2005-09-15 Derek Price <derek@ximbiot.com>
3137 Paul Eggert <eggert@cs.ucla.edu>
3139 * regcomp.c, regexec.c, regex_internal.c: Back out previous
3140 changes, consolidating in...
3141 * regex_internal.h: ...this file.
3143 2005-09-15 Derek Price <derek@ximbiot.com>
3145 * regex_internal.h: Blank `pure' for GNUC < 3.
3146 * regex_internal.c: Ditto, using this...
3147 (__GNUC_PREREQ): ...new macro.
3148 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3149 (__GNUC_PREREQ): ...this new macro.
3151 * strstr.h: Include string.h. Define strstr as a macro here.
3153 2005-09-13 Derek Price <derek@ximbiot.com>
3155 * canon-host.c (canon_host_r): Set *cherror on memory allocation
3157 Reported by Jim Meyering <jim@meyering.net>.
3159 2005-09-13 Jim Meyering <jim@meyering.net>
3161 * canon-host.c: Filter through gnu indent and reword comments slightly.
3162 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3164 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3167 (base64_encode): Put b64str in initialized data section.
3169 2005-09-12 Derek Price <derek@ximbiot.com>
3171 Return usable errors from canon-host.
3172 * canon-host.h: New file.
3173 * canon-host.c (canon_host): Wrap...
3174 (canon_host_r): ...this new function, which now relies exclusively on
3176 (ch_strerror): New function.
3177 (last_cherror): New global.
3178 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3179 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
3181 (freeaddrinfo): Free ai->ai_canonname when set.
3183 2005-09-12 Derek Price <derek@ximbiot.com>
3184 Paul Eggert <eggert@cs.ucla.edu>
3186 * glob-libc.h: Renamed from glob_.h. The new version is
3187 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3188 protecting things that should be done only in gnulib contexts.
3189 * glob_.h: New file, containing only the glob things needed for
3191 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
3192 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3193 (glob, globfree, glob_pattern_p): Now defined simply in terms of
3194 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3195 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3196 and to respect the namespace rules better.
3198 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
3200 Merge glibc and coreutils changes into gnulib, plus a few
3202 * md5.c: Use #error rather than a string.
3203 (CYCLIC): New macro, from glibc source. Use it instead of rol.
3204 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3205 (__attribute__): Define to empty for non recent-GCC.
3206 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3207 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3208 Renamed from their non-__ counterparts, with new macros replacing
3209 them if not _LIBC. Add __THROW attribute.
3211 (struct md5_ctx): Align buffer if using GCC.
3212 * sha1.h (struct sha1_ctx): Likewise.
3213 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
3214 The old name was backwards.
3215 (NOTSWAP): Remove; not used.
3216 (rol): New macro, moved here from md5.h.
3217 (sha1_process_block): Remove a FIXME that doesn't make sense.
3219 2005-09-12 Derek Price <derek@ximbiot.com>
3221 * gai_strerror.c: Include config.h when available. Include
3222 getaddrinfo.h before other headers to test interface.
3223 Reported by Larry Jones <lawrence.jones@ugs.com>.
3225 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3227 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3228 definitions, since that's the preferred style in glibc.
3229 Fix a minor spacing issue, and update copyright notice to match glibc's.
3231 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
3233 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3235 2005-09-06 Simon Josefsson <jas@extundo.com>
3237 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3238 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
3240 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
3242 Change bitset word type from unsigned int to unsigned long int,
3243 as this has better performance on typical 64-bit hosts.
3244 Port bitset code to hosts with unusual word sizes.
3245 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3246 (build_collating_symbol):
3247 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3248 argument is a bitset. This is merely a style issue, but it makes
3249 it clearer that an entire array is expected.
3250 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3251 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3252 Port to the case where bitset_word is not the same as unsigned int.
3253 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3254 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3256 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3257 (build_trtable, group_nodes_into_DFAstates):
3259 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3260 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3261 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3262 * regexec.c (group_nodes_into_DFAstates): Likewise.
3263 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3264 * regcomp.c (optimize_subexps, lower_subexp):
3265 Work even if bitset_word has holes in its bitwise representation.
3266 * regex_internal.h (BITSET_WORD_BITS): Likewise.
3267 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3269 * regex_internal.c (re_string_reconstruct):
3270 Don't assume UCHAR_MAX == 255.
3271 * regex_internal.h (bitset_set_all): Likewise.
3272 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3274 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
3275 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3277 (BITSET_WORD_MAX): New macro.
3278 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3279 (bitset_set_all, bitset_copy): Now inline functions, not macros.
3280 (bitset_empty, bitset_copy):
3281 Prefer sizeof (bitset) to multiplying it out ourselves.
3282 (bitset_not_merge): Remove; unused.
3283 (bitset_contain): Return bool, not unsigned int with one bit on.
3284 All callers changed.
3285 * regexec.c (build_trtable): Don't assume bitset has no stricter
3286 alignment than re_node_set; do this by defining a new internal
3287 type struct dests_alloc and using it to allocate memory.
3289 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
3291 Check for arithmetic overflow when calculating sizes, to prevent
3292 some buffer-overflow issues. These patches are conservative, in the
3293 sense that when I couldn't determine whether an overflow was possible,
3294 I inserted a run-time check.
3295 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3296 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3297 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3298 (re_xnrealloc, re_x2nrealloc): New inline functions.
3299 * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3300 (build_equiv_class, build_charclass): Check for arithmetic overflow
3301 in size expression calculations.
3302 * regex_internal.c (re_string_realloc_buffers):
3303 (build_wcs_upper_buffer, re_node_set_add_intersect):
3304 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3305 (re_dfa_add_node, register_state): Likewise.
3306 * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3307 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3308 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3309 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3311 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
3313 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3314 to avoid a collision with bits/local_lim.h in glibc.
3315 All uses changed. Problem reported by Dmitry V. Levin in
3316 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3318 * regex_internal.c (build_wcs_upper_buffer): Fix portability
3319 bugs in int versus size_t comparisons.
3320 (re_string_context_at): Fix bug where the code assumed that
3323 Use bool where appropriate.
3324 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3325 All callers changed.
3326 (calc_eclosure_iter): Likewise, for ROOT arg.
3327 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3328 (build_charclass_op): Likewise, for NON_MATCH arg.
3329 * regex_internal.c (re_string_allocate, re_string_construct):
3330 (re_string_construct_common): Likewise, for ICASE arg.
3331 * regexec.c (re_search_2_stub, re_search_stub):
3332 Likewise, for RET_LEN arg.
3333 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3334 (set_regs): Likewise, for FL_BACKTRACK arg.
3335 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3336 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3337 (calc_eclosure_iter, parse_bracket_exp):
3338 Use bool for internal variables that are booleans.
3339 * regexec.c (re_search_internal, check_matching, proceed_next_node):
3340 (set_regs, build_sifted_states, sift_states_bkref):
3341 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3342 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3343 (find_collation_sequence_value):
3345 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3346 (re_node_set_compare):
3347 Return bool, not int. All callers changed.
3348 * regexec.c (check_halt_node_context, check_dst_limits):
3349 (build_trtable, check_node_accept): Likewise.
3350 * regex_internal.h: Include stdbool.h.
3352 Fix bugs uncovered when converting to bool.
3353 * regcomp.c (calc_eclosure_iter): Check for storage allocation
3354 failure instead of charging ahead blindly.
3355 * regex_internal.c (register_state): Likewise.
3356 * regexec.c (re_search_2_stub): Use simpler method than boolean
3357 for freeing internal storage.
3358 (group_nodes_into_DFA_states): Use unsigned int, not int, for
3359 bitset pieces used as boolean, to avoid undefined behavior
3360 on hosts that do int overflow checking.
3362 2005-08-31 Derek Price <derek@ximbiot.com>
3364 * getdelim.c (getdelim): Return EOF on EOF.
3365 Reported by Larry Jones <lawrence.jones@ugs.com>.
3367 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3369 * regex_internal.c (re_string_reconstruct): Don't assume buffer
3370 lengths fit in regoff_t; this isn't true if regoff_t is the same
3372 * regex.c (re_search_internal): 5th arg is LAST_START
3373 (= START + RANGE) instead of RANGE. This avoids overflow
3374 problems when regoff_t is the same width as size_t.
3375 All callers changed.
3376 (re_search_2_stub): Check for overflow when adding the
3377 sizes of the two strings.
3378 (re_search_stub): Check for overflow when adding START
3379 to RANGE; if it occurs, substitute the extreme value.
3381 2005-08-31 Jim Meyering <jim@meyering.net>
3383 * regcomp.c (search_duplicated_node): Make first pointer arg
3385 * regex_internal.c (create_ci_newstate, create_cd_newstate):
3386 (register_state): Likewise.
3387 * regexec.c (search_cur_bkref_entry, check_dst_limits):
3388 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3389 (group_nodes_into_DFAstates): Likewise.
3391 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3393 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3394 old glibc regex code mishandles strings longer than 2**31 bytes.
3395 This patch fixes this when the regex code is used in gnulib
3396 (i.e., outside glibc).
3398 This patch should not affect the use of the regex code inside
3399 glibc. No doubt this problem also needs to be handled for glibc
3400 as well, but the result will be an incompatible change to the
3401 glibc ABI, and the old ABI will have to be supported too. That
3402 can be the the subject for another patch.
3404 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3405 governing whether the rest of this patch is active. By default,
3406 the macro is disabled and the patch has no effect.
3407 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3408 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3409 (struct re_pattern_buffer, re_search, re_search_2, re_match):
3410 (re_match_2, re_set_registers): Use the new types.
3411 * regex_internal.h (Idx, re_hashval_t): New types.
3412 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3414 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3415 (re_string_context_at, bin_tree_t, re_dfastate_t):
3416 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3417 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3418 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3419 (re_string_char_size_at, re_string_wchar_at):
3420 (re_string_elem_size_at):
3421 Use the new types and macros to port to 64-bit hosts.
3422 Use unsigned types for internal values, so that the code
3423 mostly works even for arrays larger than SSIZE_MAX.
3424 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3425 (search_duplicated_node, calc_eclosure_iter, fetch_number):
3426 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3427 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3428 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3429 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3430 (calc_inveclosure, parse_dup_op, build_range_exp):
3431 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3432 (fetch_number, create_token_tree, mark_opt_subexp):
3434 * regex_internal.c (re_string_construct_common, create_ci_newstate):
3435 (create_cd_newstate, re_string_allocate, re_string_construct):
3436 (re_string_realloc_buffers, build_wcs_upper_buffer):
3437 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3438 (re_string_reconstruct, re_string_peek_byte_case):
3439 (re_string_fetch_byte_case, re_string_context_at):
3440 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3441 (re_node_set_init_copy, re_node_set_add_intersect):
3442 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3443 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3444 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3445 (re_acquire_state, re_acquire_state_context, register_state):
3447 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3448 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3449 (re_search_internal, re_search_2_stub, re_search_stub)
3450 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3451 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3452 (update_cur_sifted_state, check_dst_limits):
3453 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3454 (check_subexp_limits, sift_states_bkref, merge_state_array):
3455 (check_subexp_matching_top, get_subexp, get_subexp_sub):
3456 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3457 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3458 (expand_bkref_cache, check_node_accept_bytes):
3459 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3460 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3461 (acquire_init_state_context, check_halt_node_context):
3462 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3463 (sift_states_backward, clean_state_log_if_needed):
3464 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3465 (find_recover_state, transit_state_sb, transit_state_mb):
3466 (transit_state_bkref, build_trtable, match_ctx_clean):
3468 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3469 to work around an assumption that REG_MISSING is negative.
3471 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3472 (seek_collating_symbol_entry) [defined _LIBC]:
3473 (lookup_collation_sequence_value) [defined _LIBC]:
3474 (build_range_exp, build_collating_symbol) [defined _LIBC]:
3475 Use prototypes rather than old-style function definitions.
3476 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3477 (transit_state_sb) [0]:
3478 (find_collation_sequence_value) [defined _LIBC]: Likewise.
3480 * regexec.c (re_search_internal): Simplify update of rm_so and
3483 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3484 (optimize_subexps, lower_subexp):
3485 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3486 since the signed shift might overflow. Use 1u<<31 instead.
3487 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3488 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3491 * regcomp.c (optimize_subexps, lower_subexp):
3492 Use CHAR_BIT rather than 8, for clarity.
3493 * regexec.c (check_dst_limits_calc_pos_1):
3494 (check_subexp_matching_top): Likewise.
3495 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3496 have to worry about portability issues when shifting it left.
3497 Remove no-longer-needed test for table_size > 0.
3498 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3499 in a word, as the resulting behavior is undefined.
3500 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3501 in one case, a <= should have been an <, and in another case the
3502 whole test was missing.
3503 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
3504 the standard name CHAR_BIT.
3505 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3506 this is not true on one's complement and signed-magnitude hosts.
3508 * regex_internal.h (re_sub_match_top_t): Remove unused member
3510 (struct re_dfa_t): Remove unused member states_alloc.
3511 * regcomp.c (init_dfa): Don't initialize unused members.
3513 2005-08-31 Bruno Haible <bruno@clisp.org>
3515 * strstr.c: Include <stddef.h>, for NULL.
3516 * strcasestr.c: Likewise.
3517 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3519 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3521 * iconvme.h: Add prototype for iconv_alloc.
3523 2005-08-29 Simon Josefsson <jas@extundo.com>
3525 * iconvme.c: Fix errno.
3527 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3529 * iconvme.c: Split iconv_string into iconv_alloc.
3531 2005-08-27 Jim Meyering <jim@meyering.net>
3533 * fopen-safer.c: Merge minor changes from coreutils.
3534 * dup-safer.c: Likewise.
3535 * fd-safer.c: Likewise.
3537 Merge from coreutils.
3538 * stdio--.h: New file.
3539 * stdlib--.h: New file.
3540 * mkstemp-safer.c: New file.
3542 GNU tar needs these.
3543 * pipe-safer.c: New file.
3544 * creat-safer.c: New file.
3545 * fcntl--.h (creat): Define to creat_safer.
3546 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3547 * unistd--.h (pipe): Define to pipe_safer.
3548 * unistd-safer.h: Declare pipe_safer.
3550 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3552 * regex_internal.h: Remove all references to
3553 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3555 (bitset_not, bitset_merge, bitset_not_merge):
3556 (bitset_mask, re_string_allocate, re_string_construct):
3557 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3558 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3559 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3560 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3561 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3562 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3563 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3564 (re_acquire_state_context):
3565 Remove unnecessary forward decls.
3566 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3567 Put __attribute at function definition,
3568 now that the function decl has been removed.
3569 * regex_internal.c (re_string_peek_byte_case):
3570 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3573 2005-08-26 Simon Josefsson <jas@extundo.com>
3575 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3576 Haible <bruno@clisp.org>.
3578 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3580 * regexec.c (set_regs): Don't alloca with an unbounded size.
3582 alloca modernization/simplification for regex.
3583 * regex.c: Remove portability cruft for alloca. This no longer
3584 needs to be at the start of the file, and can be moved into
3585 regex_internal.h and simplified.
3586 * regex_internal.h: Include <alloca.h>.
3587 (__libc_use_alloca) [!defined _LIBC]: New macro.
3588 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3589 now works outside glibc.
3591 2005-08-24 Simon Josefsson <jas@extundo.com>
3593 * getpass.c: Add WIN32 implementation. Conditionalize use of
3594 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3595 GLIBC specific code.
3597 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3599 Make regex safe for g++. This fixes one real bug (an "err"
3600 that should have been "*err"). g++ problem reported by
3602 * regex_internal.h (re_calloc): New macro, consistent with
3603 re_malloc etc. All callers of calloc changed to use re_calloc.
3604 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3605 not int. All callers changed.
3606 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3607 just use an array of size MB_LEN_MAX.
3608 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3609 (find_recover_state): Change "err" to "*err"; this fixes what
3610 appears to be a real bug.
3611 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3614 2005-08-25 Jim Meyering <jim@meyering.net>
3616 * open-safer.c: Include <config.h>.
3617 Otherwise, we'd lose LARGEFILE support in any file using
3620 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3622 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3623 * regex.h (regerror): Likewise.
3625 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3626 requires this. (The code never needed it.)
3628 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3629 All uses of recently-renamed identifiers changed to use the new,
3630 POSIX-compliant names. The code will build and run just fine
3631 without these changes, but it's better to eat our own dog food
3632 and use the standard-conforming names.
3634 * regex.h: Fix a multitude of POSIX name space violations.
3635 These changes have an effect only for programs that define
3636 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3637 do not change anything for programs compiled in the normal way.
3638 Also, there is no effect on the ABI.
3640 (_REGEX_SOURCE): New macro.
3641 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3642 defined and _GNU_SOURCE is not; this fixes a name space violation.
3644 Rename the following macros to obey POSIX requirements.
3645 The old names are still visible as macros if _REGEX_SOURCE is defined.
3646 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3647 RE_BACKSLASH_ESCAPE_IN_LISTS.
3648 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3649 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3650 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3651 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3652 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3653 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3654 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3655 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3656 (REG_INTERVALS): renamed from RE_INTERVALS.
3657 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3658 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3659 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3660 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3661 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3662 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3663 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3664 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3665 RE_UNMATCHED_RIGHT_PAREN_ORD.
3666 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3667 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3668 (REG_DEBUG): renamed from RE_DEBUG.
3669 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3670 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3671 unusual, since we can't clash with the POSIX REG_ICASE.
3672 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3673 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3674 (REG_NO_SUB): renamed from RE_NO_SUB.
3675 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3676 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3677 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3678 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3679 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3680 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3681 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3682 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3683 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3684 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3685 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3686 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3687 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3688 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3689 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3690 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3691 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3692 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3693 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3694 (REG_FIXED): Renamed from REGS_FIXED.
3695 (REG_NREGS): Renamed from RE_NREGS.
3697 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3698 of other REG_* macros, since POSIX says the user is allowed to
3699 #undef these macros selectively.
3701 (reg_errcode_t): Update comment stating what other tables need
3704 Rename the following enum values to obey POSIX requirements.
3705 The old names are still visible as macros.
3706 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3707 is not defined, since GNU is supposed to be a superset of POSIX as
3708 much as possible, and since we want reg_errcode_t to be a signed
3709 type for implementation consistency.
3710 (_REG_NOERROR): Renamed from REG_NOERROR.
3711 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3712 (_REG_BADPAT): Renamed from REG_BADPAT.
3713 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3714 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3715 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3716 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3717 (_REG_EBRACK): Renamed from REG_EBRACK.
3718 (_REG_EPAREN): Renamed from REG_EPAREN.
3719 (_REG_EBRACE): Renamed from REG_EBRACE.
3720 (_REG_BADBR): Renamed from REG_BADBR.
3721 (_REG_ERANGE): Renamed from REG_ERANGE.
3722 (_REG_ESPACE): Renamed from REG_ESPACE.
3723 (_REG_BADRPT): Renamed from REG_BADRPT.
3724 (_REG_EEND): Renamed from REG_EEND.
3725 (_REG_ESIZE): Renamed from REG_ESIZE.
3726 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3727 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3728 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3729 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3730 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3732 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3733 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3734 changed. But support the old name if the new one is not defined
3735 and if _REGEX_SOURCE.
3737 Change the following member names in struct re_pattern_buffer.
3738 The old names are still supported if !_REGEX_SOURCE.
3739 The new names are always supported, regardless of _REGEX_SOURCE.
3740 (re_buffer): Renamed from buffer.
3741 (re_allocated): Renamed from allocated.
3742 (re_used): Renamed from used.
3743 (re_syntax): Renamed from syntax.
3744 (re_fastmap): Renamed from fastmap.
3745 (re_translate): Renamed from translate.
3746 (re_can_be_null): Renamed from can_be_null.
3747 (re_regs_allocated): Renamed from regs_allocated.
3748 (re_fastmap_accurate): Renamed from fastmap_accurate.
3749 (re_no_sub): Renamed from no_sub.
3750 (re_not_bol): Renamed from not_bol.
3751 (re_not_eol): Renamed from not_eol.
3752 (re_newline_anchor): Renamed from newline_anchor.
3754 Change the following member names in struct re_registers.
3755 The old names are still supported if !_REGEX_SOURCE.
3756 The new names are always supported, regardless of _REGEX_SOURCE.
3757 (rm_num_regs): Renamed from num_regs.
3758 (rm_start): Renamed from start.
3759 (rm_end): Renamed from end.
3761 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3762 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3763 Prepend __ to parameter names.
3765 Undo yesterday's changes.
3767 2005-08-24 Jim Meyering <jim@meyering.net>
3769 Sync from coreutils.
3770 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3772 2005-08-21 Bruno Haible <bruno@clisp.org>
3774 * lock.h: Add multiple inclusion guard.
3775 * tls.h: Add multiple inclusion guard.
3777 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3779 * regex.h (REG_NOSYS)
3780 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3781 Define, since POSIX requires it as of 2001.
3782 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3783 New private symbol, used to keep the enum signed in all cases.
3784 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3785 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3787 * regex_internal.c (re_string_skip_chars, register_state):
3789 Remove forward decls; no longer needed now that we use prototypes.
3790 * regexec.c (acquire_init_state_context, check_halt_node_context):
3791 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3792 (clean_state_log_if_needed): Likewise.
3794 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3796 Fix problems reported by Sam Steingold in
3797 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3798 * regexec.c (sift_states_bkref): Fix portability bug: the code
3799 assumed that reg_errcode_t is a signed type, which is not
3800 necessarily true if _XOPEN_SOURCE is not defined.
3801 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3802 some compilers warn about it otherwise.
3804 2005-08-20 Jim Meyering <jim@meyering.net>
3806 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3807 of unused local, dfa.
3809 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3811 * regcomp.c (create_initial_state): Remove duplicate decl.
3812 (init_word_char, create_initial_state, duplicate_node_closure):
3813 (fetch_token, peek_token_bracket, build_range_exp):
3814 (build_collating_symbol): Remove forward decls; no longer needed
3815 now that we use prototypes.
3818 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3819 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3820 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3821 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3822 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3823 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3824 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3825 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3826 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3827 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3828 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3829 (build_charclass, build_charclass_op, fetch_number, create_tree):
3830 (create_token_tree, mark_opt_subexp, duplicate_tree):
3831 Use prototypes rather than old-style definitions.
3834 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3835 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3836 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3837 (re_string_reconstruct, re_string_peek_byte_case):
3838 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3839 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3840 (re_node_set_init_copy, re_node_set_add_intersect):
3841 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3842 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3843 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3844 (re_acquire_state, re_acquire_state_context, register_state):
3845 (create_ci_newstate, create_cd_newstate, free_state):
3847 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3848 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3849 (re_search_internal, prune_impossible_nodes):
3850 (acquire_init_state_context, check_matching, static):
3851 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3852 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3853 (update_regs, sift_states_backward, build_sifted_states):
3854 (clean_state_log_if_needed, merge_state_array):
3855 (update_cur_sifted_state, add_epsilon_src_nodes):
3856 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3857 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3858 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3859 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3860 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3861 (check_arrival, check_arrival_add_next_nodes):
3862 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3863 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3864 (check_node_accept_bytes, check_node_accept, extend_buffers):
3865 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3866 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3871 (re_string_allocate, re_string_construct, re_string_reconstruct):
3872 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3873 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3874 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3875 (re_string_context_at, re_string_peek_byte_case):
3876 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3877 is defined, since we now use prototypes always.
3879 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3880 C89 or better. All uses removed.
3882 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3884 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3885 [defined lint]: Suppress bogus uninitialized-variable warnings.
3887 * regcomp.c (duplicate_node): Return new index, not an error code,
3888 and let the caller return REG_ESPACE if out of space. This
3889 removes an uninitialied-variable warning with GCC 4.0.1, and also
3890 avoids taking the address of a local variable. All callers
3893 2005-08-19 Jim Meyering <jim@meyering.net>
3895 * regexec.c (proceed_next_node): Redo local variables to
3896 avoid GCC shadowing warnings.
3898 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3900 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3901 (re_node_set_insert_last, re_dfa_add_node):
3902 Rename local variables to avoid GCC shadowing warnings.
3904 2005-08-18 Bruno Haible <bruno@clisp.org>
3906 * strstr.c (strstr): Fix return value in multibyte case.
3907 * strcasestr.c (strcasestr): Likewise.
3909 2005-08-17 Jim Meyering <jim@meyering.net>
3911 Make the %s format (seconds since the epoch) work for a negative
3912 number and when used with a zero-padded field width, e.g. %015s.
3914 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3915 label so that it precedes the code to set `digits'. Otherwise,
3916 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
3917 print `00-22'. Now, it prints `-0022', as it should.
3919 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
3921 * regex.h: Remove useless space-before-tab. From coreutils.
3923 2005-08-17 Bruno Haible <bruno@clisp.org>
3925 * strcasestr.h: New file.
3926 * strcasestr.c: New file.
3928 2005-08-17 Bruno Haible <bruno@clisp.org>
3930 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3931 * strstr.c: Completely rewritten, with multibyte locale support.
3933 2005-08-17 Bruno Haible <bruno@clisp.org>
3935 * strcasecmp.c: Use mbuiter.h.
3937 2005-08-17 Bruno Haible <bruno@clisp.org>
3939 * mbuiter.h: New file.
3941 2005-08-16 Bruno Haible <bruno@clisp.org>
3943 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3945 (mbi_avail, mbi_advance): Let the iteration end before the terminating
3946 NUL byte, not after it.
3948 2005-08-16 Bruno Haible <bruno@clisp.org>
3950 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3951 the valid ones. Makes the comparison operations transitive:
3952 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3953 * strcasecmp.c (strcasecmp): Use mb_casecmp.
3955 2005-08-16 Bruno Haible <bruno@clisp.org>
3957 * strcase.h (strcasecmp): Add note in comments.
3958 * strncasecmp.c: Use code from strcasecmp.c.
3959 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3960 (strcasecmp): Work correctly in multibyte locales.
3962 2005-08-16 Bruno Haible <bruno@clisp.org>
3964 * strnlen1.h: New file.
3965 * strnlen1.c: New file.
3967 2005-08-16 Bruno Haible <bruno@clisp.org>
3969 * mbfile.h: New file.
3971 2005-08-16 Bruno Haible <bruno@clisp.org>
3973 * mbiter.h: New file.
3975 2005-08-16 Bruno Haible <bruno@clisp.org>
3977 * mbchar.h: New file.
3978 * mbchar.c: New file.
3980 2005-08-16 Bruno Haible <bruno@clisp.org>
3982 * tls.h: New file, from GNU gettext.
3983 * tls.c: New file, from GNU gettext.
3985 2005-08-15 Bruno Haible <bruno@clisp.org>
3987 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3990 2005-08-14 Jim Meyering <jim@meyering.net>
3992 Sync from coreutils.
3994 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3995 Use the hash-table-based cycle-detection code not just when
3996 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3997 Reported by James Youngman in
3998 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3999 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
4000 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
4001 This lets us compile with -DFTS_DEBUG, once again.
4002 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
4003 * fts.c (fd_safer): Remove decl.
4004 Include fcntl--.h rather than unistd-safer.h
4005 (fts_safe_changedir): Don't call fd_safer; no longer needed
4006 now that we include fcntl--.h.
4008 2005-08-11 Simon Josefsson <jas@extundo.com>
4010 * readline.h, readline.c: New file.
4012 2005-08-11 Bruno Haible <bruno@clisp.org>
4014 * strnlen.h (strnlen): Change parameter name to match comment.
4016 2005-08-10 Simon Josefsson <jas@extundo.com>
4018 * strndup.c: Use strnlen.h.
4020 * strnlen.h: New file.
4022 2005-08-02 Simon Josefsson <jas@extundo.com>
4024 * getline.h, getline.c: Rewrite.
4026 * getdelim.h, getdelim.c: New files, ported from glibc.
4028 2005-07-31 Bruno Haible <bruno@clisp.org>
4030 * lock.h (gl_lock_initializer): New macro.
4031 (gl_lock_define_initialized): Use it.
4032 (gl_rwlock_initializer): New macro.
4033 (gl_rwlock_define_initialized): Use it.
4034 (gl_recursive_lock_initializer): New macro.
4035 (gl_recursive_lock_define_initialized): Use it.
4037 2005-07-26 Bruno Haible <bruno@clisp.org>
4039 * lock.h: Update from GNU gettext.
4040 * lock.c: Update from GNU gettext.
4042 2005-07-18 Bruno Haible <bruno@clisp.org>
4044 * lock.h (gl_once_t): New type.
4045 (gl_once_define, gl_once): New macros.
4046 * lock.c (fresh_once): New variable.
4047 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
4050 2005-07-18 Simon Josefsson <jas@extundo.com>
4052 * check-version.c (check_version): Accept identical versions too.
4054 2005-07-18 Bruno Haible <bruno@clisp.org>
4056 * lock.h: New file, from GNU gettext.
4057 * lock.c: New file, from GNU gettext.
4059 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
4061 * quotearg.c: Add translator comment suggested by Bruno Haible,
4062 with a minor change.
4064 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4066 * version-etc-fsf.c (version_etc_copyright): Parameterize the
4067 copyright symbol and the year.
4068 * version-etc.c (COPYRIGHT_YEAR): New constant.
4069 (version_etc_va): Use parameterized copyright notice.
4070 Reword to conform to the current GNU coding standards.
4072 2005-07-11 Simon Josefsson <jas@extundo.com>
4074 * size_max.h: New file.
4076 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
4078 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4081 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
4082 and Paul Eggert <eggert@cs.ucla.edu>
4084 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4085 in wint_t, not wchar_t. Remove now-unnecessary cast.
4087 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4089 * regex.c, regex.h: Sync from libc.
4090 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4091 New files, synced from libc, except that regex_internal.h
4092 currently has a small porting fix.
4094 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
4096 Remove the dependency of the strftime module on the tzset module.
4097 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4098 Copy the input structure, to work around some of the bug with
4099 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
4100 Solaris releases, you should also use the tzset module, but we won't
4101 require it as a dependency any more since we don't want LGPLed code
4102 to depend on GPLed code.
4104 2005-07-02 Jim Meyering <jim@meyering.net>
4106 * backupfile.c (backup_args): Change a `0' to NULL.
4108 2005-07-01 Jim Meyering <jim@meyering.net>
4110 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4111 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4112 * save-cwd.c, tempname.c:
4113 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4114 and don't include <sys/file.h>).
4116 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
4118 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4119 declares only 'struct timespec;' (!).
4121 2005-06-29 Jim Meyering <jim@meyering.net>
4123 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4124 type name. Use the variable name instead.
4125 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4127 2005-06-28 Simon Josefsson <jas@extundo.com>
4129 * check-version.h, check-version.c: New files.
4131 2005-06-28 Simon Josefsson <jas@extundo.com>
4133 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
4134 collision with global variable. Better indentation. Don't
4135 increment buffer pointer beyond buffer end. Based on comments
4136 from Paul Eggert <eggert@cs.ucla.edu>.
4140 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
4142 * canon-host.c (canon-host): Append trailing "," to 0 in
4143 initializer of struct addrinfo, as an indication that we don't
4144 care how many members the structure has.
4146 2005-06-24 Derek Price <derek@ximbiot.com>
4147 and Bruno Haible <bruno@clisp.org>
4149 Remove stat module & update lstat.
4150 * stat.c: Remove this file...
4151 (slash_aware_lstat): ...moving this content and its support...
4152 * lstat.c (rpl_lstat): ...into here.
4153 * lstat.h: New file.
4155 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
4157 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
4158 (ranged_convert): Don't save conversion in a temporary struct.
4159 This causes a warning with GCC 4.0.0, and anyway in the typical
4160 case it's not worth the extra 100 bytes or so of code.
4161 (ranged_convert, __mktime_internal): When calling a function via a
4162 pointer P, use P () rather than (*P) (), as we now assume C89 or
4165 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
4167 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4168 "who -r" failed to give output. Problem reported by Tim Waugh.
4170 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4171 (xcalloc): Use it to avoid needless tests.
4172 Problem reported by Jim Meyering.
4174 2005-06-16 Jim Meyering <jim@meyering.net>
4176 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4177 when either N or S is zero.
4179 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4181 * argp.h (__option_is_short): Check upper limit of
4182 __key. Isprint() requires its argument to have the value
4183 of an unsigned char or EOF.
4185 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
4187 * fnmatch.c (fnmatch): If there is an encoding error in a
4188 multibyte string or pattern, fall back on unibyte matching.
4189 Problem reported by James Youngman.
4191 2005-06-08 Bruno Haible <bruno@clisp.org>
4193 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4196 2005-06-08 Bruno Haible <bruno@clisp.org>
4198 * csharpcomp.h: New file, from GNU gettext.
4199 * csharpcomp.c: New file, from GNU gettext.
4200 * csharpcomp.sh.in: New file, from GNU gettext.
4202 2005-06-07 Derek Price <derek@ximbiot.com>
4205 * glob_.h: Indent nested #ifdef.
4207 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
4209 Sync from coreutils.
4210 Use "file name" when talking about file names, instead of "filename"
4211 or "path", as per the GNU coding standards.
4212 * mkdir-p.c: Renamed from makepath.c.
4213 (make_dir_parents): Renamed from make_path. All callers changed.
4214 * mkdir-p.h: Likewise. All includers changed.
4215 * filenamecat.c: Renamed from path-concat.c.
4216 (file_name_concat): Renamed from path_concat. All callers changed.
4217 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4218 * filenamecat.h: Likewise. All includers changed.
4219 * acl.c: Don't use "path" or "filename" to mean "file name"
4220 in comments or local variable names.
4221 * basename.c: Likewise.
4222 * canonicalize.c, canonicalize.h: Likewise.
4223 * dirname.c, dirname.h: Likewise.
4224 * euidaccess.c: Likewise.
4225 * exclude.c: Likewise
4226 * fnmatch_.h, fnmatch_loop.c: Likewise.
4227 * fsusage.c, fsuage.h: Likewise.
4228 * fts.c, fts_.h: Likewise.
4229 * getcwd.c: Likewise.
4230 * getloadavg.c: Likewise.
4231 * mkstemp.c: Likewise.
4232 * mountlist.c, mountlist.h: Likewise.
4233 * openat.c, openat.h: Likewise.
4234 * readlink-stub.c: Likewise.
4235 * readutmp.c, readutmp.h: Likewise.
4236 * rename.c: Likewise.
4237 * rmdir.c: Likewise.
4239 * savedir.c: Likewise.
4240 * stripslash.c: Likewise.
4241 * tempname.c: Likewise.
4242 * xreadlink.c: Likewise.
4243 * exclude.c (excluded_file_name): Renamed from excluded_filename.
4245 * exclude.h: Likewise.
4247 * euidaccess.c (getuid, getgid, getuid, getegid)
4248 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4249 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4250 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4251 * pathmax.h: Include <limits.h> unconditionally, since other
4252 files have been getting away with it for years (MORE/BSD 4.3
4254 * userspec.c (getpwnam, getgrnam, getgrgid)
4255 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4257 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4258 Define to 256, not 255, as per modern POSIX.
4260 2005-06-01 Bruno Haible <bruno@clisp.org>
4262 * csharpexec.h: New file, from GNU gettext.
4263 * csharpexec.c: New file, from GNU gettext.
4264 * csharpexec.sh.in: New file, from GNU gettext.
4266 2005-05-31 Derek Price <derek@ximbiot.com>
4267 Paul Eggert <eggert@cs.ucla.edu>
4270 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4272 2005-05-29 Derek Price <derek@ximbiot.com>
4273 Paul Eggert <eggert@cs.ucla.edu>
4275 * glob_.h, glob.c: New files.
4277 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4279 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4281 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4282 the configuration hassle isn't worth it.
4283 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4284 (LONGEST_MODIFIER, PRIuMAX): Remove.
4286 2005-05-27 Bruno Haible <bruno@clisp.org>
4288 * getlogin_r.h: Remove second include of <stddef.h>.
4290 2005-05-25 Bruno Haible <bruno@clisp.org>
4291 Derek Price <derek@ximbiot.com>
4293 * getlogin_r.h: Simplify API documentation.
4295 2005-05-25 Derek Price <derek@ximbiot.com>
4296 Paul Eggert <eggert@cs.ucla.edu>
4298 * getlogin_r.c, getlogin_r.h: New files.
4300 2005-05-22 Bruno Haible <bruno@clisp.org>
4302 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4303 Also include <sys/param.h> if it defines MIN, MAX.
4304 Based on a patch by Derek Price <derek@ximbiot.com>.
4306 2005-05-22 Bruno Haible <bruno@clisp.org>
4308 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4309 (INT64_MIN): Fix definition.
4310 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4312 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4313 NEED_SIGNED_INT_TYPES.
4315 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4316 HAVE_SYSTEM_INTTYPES.
4318 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4320 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4321 so that unistd-safer.h (GPL'ed code) need not be included.
4323 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
4326 * fts.c: Don't include "cycle-check.h" or "hash.h".
4327 (setup_dir, free_dir): New functions.
4328 (enter_dir, leave_dir): Define trivial
4329 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
4330 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
4331 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4332 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4333 Move to fts-cycle.c.
4334 (fts_open): Use setup_dir.
4335 (fts_close): Use free_dir.
4336 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4337 This adds a label and some gotos, but the alternatives were messier.
4338 Check for memory allocation failure when entering a dir.
4339 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4340 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4341 (FTS): New member fts_cycle, that is a union that contains the
4342 old active_dir_ht and cycle_state. All uses changed to mention
4343 fts_cycle.ht and fts_cycle.state.
4344 * fts-cycle.c: New file, containing GPL'ed code migrated out of
4345 fts.c, with the following changes:
4346 (setup_dir, free_dir): New functions.
4347 (enter_dir): Now returns bool. Return true if successful, false
4348 if memory exhausted. All callers changed.
4349 Do not bother partly cleaning up on
4350 memory allocation failure; that is free_dir's job.
4351 However, free ad if hash_insert fails, to avoid memory leak.
4352 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4353 fts->fts_options to see which union member to use.
4355 2005-05-20 Jim Meyering <jim@meyering.net>
4357 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4358 Now a macro, to pacify GCC.
4360 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
4362 * chown.c (rpl_chown): Return -1 on failure.
4364 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
4366 * canonicalize.c: Include canonicalize.h first, to test interface.
4367 Include <stddef.h> unconditionally, since we assume C89 now.
4368 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4369 * fts.c: Include fts_.h first, to check interface.
4370 Do not include intprops.h; no longer needed.
4371 Include cycle-check.h and hash.h, since fts_.h no longer does.
4372 Remove unnecessary casts of closedir to void.
4373 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4374 decide whether to decrement nlinks.
4375 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4376 (FTS): Use struct hash_table * instead of Hash_table, so that
4377 we no longer need to include hash.h here.
4379 2005-05-17 Jim Meyering <jim@meyering.net>
4381 * fts.c, fts_.h: New files, from coreutils.
4383 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
4385 Sync from coreutils.
4386 * unlinkdir.c, unlinkdir.h: New files.
4387 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4388 regex.h, unlocked-io.h, xtime.h:
4389 White space changes only.
4390 * makepath.c (make_path): Port to hosts where leading "//" is special.
4391 * yesno.c: Include getline.h, not ctype.h.
4392 (yesno): Don't remove leading white space; POSIX doesn't allow it.
4393 Use getline to remove arbitrary restriction on response length.
4395 2005-05-13 Bruno Haible <bruno@clisp.org>
4397 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4398 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4399 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4400 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4401 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4402 Add support for 64-bit integers in the MSVC compiler.
4404 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4406 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4407 Change the initial comment to refer to GPL, not LGPL.
4408 gnulib-tool will change it to LGPL as needed.
4410 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4411 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4412 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4413 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4414 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4415 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4416 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4417 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4418 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4419 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4420 concatpath.c, config.charset, copy-file.c, copy-file.h,
4421 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4422 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4423 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4424 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4425 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4426 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4427 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4428 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4429 full-read.c, full-read.h, full-write.c, full-write.h,
4430 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4431 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4432 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4433 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4434 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4435 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4436 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4437 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4438 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4439 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4440 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4441 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4442 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4443 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4444 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4445 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4446 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4447 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4448 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4449 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4450 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4451 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4452 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4453 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4454 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4455 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4456 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4457 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4458 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4459 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4460 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4461 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4462 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4463 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4464 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4465 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4466 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4467 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4468 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4469 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4470 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4471 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4472 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4473 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4474 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4475 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4476 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4477 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4478 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4479 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4480 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4481 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4482 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4483 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4484 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4485 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4486 Update FSF postal mail address.
4488 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4490 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4491 specified in ai_socktype. Fix invalid ai_protocol
4492 check. ai_protocol is usually set to 0 or depending on
4493 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
4494 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
4495 ai_socktype / ai_protocol in the returned addrinfo structure.
4497 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4498 Bruno Haible <bruno@clisp.org>
4500 * inet_ntop.h: New file.
4501 * inet_ntop.c: New file, from glibc with modifications.
4503 2005-05-08 Jim Meyering <jim@meyering.net>
4505 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4507 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4509 Merge from coreutils. Among other things,
4510 add bulletproofing for cases where stdin, stdout, or stderr are closed.
4511 * fd-safer.c: New file.
4512 * fcntl-safer.h, open-safer.c: Remove.
4513 * chdir-long.c: Fix comment "fetish" -> "coreutils".
4514 * dup-safer.c: Include unistd-safer.h first.
4515 Don't include errno.h.
4516 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4517 * file-type.h: Don't assume invoker included sys/stat.h first.
4518 * file-type.c: Rely on file-type.h change.
4519 * getloadavg.c: Include unistd-safer.h.
4520 (getloadavg): Use safer open.
4521 * getusershell.c: Include "stdio-safer.h".
4522 (getusershell): Use safer fopen.
4523 * long-options.c (long_options): Use NULL rather than 0.
4524 * modechange.h (mode_free): Remove; all callers changed to invoke
4526 * modechange.c: Likewise.
4527 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4528 (MODE_DONE): New constant.
4529 (struct mode_change): Remove 'next' member.
4530 (make_node_op_equals): New function; like the old one of the
4531 same name, except it allocates an array.
4532 (mode_compile, mode_create_from_ref): Use it.
4533 (mode_compile): Allocate result as an array, not a linked list.
4534 Parse octal string ourself, so that we catch mistakes like "+0".
4535 (mode_adjust): Arg is an array, not a linked list.
4536 * modechange.c: Include stat-macros.h, xalloc.h.
4537 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4538 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4539 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4540 Remove. This is now stat-macros.h's job.
4541 (talloc): Remove. All callers replaced by xalloc, so that
4542 our invokers don't have to worry about reporting memory failures.
4543 (make_node_op_equals): Remove.
4544 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4546 (struct mode_change): Moved here from modechange.h.
4547 (mode_append_entry): Remove.
4548 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4549 apps to have incorrect behavior. Use simpler algorithm for head
4550 and tail. Don't futz with umask; that's now the job of mode_adjust.
4551 Detect more invalid usages rather than having somewhat-random behavior.
4552 Don't insert an "a=" action, as that leads to incorrect behavior.
4553 (mode_compile, mode_create_from_ref): Return NULL on error instead
4554 of an enum, since now there's only one way to have an error. All
4556 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4557 at the correct time. Simplify calculation of "+u" and its ilk.
4558 Don't mishandle "+X".
4559 (mode_free): Remove "register" and localize decls.
4560 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4561 (struct mode_change): Move to modechange.c; callers don't
4562 need to see this stuff.
4563 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4564 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4565 (mode_change, mode_adjust): Reflect the new signatures noted above.
4566 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4567 that might redefine system include files.
4568 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4569 (my_usleep): Use NULL rather than (void *) 0.
4570 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4571 Use siginterrupt to specify that system calls should be interrupted.
4572 (rpl_nanosleep): Move initialization of suspended closer to call of
4574 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4575 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4576 (desirable_utmp_entry): New function.
4577 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4578 using x2nrealloc, to simplify logic.
4579 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4580 size calculation. Do not assume utmp file is a regular file.
4581 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4582 (READ_UTMP_CHECK_PIDS): New constant.
4583 * save-cwd.c: Include unistd-safer.h.
4584 (save_cwd): Use fd_safer.
4585 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4586 [!_LIBC] Include "stat-macros.h" instead.
4587 * unistd-safer.h (fd_safer): New decl.
4589 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4591 * byteswap_.h: New file.
4593 2005-04-25 Albert Chin <china@thewrittenword.com>
4595 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4598 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4600 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4601 that "UTC +1 second" continues to work. Problem reported
4603 (relunit_snumber): New rule.
4606 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4608 * getdate.y (universal_time_zone_table): New constant.
4609 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4610 universal_time_zone_table.
4611 (lookup_zone): Prefer universal_time_zone_table to
4612 local_time_zone_table, so that "GMT" time stamps are allowed in
4613 London during the summer. Problem reported by Ian Abbott.
4615 2005-04-12 Jim Meyering <jim@meyering.net>
4617 * human.c (humblock): Set *options even when returning due to
4618 xstrtoumax conversion failure. Thanks to a used-uninitialized
4621 2005-04-09 Jim Meyering <jim@meyering.net>
4623 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4624 -Wuninitialized: initialize tm0.tm_year.
4626 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4628 * getdate.y (parser_control): rels_seen is now a boolean, not a
4629 count, since there's no maximum. All uses changed.
4630 Add member dsts_seen.
4631 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4633 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4634 Use pc_rels_seen to decide whther a date is absolute.
4636 * getdate.y (number): Don't overwrite year.
4637 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4640 2005-04-02 Simon Josefsson <jas@extundo.com>
4642 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4643 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4645 2005-03-27 Jim Meyering <jim@meyering.net>
4647 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4649 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4651 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4652 "one's complement" -> "ones' complement" in comment, as per Knuth.
4653 "value of type" -> "type or expression" in comment.
4654 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4656 2005-03-26 Jim Meyering <jim@meyering.net>
4659 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4660 Correct typos: s/or/of/.
4662 2005-03-23 Jim Meyering <jim@meyering.net>
4664 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4666 2005-03-21 Jim Meyering <jim@meyering.net>
4668 Changes imported from coreutils.
4670 * cycle-check.c: Don't include xalloc.h.
4672 * path-concat.c: Don't include assert.h.
4673 (path_concat): Remove assertion that would have triggered
4674 for ABASE starting with more than one slash.
4675 Reported by Andreas Schwab.
4677 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4678 properly when ABASE is an absolute file name.
4679 Correct the description of this function.
4681 Add an assertion and a test driver.
4682 This fixes a bug introduced on 2004-07-02.
4683 Andreas Schwab reported the resulting failure of cp --parents:
4684 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4686 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4688 * strftime.c (my_strftime): If the underlying strftime returns 0
4689 (which shouldn't happen), generate nothing instead of returning 0
4690 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4692 2005-03-16 Bruno Haible <bruno@clisp.org>
4694 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4696 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4698 * strftime.c (my_strftime): Prepend space to format so that we can
4699 reliably distinguish strftime failure from empty output on POSIX
4702 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4704 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4705 (iconv_string): Don't guess a size-zero buffer, as that might cause
4706 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4707 result would be 'too large', where 'too large' is (heuristically)
4708 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4709 overflow concerns. This will prevent some unwanted malloc failures
4710 when the inputs are very large.
4712 2005-03-15 Bruno Haible <bruno@clisp.org>
4714 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4717 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4720 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4722 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4724 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4725 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4727 * strtol.c: Likewise.
4729 2005-03-14 Simon Josefsson <jas@extundo.com>
4731 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4734 2005-03-14 Jim Meyering <jim@meyering.net>
4736 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4737 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4738 to be nonzero so that we (and caller) can detect the difference
4739 between a valid zero-length expansion and an error return, even
4740 when the underlying strftime fails before writing anything into
4743 2005-03-10 Jim Meyering <jim@meyering.net>
4745 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4746 so that this module works on systems without fchdir.
4748 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4750 Factor int-properties macros into a single file, except for
4751 glibc-related files.
4752 * intprops.h: New file.
4753 * getloadavg.c: Include it instead of limits.h.
4754 (INT_STRLEN_BOUND): Remove.
4755 * human.c: Include intprops.h.
4756 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4757 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4758 * inttostr.h: Include intprops.h instead of limits.h.
4759 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4760 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4761 for consistency with intprops.h.
4762 (time_t_is_integer, twos_complement_arithmetic): Use them.
4763 * sig2str.h: Include <signal.h>, intprops.h.
4764 (INT_STRLEN_BOUND): Remove.
4765 * strftime.c (TYPE_SIGNED): Remove.
4766 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4767 * strtol.c: Adjust comments to match intprops.h.
4768 * userspec.c: Include intprops.h.
4769 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4770 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4771 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4772 instead of rolling our own expressions.
4773 * xstrtol.c: Include xstrtol.h first, to test interface.
4775 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4777 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4778 the right thing even if adding 1900 would overflow. Similarly
4779 for tm_mon + 1 and tm_yday + 1.
4780 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4781 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4782 (DO_SIGNED_NUMBER): New macro.
4783 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4785 2005-03-07 Bruno Haible <bruno@clisp.org>
4787 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4789 2005-03-03 Derek R. Price <derek@ximbiot.com>
4790 Bruno Haible <bruno@clisp.org>
4792 * pagealign_alloc.h: New file.
4793 * pagealign_alloc.c: New file.
4795 2005-01-28 Bruno Haible <bruno@clisp.org>
4797 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4800 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4802 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4803 The workaround isn't strictly needed for POSIX conformance, and
4804 it's too much of a pain to configure and maintain. We'll ask
4805 people to fix their kernels instead.
4806 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4807 (NANOSLEEP_BUG_WORKAROUND): Remove.
4808 (xnanosleep): Remove the workaround.
4810 2005-02-12 Bruno Haible <bruno@clisp.org>
4812 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4814 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4816 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4817 * timespec.h (gettime): Return void, since it always
4818 succeeds now. All uses changed.
4819 * gettime.c (gettime) Likewise.
4820 [HAVE_NANOTIME]: Prefer nanotime.
4821 Assume gettimeofday succeeds, as POSIX requires.
4822 Assime time () succeeds, since other code already does.
4823 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4824 (timespec_subtract): Remove.
4825 (NANOSLEEP_BUG_WORKAROUND): New constant.
4826 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4827 things considerably. Use it only on GNU/Linux hosts, since the
4828 workaround shouldn't be needed elsewhere.
4830 2005-02-24 Bruno Haible <bruno@clisp.org>
4832 * gettext.h: Update from GNU gettext 0.14.2.
4834 2005-02-24 Bruno Haible <bruno@clisp.org>
4836 * localcharset.c: Update from GNU gettext 0.14.2.
4837 * config.charset: Update from GNU gettext 0.14.2.
4839 2005-02-22 Simon Josefsson <jas@extundo.com>
4841 * iconvme.h, iconvme.c: New files, from libc.
4843 2005-02-20 Neil Conway <neilc@samurai.com>
4845 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4846 returned by OSX/Darwin if the specified buffer is not large
4847 enough for the hostname.
4849 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4851 * memrchr.h: New file.
4852 * chdir-long.c: Include it.
4853 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4854 Don't bother including stddef.h.
4856 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4858 * argp-help.c (__argp_help): Create a fake struct argp_state and
4859 pass it to _help, otherwise the latter coredumps trying to
4860 dereference state.root_argp.
4862 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4864 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4866 Include <sys/types.h>, for dev_t.
4867 (ME_DUMMY, ME_REMOTE): Move from here....
4868 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4869 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4871 Include mountlist.h first, to test the interface.
4873 2005-01-29 Bruno Haible <bruno@clisp.org>
4875 * progname.c (program_name): Initialize.
4876 Needed when linking statically on MacOS X.
4878 2005-01-28 Bruno Haible <bruno@clisp.org>
4880 * javacomp.sh.in: New file, from GNU gettext.
4881 * javacomp.h: New file, from GNU gettext.
4882 * javacomp.c: New file, from GNU gettext.
4884 2005-01-26 Bruno Haible <bruno@clisp.org>
4886 * javaexec.sh.in: New file, from GNU gettext.
4887 * javaexec.h: New file, from GNU gettext.
4888 * javaexec.c: New file, from GNU gettext.
4890 2005-01-26 Simon Josefsson <jas@extundo.com>
4892 * gai_strerror.c: Use GPL in header.
4894 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4896 * argp-help.c (hol_entry_help): Avoid using non-constant
4897 initializers for struct pentry_state.
4898 (__argp_error): Check return value of __asprintf
4899 (__argp_failure): Translate error message
4901 * argp-parse.c: Removed braces around the expansion of N_()
4903 2005-01-21 Jim Meyering <jim@meyering.net>
4905 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4906 same value as for Solaris 9.
4908 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4909 component length. This included changing the parameter to be
4910 of type `char *' rather than `char const *'.
4911 * chdir-long.h (chdir_long): Update prototype.
4913 * openat.c (fdopendir, fstatat): New functions.
4914 * openat.h: Include headers required for use of DIR and struct stat.
4915 [AT_SYMLINK_NOFOLLOW]: Define.
4916 (fdopendir, fstatat): Add prototypes.
4918 2005-01-21 Bruno Haible <bruno@clisp.org>
4920 * classpath.h: New file, from GNU gettext.
4921 * classpath.c: New file, from GNU gettext.
4923 2005-01-20 Simon Josefsson <jas@extundo.com>
4925 * version-etc-fsf.c: New file, with version_etc_copyright.
4926 * version-etc.c: Remove version_etc_copyright.
4927 * version-etc.h (version_etc_copyright): Use [] instead of * in
4928 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4930 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
4932 * save-cwd.c (save_cwd): Remove code to support the case
4933 where fchdir is missing or flaky.
4935 2005-01-20 Simon Josefsson <jas@extundo.com>
4937 * base64.h (isbase64): Add.
4939 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4940 using a unsigned prototype, don't inline.
4941 (base64_decode): Use it.
4943 2005-01-19 Bruno Haible <bruno@clisp.org>
4945 * sh-quote.h: New file, from GNU gettext.
4946 * sh-quote.c: New file, from GNU gettext.
4948 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
4950 Merge changes from coreutils, as described below in several
4951 changelogs dated today.
4953 * save-cwd.c: Include "save-cwd.h" before other include files.
4954 (O_DIRECTORY): Remove; not needed here, since "." must be
4955 a directory. All uses removed.
4956 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
4957 universal on Suns, and we also need to test for IRIX.
4958 Revamp code to use 'if' rather than '#if'.
4959 Avoid unnecessary comparison of cwd->desc to 0.
4961 * utimens.c (futimens): Robustify the previous patch, by checking
4962 for known valid error numbers rather than observed invalid ones.
4964 2005-01-18 Jim Meyering <jim@meyering.net>
4966 * version-etc.c (version_etc_copyright): Update copyright date.
4968 * utimens.c (futimens): Account for the fact that futimes
4969 can also fail with errno == ENOSYS or errno == ENOENT.
4970 Patch from Dmitry V. Levin.
4972 Change the name of the robust chdir function from chdir to chdir_long.
4973 * save-cwd.c: Include chdir-long.h rather than chdir.h.
4974 (restore_cwd): Use chdir_long, not chdir.
4975 * chdir-long.c: Renamed from chdir.c.
4976 * chdir-long.h: Renamed from chdir.h.
4977 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4980 2005-01-18 Bob Proulx <bob@proulx.com>
4982 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4983 offsetof() macro construct to avoid compile failure with native HP-UX
4984 11.0 ANSI C compiler.
4986 2005-01-06 Bruno Haible <bruno@clisp.org>
4988 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4989 because stpncpy.m4 takes care of it.
4991 2004-01-24 Bruno Haible <bruno@clisp.org>
4993 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4995 2003-10-09 Bruno Haible <bruno@clisp.org>
4997 * progreloc.c: Include xalloc.h instead of xmalloc.h.
4999 2005-01-06 Bruno Haible <bruno@clisp.org>
5001 * fwriteerror.h (fwriteerror): Change specification to include fclose.
5002 * fwriteerror.c: Include <stdbool.h>.
5003 (fwriteerror): At the end, close the file stream. Record whether
5004 stdout was already closed.
5006 2004-05-27 Bruno Haible <bruno@clisp.org>
5008 * execute.c (environ): Declare if needed.
5009 * pipe.c (environ): Likewise.
5010 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
5012 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
5014 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
5015 definitions to be after all include files, to avoid collisions.
5016 Problem reported by Bob Proulx.
5018 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
5020 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
5021 not needed. This removes a dependency on the gettext module.
5022 [defined _LIBC]: Do not include <libintl.h>; not needed.
5024 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
5026 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
5029 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
5031 * argp-parse.c: Include <stddef.h>.
5032 (alignof, alignto): New macros.
5033 (parser_init): Don't assume that void * is aligned sufficiently
5036 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
5037 need to extend the stack.
5038 (YYINITDEPTH): New macro, so that the initial stack isn't overly
5041 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5043 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
5045 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5047 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
5048 Remove now-obsolete comment about AIX.
5049 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
5050 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
5051 (YYMAXDEPTH): New macro.
5053 2004-12-18 Bruno Haible <bruno@clisp.org>
5055 * fatal-signal.c (fatal_signals): Make non-const.
5056 (init_fatal_signals): New function.
5057 (uninstall_handlers, install_handlers): Ignore signals that were set to
5059 (at_fatal_signal): Call init_fatal_signals.
5060 (init_fatal_signal_set): Likewise. Ignore signals that were set to
5062 Reported by Paul Eggert.
5064 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5066 * getdate.y (textint): New member "negative".
5067 (time_zone_hhmm): New function.
5068 Expect 14 shift-reduce conflicts, not 13.
5069 (o_colon_minutes): New rule.
5070 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
5071 (yylex): Set the "negative" member of signed numbers.
5073 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
5075 Changes imported from coreutils.
5076 * hard-locale.c: Assume <locale.h> exists.
5078 (GLIBC_VERSION): New macro.
5079 (hard_locale): Assume setlocale exists.
5080 Rewrite to avoid #ifdef.
5081 Use strdup rather than malloc + strcpy.
5082 * human.c: Assume <locale.h> exists.
5083 (human_readable): Assume localeconv exists.
5085 2004-12-01 Jakub Jelinek <jakub@redhat.com>
5087 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5088 convert T2, not T. (Imported from libc.)
5090 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
5092 * getcwd.c (is_ENAMETOOLONG): New macro.
5093 (__getcwd.c): Don't restore errno; glibc doesn't.
5094 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5095 first, falling back to our code only if its results look suspicious.
5096 Ensure that the resulting buffer is only as large as necessary.
5098 * readutmp.c: Include readutmp.h first.
5099 Include <errno.h>, since readutmp.h no longer does that.
5100 * readutmp.h: Don't include <errno.h>,
5101 <sys/param.h>, <time.h>; not needed to establish interface.
5102 (errno): Remove decl.
5103 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5104 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5105 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5107 2004-11-28 Simon Josefsson <jas@extundo.com>
5109 * base64.h, base64.c: New file.
5111 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
5113 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5115 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
5117 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5118 HP's ANSI C compiler.
5119 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5120 Declaring int functions causes warnings on some modern systems and
5121 shouldn't be needed to compile on ancient ones.
5122 * same.c (MIN) [defined MIN]: Don't define, since it's already
5125 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5126 with the following changes.
5127 (__set_errno): Parenthesize properly.
5128 Include <stdbool.h>.
5129 (MIN, MAX, MATCHING_INO): New macros.
5130 (__getcwd): Define with prototype, not K&R form.
5131 Use heuristics to allocate default buffer on stack if possible.
5132 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5133 behavior, and to avoid the PATH_MAX limit when computing
5135 Use MATCHING_INO to compare inode number to file.
5136 Check for arithmetic overflow in size calculations.
5137 Fix bug in reallocation of dot array that caused getcwd to fail
5138 on directories nested deeper than 75.
5139 Be more careful about saving errno on error.
5140 Do not use realloc; use only free+malloc, as this is a bit
5141 more flexible and avoids a needless copy operation.
5142 Do not inspect st_dev and st_ino for symbolic links; POSIX
5143 doesn't specify the latter.
5144 Check for closedir errors.
5145 Avoid needless casts.
5146 Use "#ifdef weak_alias" around weak_alias, to be like other
5148 The following changes to getcwd.c have effect only when used in
5149 gnulib; they have no effect inside glibc proper.
5150 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5151 as alloca isn't used.
5152 (alloca, __alloca): Likewise.
5153 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5154 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5155 unconditionally, as gnulib assumes C89 or better.
5156 Do not include <sys/param.h>.
5157 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5158 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5160 (NULL) [!defined NULL]: Remove; we assume C89 or better.
5161 Include <dirent.h> in a way that is compatible with modern Autoconf.
5162 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5163 New macros, if not already defined.
5164 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5165 Use "_LIBC", not "defined _LIBC", for consistency.
5166 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5168 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5169 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
5170 * xgetcwd.c: David MacKenzie's old code was removed, so give
5171 credit only to Jim Meyering and adjust the copyright dates.
5172 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5173 <stdlib.h>, <unistd.h>, "pathmax.h".
5174 Instead, include "xgetcwd.h" (first) and "getcwd.h".
5175 (INITIAL_BUFFER_SIZE): Remove.
5176 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5178 2004-11-23 Jim Meyering <jim@meyering.net>
5180 * getopt_.h: Remove trailing blanks.
5182 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5184 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5185 (futimens): New function, which uses futimes if available.
5186 (futimens, utimens): Support timespec==NULL, with same semantics
5187 as utime and utimens.
5188 * utimens.h (futimens): New decl.
5190 2004-11-23 Jim Meyering <jim@meyering.net>
5192 * __fpending.c: Add comment.
5194 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5196 * getopt_.h: Re-addition of __getopt_argv_const caused
5197 redefinition warnings. To avoid them, include the defines
5198 in `#if !defined __need_getopt ... #endif'. The only place
5199 where __getopt_argv_const is used is in definitions
5200 of getopt_long and getopt_long_only below, which are as well
5201 protected by `#ifndef __need_getopt'.
5202 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5203 __need_getopt after including <stdio.h> and <unistd.h> These
5204 headers might have defined it.
5206 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
5208 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5210 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5211 optopt): Use them instead of invoking ## directly; otherwise, the
5212 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5214 2004-11-19 Bruno Haible <bruno@clisp.org>
5216 * strtok_r.c: Move comments from here...
5217 * strtok_r.h: ... to here.
5219 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
5221 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5222 might fail. Problem reported by Yoann Vandoorselaere.
5223 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5224 that mishandle size_t overflow.
5226 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
5228 * canon-host.c: Include "strdup.h".
5229 (canon_host): Use getaddrinfo if available, so that IPv6 works.
5230 Use strdup instead of malloc/strcpy to duplicate strings.
5232 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5233 (human_space_before_unit): New constant.
5234 * human.c (human_readable): Support it.
5236 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5237 (xgetcwd): Set errno correctly when failing.
5238 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5239 the failure is actually due to a PATH_MAX problem.
5241 Further getopt changes to make it more likely that glibc will
5242 buy the changes back.
5243 * getopt.c (POSIXLY_CORRECT): New constant.
5244 (getopt): Use it, so to preserve glibc semantic
5245 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5246 when compiling for libc.
5247 * getopt_.h (__getopt_argv_const): Bring it back.
5248 (getopt_long, getopt_long_only): Use it.
5250 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5251 New arg POSIXLY_CORRECT. All callers changed.
5252 (getopt): Argv is now char * const *, as per standard.
5253 (_getopt_internal_r, _getopt_internal): Argv is now char **,
5254 not char *__getopt_argv_const *.
5255 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5256 _getopt_long_only_r): Likewise.
5257 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5258 * getopt_int.h (_getopt_internal, _getopt_internal_r,
5259 _getopt_long_r, _getopt_long_only_r): Likewise.
5260 * getopt_.h (__getopt_argv_const): Remove.
5261 (getopt): Argv is now char * const *, as per standard.
5263 * getdate.y (tORDINAL): New token.
5264 (day, relunit): Allow it for relative times.
5265 (relative_time_table): Use tORDINAL for ordinals.
5267 2004-11-15 Jim Meyering <jim@meyering.net>
5269 * closeout.c: Include "__fpending.h" once again.
5270 Include <stdbool.h>.
5271 (close_stdout): Don't fail just because stdout was closed initially,
5272 since some programs don't write to stdout in the normal course of
5273 operation (other than --version and --help), and we don't want this
5274 function to make e.g. `touch file >&-' fail.
5275 But do fail if it was closed and someone has tried to write to it.
5276 E.g., `printf foo >&-' must fail.
5278 2004-11-11 Simon Josefsson <jas@extundo.com>
5280 * strtok_r.h, strtok_r.c: New file.
5282 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
5284 * getopt_.h (__getopt_argv_const): New macro, to be used so that
5285 we can stop lying to compilers about the constness of argv when we
5286 are compiled outside glibc.
5287 (getopt, getopt_long, getopt_long_only): Use it.
5288 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5290 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5291 _getopt_long_only_r): Likewise.
5292 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5293 _getopt_long_only_r): Likewise.
5295 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5296 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5297 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5298 the other external symbols.
5299 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5300 declaration, since the above renaming now works around collisions.
5302 2004-11-11 Jim Meyering <jim@meyering.net>
5304 * linebreak.c: Remove trailing blanks.
5305 * alloca_.h: Likewise.
5306 * acosl.c: Likewise.
5307 * euidaccess.c: Likewise.
5308 * allocsa.h: Likewise.
5310 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
5312 * mktime.c (SHR): New macro, which is a portable
5313 substitute for >> that should work even on Crays.
5314 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5315 Problem reported by Mark D. Baushke in
5316 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5317 * getdate.y (SHR): Likewise.
5319 * strftime.c (SHR): Likewise.
5321 * quotearg.c (struct quoting_options): Use unsigned int for
5322 quote_these_too, so that right shifts are well defined. All uses
5325 2004-11-10 Simon Josefsson <jas@extundo.com>
5327 * getaddrinfo.h, getaddrinfo.c: New files.
5329 2004-11-10 Jim Meyering <jim@meyering.net>
5331 Ensure that no close failure goes unreported.
5332 * closeout.c (close_stdout): Always close stdout. I.e., don't
5333 return early when it seems there's nothing to flush.
5334 Don't include __fpending.h.
5336 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
5338 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5340 2004-11-05 Bruno Haible <bruno@clisp.org>
5342 * readlink.c: Include stddef.h, needed for size_t on Woe32.
5343 Reported by Mark D. Baushke <mdb@cvshome.org>.
5345 2004-11-04 Bruno Haible <bruno@clisp.org>
5347 2004-09-11 Bruno Haible <bruno@clisp.org>
5348 * allocsa.valgrind: New file.
5349 2004-02-06 Bruno Haible <bruno@clisp.org>
5350 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5351 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5352 Reported by Christopher Seip <chris.seip@hp.com>.
5354 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
5356 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5357 with errno == ERANGE if the buffer is too small.
5358 Problem reported by Mark D. Baushke.
5360 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
5362 * xreadlink.c (MAXSIZE): New macro.
5363 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
5364 size does not exceed MAXSIZE. Avoid cast.
5365 As suggested by Mark D. Baushke in
5366 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5367 if readlink fails with buffer size just under MAXSIZE, try again
5370 2004-11-02 Derek R. Price <derek@ximbiot.com>
5371 and Paul Eggert <eggert@cs.ucla.edu>
5373 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5374 (get_date): Overparenthesize to avoid GCC warning.
5376 2004-11-02 Bruno Haible <bruno@clisp.org>
5378 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5379 function returns void.
5381 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
5383 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5384 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5387 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
5389 * getdate.y: Add support for TZ="foo" within a date string.
5390 Fix some bugs near time_t boundaries. Reject dates with
5391 out-of-range components, e.g., "Sept 31".
5392 Include <stdlib.h>, "setenv.h", "xalloc.h".
5393 (ISDIGIT_LOCALE): Remove; unused.
5394 Note that the TZ and time functions used here are not reentrant.
5395 (mktime_ok, get_tz): New functions.
5396 (TZBUFSIZE): New constant.
5397 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
5398 This requires that we sometimes generate our own TZ="XXX..." setting.
5400 2004-10-27 Derek R. Price <derek@ximbiot.com>
5402 * mktime.c (not_equal_tm): Remove redundant check.
5404 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
5406 * getdate.y: Use Bison 1.875 features, and some minor
5407 code cleanups. This change does not affect semantics.
5408 Don't include <stdlib.h>; no longer needed.
5409 Don't include unlocked-io.h; only the "#if TEST" code uses
5410 stdio, and performance isn't crucial there.
5411 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5412 Bison 1.875 features as described below.
5413 All uses of "PC." replaced by "pc->".
5414 (YYSTYPE): Add a forward declaration.
5415 (yylex, yyerror): Use full prototypes in forward decls.
5416 Use "%pure-parser" rather than obsolescent "%pure_parser".
5417 Use %parse-param and %lex-param instead of obsolescent
5418 YYPARSE_PARAM and YYLEX_PARAM.
5419 (meridian_table, month_and_day_table, time_units_table,
5420 relative_time_table, time_zone_table, military_table,
5421 lookup_zone, lookup_word, get_date):
5422 Use NULL instead of 0 where appropriate.
5423 (to_hour): Avoid abort (), to avoid a dependency on
5425 (yyerror, yylex): Now accepts parser_control * arg.
5426 (main) [TEST]: Use '\0' rather than 0 for char.
5428 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5430 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5431 It's now the caller's responsibility to handle the case where
5432 !HAVE_GETPAGESIZE && !defined getpagesize.
5434 * mktime.c (leapyear): Arg is long int, not int.
5436 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
5438 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5440 2004-10-12 Simon Josefsson <jas@extundo.com>
5442 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5443 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5446 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
5448 * vsnprintf.h: New file.
5449 * vsnprintf.c: New file.
5451 2004-10-07 Bruno Haible <bruno@clisp.org>
5453 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5454 into the provided buffer.
5456 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
5458 * diacrit.c, diacrit.h: Add GPL notice.
5460 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5461 * atanl.c (atanl): Keep the code as similar to glibc as possible.
5462 * logl.c (logl): Keep the code as similar to glibc as possible.
5463 This avoids a potential constant-folding bug.
5465 2004-10-05 Bruno Haible <bruno@clisp.org>
5467 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5469 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5471 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
5472 * xmalloc.c (xmemdup): Likewise.
5473 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5474 XFREE): Remove these long-obsolescent macros.
5475 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5476 * xstrdup.c: Remove.
5478 * regex.c (re_comp): Cast gettext return value to char *,
5479 Problem reported by Martin Neitzel via Mark D. Baushke.
5481 2004-10-04 Simon Josefsson <jas@extundo.com>
5483 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5484 '#ifdef USE_UNLOCKED_IO'.
5486 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5488 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5489 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5490 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5491 regex.c, sha1.c, version-etc.c, yesno.c:
5492 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5493 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5494 the includer's responsibility.
5496 Sync from coreutils.
5498 * modechange.c (mode_compile): Don't decrement a pointer that
5499 points to the start of a string, as the C Standard says the
5500 resulting behavior is undefined.
5502 * backupfile.h (enum backuptype): Rename none -> no_backups,
5503 simple -> simple_backups, numbered_existing ->
5504 numbered_existing_backups, numbered -> numbered_backups
5505 to avoid shadowing problems. All uses changed.
5506 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5507 * backupfile.c (check_extension, numbered_backup):
5508 Rename locals to avoid shadowing 'basename'.
5509 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5512 * .cppi-disable: Add getopt_.h, getopt_int.h.
5513 * .cvsignore: Add getopt.h.
5515 2004-10-04 Simon Josefsson <jas@extundo.com>
5517 * memmem.h: New file.
5518 * memmem.c: New file, taken from glibc.
5520 2004-10-02 Jim Meyering <jim@meyering.net>
5522 * dirfd.h, getpagesize.h: Add copyright notice.
5524 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5526 * snprintf.c: Remove comments as to why each header is needed.
5528 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5530 * strsep.h: New file.
5531 * strsep.c: New file.
5533 2004-10-01 Simon Josefsson <jas@extundo.com>
5535 * snprintf.c (snprintf): Handle size==0.
5537 2004-10-01 Simon Josefsson <jas@extundo.com>
5538 Bruno Haible <bruno@clisp.org>
5540 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5541 (snprintf): Declare 'args'.
5543 2004-09-30 Simon Josefsson <jas@extundo.com>
5545 * snprintf.h, snprintf.c: New files.
5547 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5549 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5550 (hol_entry_help): Never translate an empty string.
5551 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5552 * argp.h (OPTION_NO_TRANS): New option.
5554 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5556 * xvasprintf.c: Include xalloc.h.
5557 (xvasprintf): Use xalloc_die, not xmalloc_die.
5559 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5561 * dummy.c: Change copyright notice to FSF, and license to GPL.
5563 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5565 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5566 Problem reported by Bruno Haible in:
5567 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5569 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5571 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5572 in case some system header has #define'd it. Problem reported by
5573 Soeren D. Schulze in
5574 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5576 2004-09-08 Bruno Haible <bruno@clisp.org>
5578 * stdint_.h: New file, taken from GNU clisp.
5580 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5582 * xvasprintf.h: New file.
5583 * xvasprintf.c: New file.
5584 * xasprintf.c: New file.
5586 2004-09-08 Bruno Haible <bruno@clisp.org>
5588 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5590 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5592 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5594 Import from coreutils.
5595 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5596 strings on unbounded length. alloca's performance benefits aren't
5597 that important here.
5599 (parse_with_separator): New function, with most of the internals
5600 of the old parse_user_spec. Allow user to omit both user and group,
5601 for compatibility with FreeBSD.
5602 Clone only the user name, not the entire spec.
5603 Do not set *uid, *gid unless entirely successful.
5604 Avoid memory leak in some failing cases.
5605 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5606 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5607 (parse_user_spec): Rewrite to use parse_with_separator.
5609 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5611 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5612 its complicated substitute.
5613 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5614 and program_invocation_name.
5615 (__argp_basename) [!_LIBC]: Remove; the only use was
5616 replaced by its body.
5617 (__argp_short_program_name): Change condition from
5618 !defined __argp_short_program_name to
5619 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5620 to match argp-namefrob.h.
5621 (__argp_failure): Don't assume strerror_r returns char *.
5622 * argp-parse.c (N_): Define unconditionally.
5623 (argp_default_options): Fill out initializers with 0 to avoid
5626 2004-08-12 Simon Josefsson <jas@extundo.com>
5628 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5629 * getopt_.h: Renamed from getopt.h.
5631 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5633 Merge from coreutils.
5635 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5636 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5637 for Reliant Unix 5.43.
5639 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5640 (union fooround): Use uintmax_t, not long int.
5641 The rest is a merge from libc:
5642 [defined _LIBC]: Include <shlib-compat.h>.
5643 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5645 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5647 * strverscmp.c: Convert to UTF-8.
5649 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5651 * obstack.h (obstack_empty_p):
5652 Don't assume that chunk->contents is suitably aligned.
5653 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5654 Likewise. Problem reported by Benno in
5655 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5657 * chown.c (rpl_chown): Work even if the file is writeable but not
5658 readable. This could be improved further but it'd take some work.
5660 2004-08-08 Simon Josefsson <jas@extundo.com>
5662 * xgethostname.c: Don't include error.h (not used).
5665 * getpass.c: Include getpass.h first.
5667 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5669 * xalloc-die.c: New files.
5670 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5672 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5673 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5674 (_, N_, xalloc_die): Move to xalloc-die.c.
5675 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5676 so that we needn't mess with xalloc_msg_memory_exhausted.
5678 * sha1.h: Renamed from sha.h.
5679 (SHA1_H): Renamed from _SHA_H.
5680 (sha1_ctx): Renamed from sha_ctx.
5681 (sha1_init_ctx): Renamed from sha_init_ctx.
5682 (sha1_process_block): Renamed from sha_process_block.
5683 (sha1_process_bytes): Renamed from sha_process_bytes.
5684 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5685 (sha1_read_ctx): Renamed from sha_read_ctx.
5686 (sha1_stream): Renamed from sha_stream.
5687 (sha1_buffer): Renamed from sha_buffer.
5688 * sha1.c: Likewise; renamed from sha.c.
5689 Do not include <sys/types.h>.
5690 Include <stddef.h> rather than <stdlib.h>.
5692 2004-08-08 Bruno Haible <bruno@clisp.org>
5694 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5695 FILESYSTEM_PREFIX_LEN.
5696 * progreloc.c: Likewise.
5697 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5699 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5702 * argp-help.c (make_hol, hol_append): Don't assume that
5703 SIZE_MAX is a valid preprocessor constant.
5704 (__argp_basename): Change from "#ifndef _LIBC"
5705 to "#ifndef __argp_short_program_name", so that
5706 we don't compile these functions for tar.
5708 More merges from coreutils.
5709 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5710 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5712 * addext.c: Remove; no longer needed.
5713 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5714 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5715 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5716 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5717 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5718 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5719 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5720 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5721 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5722 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5723 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5724 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5725 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5726 Import changes from coreutils.
5728 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5730 Merge from coreutils.
5732 * .gdb-history: Remove; this doesn't belong here.
5734 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5735 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5736 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5738 * dirname.h: Include <stdbool.h>.
5739 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5740 for consistency with POSIX terminology. All uses changed.
5741 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5742 (strip_trailing_slashes): Use bool for booleans.
5743 * stripslash.c (strip_trailing_slashes): Likewise.
5745 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5746 sometimes returns a positive errno value even when it succeeds.
5747 (print_errno_message) [!LIBC]: Fall back on strerror if
5750 * path-concat.c (mempcpy): Don't define if a system header defines it.
5751 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5752 (longest_relative_suffix): New function.
5753 (path_concat): Use it. Assume first argument is not NULL.
5754 Port to DOS. Omit redundant separators.
5755 Report an error instead of returning NULL.
5756 Use mempcpy instead of memcpy.
5757 (xpath_concat): Remove: not declared or used.
5759 * same.h: Include <stdbool.h>
5760 (same_name): Return bool, not int.
5761 * same.c (same_name): Likewise.
5762 (errno): Don't declare; we assume C89 or better now.
5764 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5765 if not already defined.
5767 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5768 * dup-safer.c (errno): Likewise.
5770 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5772 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5775 2004-08-03 Simon Josefsson <jas@extundo.com>
5777 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5778 * progname.h: Don't include stdbool.h.
5780 2004-08-02 Simon Josefsson <jas@extundo.com>
5782 * getsubopt.h: New file, with comments from Bruno Haible.
5783 * getsubopt.c: New file, from glibc, but slightly modified based on
5784 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5786 2004-08-01 Simon Josefsson <jas@extundo.com>
5788 * xgetdomainname.c: Include stdlib.h, for free().
5790 2004-07-16 Simon Josefsson <jas@extundo.com>
5792 * dummy.c: New file.
5794 2004-07-16 Bruno Haible <bruno@clisp.org>
5796 * backupfile.h: Add extern "C" for C++.
5797 * closeout.h: Likewise.
5798 * copy-file.h: Likewise.
5799 * findprog.h: Likewise.
5800 * full-write.h: Likewise.
5801 * pathname.h: Likewise.
5802 * progname.h: Likewise.
5803 * stpcpy.h: Likewise.
5804 * stpncpy.h: Likewise.
5805 * strcase.h: Likewise.
5806 * strstr.h: Likewise.
5807 * xalloc.h: Likewise.
5809 * mbswidth.h: Add extern "C" for C++.
5810 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5812 2004-07-09 Simon Josefsson <jas@extundo.com>
5814 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5815 failed without this.)
5817 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5819 * fchown-stub.c: New file.
5821 2004-06-24 Jim Meyering <jim@meyering.net>
5823 * obstack.h (obstack_base): Cast to (void *), per documentation.
5825 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5827 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5829 2004-06-01 Jim Meyering <jim@meyering.net>
5831 * calloc.c: New file.
5833 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5835 * getdate.y (yylex): Allow space between sign and number.
5836 Problem reported by Dan Jacobson.
5838 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5839 and Jim Meyering <jim@meyering.net>
5841 Merge from coreutils CVS.
5843 * stat-macros.h: New file, with contents from file-type.h
5844 and coreutils' system.h.
5845 * file-type.c: Include "stat-macros.h".
5846 * file-type.h (file_type): Move all macro definitions to new file,
5849 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5850 Wrap old code with this conditional.
5851 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5852 function that does not dereference symlinks.
5853 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5855 * xreadlink.c: Include xreadlink.h first, to catch .h file
5856 dependency problems.
5857 (xreadlink): Accept new arg SIZE, for efficiency.
5858 All decls and uses changed.
5859 * xreadlink.h: Include <stddef.h>, for size_t.
5861 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5862 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5864 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5866 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5868 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5869 macros to be defined.
5870 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5871 the allocator returns NULL because the requested size is zero.
5873 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5875 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5876 var. Add comment explaining why libc still defines it. This
5877 merges the following patch from glibc:
5878 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5880 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5882 * obstack.c (_obstack): Remove unused variable. It hasn't been
5883 present in glibc since revision 1.1 of this file.
5884 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5885 obstack_alignment_mask, obstack_alloc, obstack_base,
5886 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5887 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5888 obstack_grow0, obstack_init, obstack_int_grow,
5889 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5890 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5891 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5892 nonexistent functions.
5894 2004-05-17 Derek R. Price <derek@ximbiot.com>
5895 Paul Eggert <eggert@cs.ucla.edu>
5897 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5899 2004-05-14 Bruno Haible <bruno@clisp.org>
5901 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5902 that consists of a '.' followed by an empty digit string.
5903 Patch by Tor Lillqvist <tml@iki.fi>.
5905 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5907 Port obstack to the AS/400, where pointers are 16 bytes wide and
5908 you cannot cast an integer to a valid pointer. This patch is
5909 currently waiting to be integrated into glibc; see
5910 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5912 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5913 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5914 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5915 (struct obstack): temp member is now a union of a pointer and
5916 an integer, instead of an integer. All integer uses changed.
5917 This does not affect the physical layout of struct obstack,
5918 except on hosts (like the AS/400) where the size or alignment of
5919 void * is greater than that of ptrdiff_t.
5920 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5921 __STDC__)]: Store temporary in pointer member of union, not
5923 * obstack.c: Include <stddef.h>, for offsetof.
5924 (struct fooalign): Remove; it doesn't need a name.
5925 (union fooround): Change double to long double, and add void *.
5926 (DEFAULT_ALIGNMENT): Use offsetof to compute.
5927 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5928 not a macro. Hence the values are always int; so remove all
5929 casts-to-int in uses.
5931 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
5932 Derek Price <derek@ximbiot.com>
5934 * alloca.c: Include <alloca.h>, to get our interface.
5935 * alloca_.h: Use __alloca on AIX, so that we don't have to
5936 include <alloca.h> first. Use C89 prototype for alloca; this
5937 requires including <stddef.h> for size_t. Use extern "C" if C++.
5938 Use #elif for simplicity, since we can assume C89 now.
5939 Don't try to source the system alloca.h since it will not be found
5940 and to prevent recursively including its replacement.
5941 * fnmatch.c: Include <alloca.h> instead of opencoding.
5942 * regex.c: Likewise.
5944 2004-05-16 Derek Price <derek@ximbiot.com>
5945 Paul Eggert <eggert@cs.ucla.edu>
5947 getline cleanup. This changes the getndelim2 API: both order of
5948 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5951 * getline.c: Don't include stddef.h or stdio.h, since our
5952 interface does that.
5953 (getline): Always use getdelim, so that we don't have two
5954 copies of this code.
5955 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5957 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5958 (GETNDELIM2_MAXIMUM): New macro.
5959 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
5960 instead of the old practice of delim2==0. All callers changed.
5961 Return -1 on overflow, instead of returning junk.
5962 Do not set *linesize unless allocation succeeds.
5963 * getndelim2.h: Do not include stddef.h; no longer needed, now
5964 that we include sys/types.h.
5965 * getnline.h: Likewise.
5966 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5967 (getndelim2): Reorder arguments.
5968 * getnline.c (getnline, getndelim):
5969 Don't discard the NMAX argument.
5970 (getnline): Invoke getndelim, to avoid code duplication.
5971 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5972 of (size_t) -1 by callers of the getnline family.
5974 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
5976 * nanosleep.c (suspended): Change its type from int to
5977 sig_atomic_t volatile.
5978 (first_call): Make it private to rpl_nanosleep, and have it
5979 be zero initially as that's a bit faster.
5980 (my_usleep): Round up fractional times instead of truncating them,
5981 as this is the usual meaning for 'sleep'.
5983 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5985 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5986 (ENOSYS): Define if not defined.
5987 (settime): Fall back on stime if it exists and settimeofday fails.
5988 But don't bother with fallbacks if a method fails with errno == EPERM.
5990 2004-05-11 Jim Meyering <jim@meyering.net>
5992 Prior to this change, the save_cwd caller required read access to the
5993 current directory on most systems (ones with the fchdir function).
5995 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5996 fails, try write-only, and finally, resort to using xgetcwd.
5998 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6000 * obstack.c, obstack.h: Import changes from libc.
6002 2004-04-28 Bruno Haible <bruno@clisp.org>
6004 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
6005 implicitly appends .exe to executables.
6006 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
6007 accepts Windows pathnames.
6008 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6009 Cygwin like Windows, since it now accepts Windows pathnames.
6010 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
6011 Cygwin like Windows, since it now accepts Windows pathnames.
6012 Reported by Derek Robert Price <derek@ximbiot.com>.
6014 2004-04-20 Jim Meyering <jim@meyering.net>
6016 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
6018 2004-04-20 Jim Meyering <jim@meyering.net>
6019 Bruno Haible <bruno@clisp.org>
6021 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
6022 memory when realloc fails.
6024 2004-04-18 Jim Meyering <jim@meyering.net>
6026 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
6027 don't leak memory and do call END_UTMP_ENT.
6029 2004-04-11 Paul Eggert <eggert@twinsun.com>
6031 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
6032 (CHAR_BIT): Remove, since we assume C89.
6033 Include <stdint.h> if available, as per current Autoconf CVS advice.
6035 2004-03-30 Paul Eggert <eggert@twinsun.com>
6037 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
6038 not bool, to be more consistent with Unix conventions.
6039 Suggested by Bruno Haible.
6041 Merge from coreutils.
6043 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
6046 * getdate.h: Include stdbool.h, and timespec.h instead of
6047 the usual <time.h> dance.
6048 (get_date): Change signature to support fractional time stamps.
6049 All callers changed.
6050 * getdate.y: Include "getdate.h" first, as we can now
6051 assume C89 and don't need to worry about 'const'.
6052 Similarly, include "unlocked-io.h" near start, not in middle.
6054 (textint.value): Use long int rather than int.
6055 (textint.digits): Use size_t rather than int.
6056 (BILLION, LOG10_BILLION): New constants.
6057 (parser_control): New member rel_ns. Members day_ordinal,
6058 time_zone, month, day, hour, minutes, rel_year, rel_month,
6059 rel_day, rel_hour, rel_minutes, rel_seconds
6060 are now long int, not int. Member seconds is now struct timespec,
6061 not int. New member timespec_seen. Members dates_seen, days_seen,
6062 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
6064 (%union.intval): Now long int, not int.
6065 New member timespec.
6066 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
6067 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
6068 (spec): Now is a timespec or an item list.
6069 (timespec, items): New nonterminals.
6070 (time, rel, relunit, number, get_date):
6071 Add support for fractional seconds.
6072 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
6073 (gmtime, localtime, mktime): Remove decls; not needed with C89.
6074 (to_hour): First arg is now long int, not int.
6075 (to_year): Returns long int, not int.
6076 Don't treat year -70 like 70.
6077 (tm_diff): Returns long int, not int.
6078 (lookup_word): Use bool instead of int when appropriate.
6079 (yylex): Use size_t for count, not int.
6080 Detect overflow when parsing large integer constants.
6081 Add support for fractions.
6082 (get_date): Make pointers 'const' if possible.
6083 Use more-portable code to detect integer overflow.
6084 (main) [TEST]: Adjust to above changes. Test for localtime failure.
6085 Don't use ctime; it's not reliable if the year has >4 digits.
6087 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6088 This is for compatibility with BSD.
6090 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6091 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6092 From coreutils' system.h.
6094 * userspec.c: Don't include "posixver.h".
6095 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6096 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6097 compatible extension. Simplify code by removing a boolean int
6098 that was always nonzero if a string was nonnull.
6100 2004-03-30 Jim Meyering <jim@meyering.net>
6102 Merge from coreutils.
6104 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6106 * readtokens.c (readtoken): Don't leak 64 bytes when reading
6107 an empty input stream.
6109 * readtokens.c: Include <stdbool.h>.
6110 (readtoken): Use `size_t' rather than int/long.
6111 All callers adjusted.
6112 Use `bool' rather than `int' where appropriate.
6113 Use memset rather than an explicit loop.
6114 Use x2nrealloc rather than xrealloc.
6115 Allow the use of `\0' as a delimiter.
6116 (readtokens): Likewise.
6117 * readtokens.h (readtoken, readtokens): Update prototypes.
6119 2004-03-30 Bruno Haible <bruno@clisp.org>
6121 * getloadavg.c (getloadavg): Don't assume setlocale returns
6124 2004-03-29 Paul Eggert <eggert@twinsun.com>
6126 Merge changes to getloadavg.c from coreutils and Emacs.
6128 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6129 Define to an expression, not to the empty string.
6130 Include cloexec.h and xalloc.h.
6131 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6132 Use set_cloexec_flag rather than rolling our own.
6133 * cloexec.c, cloexec.h: New files.
6135 2004-03-18 Paul Eggert <eggert@twinsun.com>
6137 * getopt.h: Sync with libc CVS.
6139 2004-03-18 Paul Eggert <eggert@twinsun.com>
6140 Bruno Haible <bruno@clisp.org>
6142 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6143 not on all platforms that have <wchar.h>.
6144 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6146 2004-03-09 Paul Eggert <eggert@twinsun.com>
6148 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6150 * getopt_int.h: New file, also synced from libc.
6152 2004-03-07 Paul Eggert <eggert@twinsun.com>
6154 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
6155 '#if' expressions. Unlike the code it replaces, it does not
6156 depend on (defined _SC_PAGESIZE). However, it does depend on
6157 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6158 first reported by Jason Andrade in
6159 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6161 2004-01-18 Simon Josefsson <jas@extundo.com>
6163 * strdup.h: New file.
6164 * strdup.c: Include it.
6165 * path-concat.c: Include strdup.h. Drop strdup declaration.
6166 * userspec.c: Include strdup.h. Drop strdup declaration.
6168 2004-02-06 Karl Berry <karl@gnu.org>
6170 * config.charset: update from gettext 0.14.1.
6172 2004-02-05 Paul Eggert <eggert@twinsun.com>
6174 Add comments and code, prompted by suggestions from Bruno Haible
6176 * quotearg.h (quotearg_alloc): New decl. Improve the comments
6177 describing the enum quoting_style values.
6178 * quotearg.c (quotearg_alloc): New function.
6179 (quotearg_buffer_restyled): Treat lone { and } as special.
6180 Treat = as special. Work around bug with older shells
6181 that "see" a '\' that is really the 2nd byte of a multibyte char.
6182 Quote empty string with shell_quoting_style.
6184 2004-02-03 Bruno Haible <bruno@clisp.org>
6186 * pipe.h: New file, from GNU gettext.
6187 * pipe.c: New file, from GNU gettext.
6189 2004-01-27 Bruno Haible <bruno@clisp.org>
6191 * execute.h: New file, from GNU gettext.
6192 * execute.c: New file, from GNU gettext.
6193 * w32spawn.h: New file, from GNU gettext.
6195 2004-01-23 Paul Eggert <eggert@twinsun.com>
6197 Exit-status fix from coreutils.
6199 Use exit_failure consistently in place of EXIT_FAILURE,
6200 so that program exit statuses are consistent on failure.
6202 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6203 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6204 * argmatch.h: Comment fix to match the above.
6205 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6206 Now a macro referring to exit_failure, instead of a separate
6207 variable. Include "exitfail.h" to get it.
6208 * xstrtol.h: Include "exitfail.h".
6209 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6211 * long-options.c (parse_long_options): Use prototype
6212 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
6215 2004-01-21 Jim Meyering <jim@meyering.net>
6217 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6218 so as not to conflict with a different-sized __mktime_internal
6219 function in GNU libc.
6220 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6221 Problem building statically-linked `ls' reported by Michael Brunnbauer.
6223 2004-01-18 Paul Eggert <eggert@twinsun.com>
6225 Merge from diffutils.
6227 * file-type.c (file_type): Add typed memory objects.
6228 * file-type.h (S_TYPEISTMO): New macro.
6230 * c-stack.h (c_stack_action): Remove argv argument.
6231 * c-stack.c (c_stack_action): Likewise. All uses changed.
6232 (die): Don't calculate message unless segv_action returns.
6233 (get_stack_location, min_address_from_argv, max_address_from_argv,
6234 volatile stack_base, volatile_stack_size): Remove.
6235 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6236 that every segmentation violation is a stack overflow. (Ouch!)
6237 See Debian bug 136249 (still outstanding) for more info about why
6238 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6240 2003-11-30 Bruno Haible <bruno@clisp.org>
6242 Safer stack allocation.
6243 * setenv.c: Include allocsa.h.
6244 (alloca): Remove fallback definition.
6245 (freea): Remove macro.
6246 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6249 2003-10-17 Bruno Haible <bruno@clisp.org>
6251 * binary-io.h: Avoid warnings on Cygwin.
6253 2003-12-28 Bruno Haible <bruno@clisp.org>
6255 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6256 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6258 2003-11-28 Bruno Haible <bruno@clisp.org>
6260 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6262 2003-11-27 Bruno Haible <bruno@clisp.org>
6264 * wait-process.c: On Windows, include windows.h. Needed on mingw.
6266 2003-11-17 Bruno Haible <bruno@clisp.org>
6268 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6270 2003-11-24 Bruno Haible <bruno@clisp.org>
6272 * xallocsa.h: New file, from GNU gettext.
6273 * xallocsa.c: New file, from GNU gettext.
6275 2003-11-24 Bruno Haible <bruno@clisp.org>
6277 * allocsa.h: New file, from GNU gettext.
6278 * allocsa.c: New file, from GNU gettext.
6280 2003-11-24 Bruno Haible <bruno@clisp.org>
6282 * eealloc.h: New file.
6284 2004-01-15 Jim Meyering <jim@meyering.net>
6286 Merge from coreutils.
6288 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
6289 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
6290 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6292 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6293 optional configure-time default.
6295 * version-etc.c (version_etc_copyright): Update copyright date.
6297 * xreadlink.c (xreadlink): Correct outdated comment.
6299 2004-01-15 Paul Eggert <eggert@twinsun.com>
6301 Merge from coreutils.
6303 * posixver.c: Include posixver.h.
6305 * same.c: Include <stdbool.h>, <limits.h>.
6306 (_POSIX_NAME_MAX): Define if not defined.
6308 (same_name): If file names are silently truncated, report
6309 that the file names are the same if they are the same after
6310 the silent truncation.
6312 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6313 conversion function.
6314 * xstrtod.c (xstrtod): Likewise. All callers changed to
6315 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
6318 2004-01-14 Paul Eggert <eggert@twinsun.com>
6320 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6321 with like-named macro in fnmatch.c.
6322 (EXT): Use an internal constant instead.
6324 Merge fnmatch patches from glibc.
6325 * fnmatch.c (mbsinit): Remove define.
6326 Add libc_hidden_ver (__fnmatch, fnmatch).
6327 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6328 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6330 2003-12-14 Karl Berry <karl@gnu.org>
6332 * config.charset: update from gettext-runtime.
6334 2003-12-03 Paul Eggert <eggert@twinsun.com>
6336 * getgroups.c (getgroups): xmalloc takes one argument, not two.
6337 Bug reported by Alfred M. Szmidt.
6339 2003-11-29 Karl Berry <karl@gnu.org>
6341 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6343 2003-11-23 Paul Eggert <eggert@twinsun.com>
6344 Bruno Haible <bruno@clisp.org>
6346 * printf-parse.h: Don't include sys/types.h.
6347 (ARG_NONE): New macro.
6348 (char_directive): Change type of *arg_index fields to size_t.
6349 * printf-parse.c: Don't include sys/types.h.
6350 (SSIZE_MAX): Remove macro.
6351 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6352 Remove unnecessary overflow check.
6353 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6356 2003-11-24 Paul Eggert <eggert@twinsun.com>
6358 * alloca.c: Remove dependency on xalloc module.
6359 (xalloc_die): Remove.
6360 (memory_full) [!defined emacs]: New macro.
6361 [!defined emacs]: Don't include xalloc.h.
6362 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6363 address arithmetic overflows. Change datatypes a bit to avoid
6366 2003-11-22 Jim Meyering <jim@meyering.net>
6368 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6370 2003-11-17 Bruno Haible <bruno@clisp.org>
6372 * vasnprintf.c (alloca): Remove fallback definition.
6373 (freea): Remove definition.
6374 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6375 Reported by Paul Eggert.
6377 2003-11-17 Jim Meyering <jim@meyering.net>
6379 On systems without utime and without a utimes function capable of
6380 dealing with a NULL struct utimbuf* argument, this utime replacement
6381 could -- in unusual circumstances -- leak a file descriptor.
6382 * utime.c: Include <unistd.h> and <errno.h>.
6383 (utime_null): Be sure to close `fd' and to preserve errno.
6384 Reported by Geoff Collyer via Arnold Robbins.
6386 2003-11-16 Paul Eggert <eggert@twinsun.com>
6387 Bruno Haible <bruno@clisp.org>
6389 Protect against address arithmetic overflow.
6390 * printf-args.h: Include stddef.h.
6391 (arguments): Change type of field 'count' to size_t.
6392 * printf-args.c (printf_fetchargs): Use size_t instead of
6393 'unsigned int' where appropriate.
6394 * printf-parse.h: Include sys/types.h.
6395 (char_directive): Change type of *arg_index fields to ssize_t.
6396 (char_directives): Change type of fields 'count', max_*_length to
6398 * printf-parse.c: Include sys/types.h and xsize.h.
6399 (SSIZE_MAX): Define fallback value.
6400 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6401 instead of 'int' where appropriate. Check a_allocated, d_allocated
6402 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6403 * vasnprintf.c: Include xsize.h.
6404 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6405 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6406 overflow. Avoid wraparound when converting a width or precision from
6409 2003-11-16 Bruno Haible <bruno@clisp.org>
6411 Update from GNU gettext.
6412 * printf-parse.c: Generalize to it can be compiled for wide strings.
6413 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6414 * vasnprintf.c: Generalize to it can be compiled for wide strings.
6415 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6416 SNPRINTF): New macros.
6417 Don't include <alloca.h> if the file is used inside libintl.
6418 (local_wcslen): New function, for Solaris 2.5.1.
6419 (VASNPRINTF): Use it instead of wcslen.
6421 2003-11-16 Bruno Haible <bruno@clisp.org>
6423 * xsize.h (xmax): New function.
6424 (xsum, xsum3, xsum4): Declare as "pure" functions.
6426 2003-11-12 Paul Eggert <eggert@twinsun.com>
6428 * xalloc.h: Do not include <limits.h> or <stdint.h>.
6429 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6430 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
6431 heuristic is just as accurate as far as we know, and it removes a
6432 dependency on size_max.m4 and ptrdiff_max.m4.
6434 2003-11-12 Paul Eggert <eggert@twinsun.com>
6436 * xstrtol.c (__xstrtol): Remove "break" immediately after
6437 "return", to pacify some unknown compiler. Problem reported
6440 2003-11-11 Bruno Haible <bruno@clisp.org>
6442 * xsize.h (SIZE_MAX): Remove fallback definition.
6443 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6446 2003-11-10 Paul Eggert <eggert@twinsun.com>
6448 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6449 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6450 rejected some allocations of exactly SIZE_MAX - 2 bytes.
6452 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6453 not (size_t) -1, since it's defined here.
6455 2003-11-06 Paul Eggert <eggert@twinsun.com>
6457 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6458 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6459 Reject sizes of exactly SIZE_MAX bytes.
6460 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6461 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6463 2003-11-05 Bruno Haible <bruno@clisp.org>
6465 * xsize.h: Include limits.h, to avoid a possible collision with
6466 SIZE_MAX defined in <limits.h> on Solaris.
6468 2003-11-04 Bruno Haible <bruno@clisp.org>
6470 * xsize.h: New file.
6471 * linebreak.c: Include xsize.h.
6472 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6473 argument for overflow.
6474 Suggested by Paul Eggert.
6476 2003-10-31 Bruno Haible <bruno@clisp.org>
6478 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6479 to avoid (extremely rare) race condition.
6480 Suggested by Paul Eggert.
6482 2003-11-03 Jim Meyering <jim@meyering.net>
6484 * userspec.c: Include "userspec.h".
6485 * userspec.h: New file.
6487 2003-10-31 Paul Eggert <eggert@twinsun.com>
6489 * mountlist.h (struct mount_entry.me_type_malloced): New member.
6490 * mountlist.c (SIZE_MAX): Define if not defined already.
6491 (read_filesystem_list): Set and use me_type_malloced.
6492 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6493 whatever the type happens to be), for brevity and consistency.
6494 Check for size calculation overflow on Alphas running OSF/1.
6496 2003-10-31 Jim Meyering <jim@meyering.net>
6498 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6500 * linebuffer.c: Include <string.h> for declaration of memset.
6502 2003-10-30 Paul Eggert <eggert@twinsun.com>
6503 Bruno Haible <bruno@clisp.org>
6505 * vasprintf.c: Include <limits.h>, <stdlib.h>.
6506 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6508 2003-10-29 Paul Eggert <eggert@twinsun.com>
6510 * xalloc.h (xalloc_oversized): Now a macro, not a function,
6511 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
6513 * quotearg.c (quotearg_n_options): Use it.
6514 * group-member.c: Include <stdbool.h>.
6515 (free_group_info): Arg is now const *; don't free arg.
6516 (get_group_info): Now returns bool and accepts struct group_info *,
6517 rather than returning a malloc'ed struct group_info *.
6518 All uses changed. Check for overflow in internal size calculation.
6520 * getusershell.c (readname): Simplify the code by using x2nrealloc
6521 rather than xmalloc/xrealloc.
6522 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6523 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6524 conformance bug: the old code used a pointer after freeing the
6525 storage that it addressed.
6526 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6527 rather than doing it by hand.
6528 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6529 the buffer preserved. Use free and xmalloc instead.
6530 * quotearg.c (quotearg_n_options): Likewise.
6531 Use a simpler test for size overflow. Don't use xalloc_oversized
6532 because unsigned int might be wider than size_t (!); this suggests
6533 that we should switch from unsigned int to size_t for slot numbers.
6535 2003-10-27 Bruno Haible <bruno@clisp.org>
6537 * stdbool_.h: Better support for BeOS.
6539 2003-10-27 Paul Eggert <eggert@twinsun.com>
6541 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6542 to allocate the returned structure. Do not allocate a subarray,
6543 as x2nrealloc will do that.
6544 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6545 instead of xnrealloc.
6546 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6548 2003-10-26 Paul Eggert <eggert@twinsun.com>
6550 * xalloc.h (xalloc_oversized): New static inline function, for
6551 callers that want to do their own size-overflow checking. Include
6552 <stdbool.h>, since xalloc_oversized returns bool.
6553 * xalloc.c (array_size_overflow): Remove. All callers changed
6554 to use xalloc_oversized.
6556 Add two functions x2realloc, x2nrealloc, for programs that grow
6557 arrays dynamically by doubling their sizes.
6558 * xalloc.h (x2realloc, x2nrealloc): New decls.
6559 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6562 Port to C99 semantics for 'inline' of external functions.
6563 Bug reported by Bruno Haible.
6564 * xmalloc.c (xnmalloc_inline): New static inline function,
6565 with the old contents of xnmalloc.
6566 (xnmalloc, xmalloc): Use it.
6567 (xnrealloc_inline): New static inline function,
6568 with the old contents of xnrealloc.
6569 (xnrealloc, xrealloc): Use it.
6571 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6573 2003-10-25 Paul Eggert <eggert@twinsun.com>
6575 Fix several address-calculation bugs in the hash modules,
6576 plus some minor code cleanup.
6578 * hash.h: Include <stdbool.h>, for bool.
6579 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6580 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6581 hash_get_n_entries, hash_get_max_bucket_length,
6582 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6583 hash_rehash): Use size_t rather than unsigned.
6584 * hash.c (struct hash_table, hash_get_n_buckets,
6585 hash_get_n_buckets_used, hash_get_n_entries,
6586 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6587 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6588 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6590 (SIZE_MAX): Define if not defined.
6591 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6592 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6594 Use const * when possible.
6595 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6596 (check_tuning): Fix bug: if tuning parameters were very close to
6597 0 or 1, rounding errors could have caused subscript violations.
6598 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6599 (hash_initialize): Add 'fail:' label
6600 to free table and return NULL, and use it to simplify code.
6601 Use calloc rather than clearing the storage ourself.
6602 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6603 buffer size calculations.
6604 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6605 Include <stddef.h>, for size_t.
6606 * hash-pjw.c (hash_pjw): Likewise.
6607 Switch to method described by Bruno Haible.
6608 Include <limits.h>, for CHAR_BIT.
6609 (SIZE_BITS): New macro.
6611 2003-10-21 Paul Eggert <eggert@twinsun.com>
6613 * getndelim2.c (getndelim2): When size calculation overflows,
6614 ceiling the allocation at NMAX bytes rather than silently
6615 discarding input bytes before NMAX is reached. This makes
6616 a difference only if NMAX exceeds SIZE_MAX / 2.
6618 * obstack.c: Merge from glibc.
6619 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6620 Add libc_hidden_def (_obstack_newchunk).
6621 (_obstack_free) [! defined _LIBC]: Remove.
6622 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6623 a clone of the function body.
6624 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6625 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6627 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6628 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6631 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6632 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6633 Don't use lvalue casts, as GCC plans to remove support for them
6634 in GCC 3.5. Reported by Joseph S. Myers. This bug
6635 was also present in the non-GCC version, indicating that this
6636 code had always been buggy and had never been widely used.
6637 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6638 Use the fast variant of each macro, rather than copying the
6639 definiens of the fast variant; that way, we'll be more likely to
6640 catch future bugs in the fast variants.
6642 2003-10-20 Bruno Haible <bruno@clisp.org>
6644 * wait-process.h: New file, from GNU gettext.
6645 * wait-process.c: New file, from GNU gettext.
6647 2003-10-19 Jim Meyering <jim@meyering.net>
6649 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6651 2003-10-16 Paul Eggert <eggert@twinsun.com>
6653 * getgroups.c: Include <errno.h>, <stdlib.h>.
6654 (getgroups): First arg is int, not size_t.
6655 Don't let 'free' mangle errno.
6657 2003-10-16 Jim Meyering <jim@meyering.net>
6659 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6661 2003-10-15 Paul Eggert <eggert@twinsun.com>
6663 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6665 (new_exclude, add_exclude_file): Initial size no longer needs to
6667 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6668 our own address arithmetic overflow checking.
6670 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6671 (fnmatch): Do not alloca more than 2000 wide characters;
6672 instead, use malloc for large buffers.
6673 Check for address arithmetic overflow, and return -1
6674 with errno set to ENOMEM in that case.
6675 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6676 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6677 instead, return -1. Check for address arithmetic overflow.
6679 2003-10-14 Paul Eggert <eggert@twinsun.com>
6681 Handle invalid suffixes and overflow independently, so that
6682 callers can treat them independently as needed. Fix some bugs in
6683 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6684 suffix for a human-readable blocksize. The major caller-visible
6685 change is the addition of a new
6686 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6687 that both overflow and suffix chars were found.
6689 * human.c (humblock): Don't check separately for invalid suffix
6690 char; that is xstrtoumax's job (now that its bug is fixed).
6691 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6692 INTMAX_MAX]: New macros.
6693 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6694 TYPE_MAXIMUM): New macros.
6695 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6696 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6697 if overflow occurs, as it's what __strtol does and it's more useful
6699 (__xstrtol): If __strtol reports some error other than ERANGE,
6700 reflect it to the caller as LONGINT_INVALID. If it reports
6701 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6702 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6703 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6705 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6706 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6707 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6708 [defined UINTMAX_MAX]: New macros.
6710 2003-10-14 Bruno Haible <bruno@clisp.org>
6712 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6713 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6714 Also use volatile where needed.
6716 2003-10-12 Paul Eggert <eggert@twinsun.com>
6718 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6719 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6720 and define in terms of the other primitives.
6721 * xmalloc.c: Include stdbool.h; do not include exit.h.
6722 (SIZE_MAX): Define if not already defined.
6723 (array_size_overflow): New function.
6724 (xalloc_die): Abort instead of exiting if 'error' returns.
6725 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6726 (xmalloc, xrealloc): Use them.
6727 (xcalloc): Check for address arithmetic overflow.
6728 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6729 a bit faster than strcpy.
6731 2003-10-08 Paul Eggert <eggert@twinsun.com>
6733 Merge getpass from libc, plus a few fixes.
6735 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6736 Include <stdbool.h>.
6737 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6738 __fsetlocking to empty.
6739 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6740 do include <bits/libc-lock.h>.
6741 Do not include <fcntl.h>; not needed.
6742 [_LIBC]: Include <wchar.h>.
6743 (NOTCANCEL_MODE): New macro.
6744 (flockfile, funlockfile) [_LIBC]: New macros.
6745 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6746 [!_LIBC]: New macros.
6747 (call_fclose): New function.
6748 (getpass): Use it. Save tty stream separately; this simplifies the
6749 code and makes it more reliable if stdin happens to equal stdout.
6750 Invoke __fsetlocking on tty.
6751 Handle thread cancellation if needed.
6752 Namespace cleanup (use __tcgetattr, __getline).
6753 Use bool for Booleans.
6754 [USE_IN_LIBIO]: Handle wide streams.
6755 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6756 stream might go where.
6758 * unlocked-io.h: Include <stdio.h>, so that the caller
6759 doesn't have to include <stdio.h> before us.
6760 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6761 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6762 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6763 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6764 if not declared, so that we can use getpass.c code from libc without
6766 (flockfile, ftrylockfile, funlockfile): New macros.
6768 2003-10-06 Bruno Haible <bruno@clisp.org>
6770 * version-etc-2.h: Remove file.
6771 * version-etc-2.c: Remove file.
6773 2003-09-25 Jim Meyering <jim@meyering.net>
6774 Bruno Haible <bruno@clisp.org>
6776 This lets translators provide better translations for the
6777 "Written by ..." part of --version output.
6778 * version-etc.h: Include stdarg.h.
6779 (version_etc_copyright): Declare as readonly.
6780 (version_etc): Make this function variadic with a NULL-terminated list
6781 of author name strings.
6782 (version_etc_va): New declaration.
6783 * version-etc.c: Include stdarg.h, stdlib.h.
6784 (version_etc_copyright): Declare as readonly.
6785 (version_etc_va): New function. Provide a different translatable string
6786 for each possible number of authors < 10. Abbreviate when there are 10
6788 (version_etc): Make this function variadic. Call version_etc_va.
6789 Suggestion from Gary V. Vaughan.
6791 * long-options.h (parse_long_options): Change prototype: the authors
6792 string is moved to the end and becomes variadic.
6793 * long-options.c: Include stdarg.h.
6794 (parse_long_options): Make this function variadic, too.
6795 Call version_etc_va, not version_etc.
6797 2003-10-06 Bruno Haible <bruno@clisp.org>
6799 * fatal-signal.h: New file, from GNU gettext.
6800 * fatal-signal.c: New file, from GNU gettext.
6802 2003-10-04 Karl Berry <karl@gnu.org>
6804 * argp*: update from libc.
6806 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6808 * getpass.c (getpass): Use a no-op fseek when switching from input to
6809 output mode on the same stream.
6811 2003-09-29 Paul Eggert <eggert@twinsun.com>
6813 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6814 Fix arg typo in previous patch.
6816 2003-09-28 Jim Meyering <jim@meyering.net>
6818 * error.c: Correct cpp indentation.
6820 2003-09-27 Paul Eggert <eggert@twinsun.com>
6822 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6823 Omit the special code that used __typeof__, since we worry that
6824 it could be more trouble than it's worth. See:
6825 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6826 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6830 2003-09-26 Jim Meyering <jim@meyering.net>
6832 * error.c (error_tail): Move some declarations
6833 into inner scope where the local variables are used.
6835 2003-09-26 Bruno Haible <bruno@clisp.org>
6837 * stpncpy.h (gnu_stpncpy): New declaration.
6838 (stpncpy): Define as alias for gnu_stpncpy.
6839 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6841 2003-09-26 Paul Eggert <eggert@twinsun.com>
6843 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6844 (error_tail): Do not loop, reallocating temporary buffer, since
6845 the output cannot contain more wide characters than the input
6846 contains bytes, the size must be big enough already. This avoids
6847 one potential size overflow calculation. Check for size overflow
6848 when calculating temporary buffer size. Free temporary buffer
6849 when done, if it was allocated with malloc; this plugs a memory
6850 leak. Remove casts from void * to pointers, that are no longer
6851 needed now that we're assuming C89 or better.
6853 Merge error changes from glibc.
6855 * error.c, error.h: Update copyright notice header to match glibc.
6856 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6857 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6858 Disable cancellation while printing error.
6859 * error.h: Prepend __ to parameter names.
6861 2003-09-25 Karl Berry <karl@gnu.org>
6863 * argp-fmtstream.c, argp-help.c: update from libc.
6865 2003-09-25 Bruno Haible <bruno@clisp.org>
6867 * version-etc-2.h: New file, from version-etc.h with modifications.
6868 * version-etc-2.c: New file, from version-etc.c with modifications.
6870 2003-09-25 Simon Josefsson <jas@extundo.com>
6872 * xgetdomainname.h: New file.
6873 * xgetdomainname.c: New file.
6875 2003-09-25 Simon Josefsson <jas@extundo.com>
6876 Bruno Haible <bruno@clisp.org>
6878 * getdomainname.h: New file.
6879 * getdomainname.c: New file.
6881 2003-09-24 Paul Eggert <eggert@twinsun.com>
6883 * linebuffer.c (freebuffer): Don't free the argument, just
6884 the buffer associated with the argument. Bug reported by
6887 2003-09-19 Karl Berry <karl@gnu.org>
6889 * argp.h: update from libc.
6891 2003-09-16 Paul Eggert <eggert@twinsun.com>
6893 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6894 input error, instead of returning NULL the next time we are called
6895 (and therefore losing track of errno).
6897 2003-09-15 Paul Eggert <eggert@twinsun.com>
6899 * getndelim2.c (getndelim2): Don't trash errno when a read
6900 fails, so that the caller gets the proper errno.
6902 * readutmp.c (read_utmp): Likewise.
6903 Check for fstat error. Close stream and free storage
6906 2003-09-14 Bruno Haible <bruno@clisp.org>
6908 * fwriteerror.h: New file.
6909 * fwriteerror.c: New file.
6911 2003-09-14 Jim Meyering <jim@meyering.net>
6913 * getloadavg.c: Correct cpp indentation.
6914 * strdup.c: Likewise.
6915 * vasnprintf.c: Likewise.
6917 2003-09-12 Paul Eggert <eggert@twinsun.com>
6919 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6920 * obstack.c [!defined _LIBC]: Likewise.
6921 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6922 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6923 * exitfail.c: Don't include stdlib.h; no longer needed.
6925 More changes to assume C89 or better.
6927 * error.c (error_tail): Assume vprintf.
6929 * argmatch.c (getenv): Remove decl.
6930 * progreloc.c (get_full_program_name): Define via prototype.
6931 * setenv.c (clearenv): Likewise.
6932 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6934 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6935 (malloc, memcpy): Remove decls.
6936 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6937 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6938 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6939 (memcpy): Remove macro.
6940 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6941 (__P): Remove. All uses removed.
6942 (PTR): Remove. All uses changed to void *.
6943 (CHAR_BIT, NULL): Remove.
6944 (spaces, zeros, memset_space, memset_zero)
6945 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6947 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6948 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6949 Define with prototype.
6950 Remove now-unnecessary prototype decl.
6951 (extra_args_spec): Assume ANSI C. All uses changed.
6952 (extra_args_spec_iso): Remove.
6953 (my_strftime, emacs_strftimeu): Define via prototype.
6954 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6956 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6957 * strtoimax.c: Include <stdlib.h> unconditionally.
6958 (strtoul, strtol): Remove decls.
6959 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6961 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6962 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
6963 (LOCALE_PARAM_PROTO): New macro.
6964 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6965 (INTERNAL (strtol), strtol): Define with a prototype.
6966 (PARAMS): Remove. All uses removed.
6967 * tempname.c: Include <string.h> unconditionally.
6968 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6969 * xgethostname.c (main): Define with a prototype.
6970 * xmalloc.c: Include "xalloc.h" first, to check interface.
6971 Include <stdlib.h> unconditionally.
6972 (calloc, malloc, realloc, free): Remove decls.
6973 * xstrtod.c: Include "xstrtod.h" first, to check interface.
6974 Include <stdlib.h> unconditionally. Sort include file names.
6976 (xstrtod): Define with a prototype.
6977 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6978 (strtol, strtoul): Remove decls.
6980 2003-09-11 Paul Eggert <eggert@twinsun.com>
6982 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6983 Include <stdlib.h>, <string.h> unconditionally.
6984 Remove now-unnecessary cast to char *.
6985 * strnlen.c: Include <string.h> unconditionally.
6986 * yesno.c (yesno): Define with a prototype.
6988 2003-09-10 Bruno Haible <bruno@clisp.org>
6990 * strcspn.c: Include <string.h> unconditionally.
6991 * strpbrk.c: Include <string.h> unconditionally.
6992 * strstr.c: Include <string.h> unconditionally.
6993 * unicodeio.c: Include <string.h> unconditionally.
6994 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6995 * unsetenv.c: Likewise.
6996 * xreadlink.c: Include <stdlib.h> unconditionally.
6997 * yesno.c: Include <stdlib.h> unconditionally.
6998 (rpmatch): Add prototype.
7000 2003-09-10 Jim Meyering <jim@meyering.net>
7002 * error.c: Correct indentation of cpp directives.
7004 2003-09-09 Paul Eggert <eggert@twinsun.com>
7008 * acosl.c (main): Use a prototype.
7009 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
7012 * getloadavg.c (getloadavg, main): Define via prototypes.
7014 * getopt.h (struct option.name): Assume C89, and use 'const'.
7015 (getopt, etopt_long, getopt_long_only, _getopt_internal)
7016 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
7018 * getopt.c (const): Remove macro.
7019 Include <string.h> unconditionally.
7020 (my_index): Remove; all uses changed to strchr.
7021 (strlen): Remove decl.
7022 (exchange): Remove forward decl; no longer needed.
7023 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
7024 Define with prototype.
7025 * getopt1.c (const): Remove macro.
7026 (getopt_long, getopt_long_only, main): Define with prototype.
7028 * getugroups.c: Include <string.h> unconditionally.
7030 * getusershell.c: Include <stdlib.h> unconditionally.
7031 (getusershell, setusershell, endusershell, readname, main):
7032 Define with prototypes.
7034 * group-member.c: Include group-member.h first.
7035 Include <stdlib.h> unconditionally.
7037 * hard-locale.c: Include hard-locale.h first.
7038 Include <stdlib.h>, <string.h> unconditionally.
7040 * hash.c (free, malloc): Remove decls.
7041 Include <stdlib.h> unconditionally.
7043 * human.c: Include <stdlib.h>, <string.h> unconditionally.
7044 (getenv): Do not declare.
7046 * idcache.c: Include <string.h> unconditionally.
7048 * long-options.c: Include long-options.h first, to test interface.
7049 Include <stdlib.h> unconditionally.
7051 * makepath.c: Include makepath.h first, to test interface.
7052 Include <stdlib.h> and <string.h> unconditionally.
7054 * linebuffer.c: Include <stdlib.h>.
7055 (free): Remove decl.
7057 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
7058 rpl_malloc returns void *, not char *.
7059 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
7061 * md5.h: Include <limits.h> unconditionally.
7062 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
7063 (__P): Remove; all uses removed.
7064 * md5.c: Include "md5.h" first.
7065 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
7066 md5_buffer, md5_process_bytes, md5_process_block):
7067 Define with prototypes.
7068 * sha.h (__P): Remove all uses. (It wasn't defined??)
7069 * sha.c: Include "sha.h" first.
7070 Include <stdlib.h>, <string.h> unconditionally.
7072 * memchr.c (__ptr_t): Remove; all uses changed to void *.
7073 * memcmp.c (__ptr_t): Likewise.
7074 * memrchr.c (__ptr_t): Likewise.
7075 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7076 Include <string.h> unconditionally.
7077 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7078 * memchr.c: Include <stdlib.h> unconditionally.
7079 * memchr.c (LONG_MAX): Remove.
7080 * memrchr.c (LONG_MAX): Likewise.
7081 * memchr.c (__memchr): Define via a prototype.
7082 * memrchr.c (__memrchr): Likewise.
7083 * memcmp.c (__P): Remove, and remove all uses.
7084 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7085 Remove forward decls; no longer needed.
7086 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7087 Use types required by C89 in prototype.
7089 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7090 * savedir.c: Likewise.
7091 * mkdir.c (free): Remove decl.
7092 * rmdir.c (rmdir): Define with a prototype.
7093 * savedir.c: Include savedir.h first, to test interface.
7095 * mktime.c (STDC_HEADERS): Remove.
7096 Include <stdlib.h>, <string.h> unconditionally.
7098 * modechange.c: Include <stdlib.h> unconditionally.
7099 (malloc): Remove decl.
7101 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7102 (free): Remove decl.
7104 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7105 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7106 (This type really should be intptr_t, but that's a C99ism.)
7107 (_obstack_memcpy): Remove: all uses changed to memcpy.
7108 Include <string.h> unconditionally.
7109 (struct obstack): Assume __STDC__ for types of members
7110 chunkfun, freefun, extra_arg.
7111 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7112 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7113 obstack_begin, obstack_specify_allocation,
7114 obstack_specify_allocation_with_arg, obstack_chunkfun,
7115 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7116 Remove unprototyped decls and the macros that use them.
7117 * obstack.c (POINTER): Remove. All uses changed to void *.
7118 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7119 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7120 (defined __STDC__ && __STDC__)]:
7121 Remove nonprototyped code.
7122 Include <stdlib.h> unconditionally.
7123 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7124 _obstack_allocated_p, _obstack_free, obstack_free,
7125 _obstack_memory_used, print_and_abort):
7126 Define using prototypes.
7127 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7128 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7129 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7130 obstack_next_free, obstack_object_size, obstack_room) [0]:
7131 Remove unused, unprototyped code.
7133 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7135 * physmem.c (physmem_total, physmem_available, main): Define
7138 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7139 (main): Define with a prototype.
7141 * posixver.c (getenv): Remove decl.
7143 * putenv.c (malloc): Returns void *, not char *.
7144 Include <string.h> unconditionally.
7145 (strchr, memcpy, NULL): Do not define.
7147 * readtokens.c: Include readtokens.h first, to test interface.
7148 Include <stdlib.h>, <string.h> unconditionally.
7149 (init_tokenbuffer): Define with a prototype.
7151 * regex.c (PARAMS): Remove. All uses removed.
7152 All uses of _RE_ARGS removed, too.
7153 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7155 (bzero): Assume memset exists.
7156 (memcmp, memcpy, NULL): Remove.
7157 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7158 char, or assignments to local vars of type signed char.
7159 (init_syntax_once, PREFIX(extract_number_and_incr),
7160 PREFIX(print_partial_compiled_pattern),
7161 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7162 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7163 PREFIX(regex_grow_registers), PREFIX(regex_compile),
7164 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7165 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7166 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7167 wcs_compile_range, byte_compile_range, truncate_wchar,
7168 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7169 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7170 count_mbs_length, wcs_re_match_2_internal,
7171 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7172 PREFIX(alt_match_null_string_p),
7173 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7174 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7175 regfree, PREFIX(extract_number)): Define with prototype. Remove
7176 now-unnecessary declaration, if any.
7177 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7179 Remove now-unnecessary casts among pointer types.
7180 * regex.h (_RE_ARGS): Remove. All uses removed.
7182 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7183 (free): Remove decl.
7185 * rpmatch.c: Include <stdlib.h> unconditionally.
7187 * same.c: Include <stdlib.h>, <string.h> unconditionally.
7188 (free): Remove decl.
7190 * save-cwd.c: Include <stdlib.h> unconditionally.
7191 * xgetcwd.c: Likewise.
7193 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7194 (free): Remove decl.
7196 * strchrnul.c (strchrnul): Define with a prototype.
7197 Fix bug: c_in was not converted to char before searching.
7199 The following changes are not K&R related:
7201 * group-member.h: Include <sys/types.h>, so that this file is
7203 * makepath.h: Likewise.
7205 * getusershell.c (readname, default_index, line_size, readname):
7206 Use size_t, not int, for sizes.
7207 (readname): If the size overflows, report an error instead of
7210 2003-09-09 Derek Robert Price <derek@ximbiot.com>
7212 * getndelim2.c: Assume stdlib.h per the C89 spec.
7214 2003-09-08 Paul Eggert <eggert@twinsun.com>
7216 Assume C89 or better; remove K&R cruft.
7217 A few of these changes were first proposed by Derek Robert Price
7218 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7220 * addext.c: Include <string.h> unconditionally.
7221 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7222 Don't declare getenv or malloc.
7224 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7225 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7227 (find_stack_direction, alloca): Use prototypes.
7229 * atexit.c (atexit): Define using a prototype.
7231 * basename.c, dirname.c, stripslash.c:
7232 Include <string.h> unconditionally.
7234 * bcopy.c: Include <stddef.h>.
7235 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7237 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7239 * error.h (error, error_at_line, error_print_progname)
7240 [! (defined (__STDC__) && __STDC__)]: Remove decls.
7241 * error.c: Include error.h first, to check interface.
7242 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7243 (VA_START): Remove; all uses changeed to va_start.
7244 (exit, strerror): Remove decls.
7245 (error_print_progname): Prototype uncondionally.
7246 Don't include <errno.h>; no longer needed.
7247 (private_strerror): Remove.
7248 (error_tail): Always define.
7249 (error, error_at_line): Assume C89 or better; always use prototypes.
7250 * fatal.c: Include "fatal.h" first, to test interface.
7251 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7252 (VA_START): Remove; all uses changed to va_start.
7253 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7255 (exit): Remove decl.
7256 (fatal): Prototype unconditionally. Assume va_start works.
7257 Abort at end, to pacify gcc.
7259 * euidaccess.c (main): Define with a prototype.
7261 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7263 * exitfail.c: Include <stdlib.h> unconditionally.
7265 * fnmatch_.h (__P): Remove. All uses changed to assume
7267 * fnmatch.c: Include fnmatch.h first, to test interface.
7268 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7269 (getenv): Remove decl.
7270 (fnmatch): Define using a prototype.
7271 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7272 (FCT): Define using a prototype.
7274 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7276 * gethostname.c: Include <stddef.h>.
7277 (gethostname): Define with prototype. Length is size_t, not int.
7279 2003-09-08 Paul Eggert <eggert@twinsun.com>
7281 * getversion.c: Remove; was migrated to backupfile.c in 1997.
7282 getversion.c should have been removed then, but was accidentally
7285 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7286 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7288 2003-09-07 Paul Eggert <eggert@twinsun.com>
7290 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7291 copy_tm_result. Bug reported by Simon Josefsson in
7292 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7294 2003-09-06 Paul Eggert <eggert@twinsun.com>
7296 * time_r.c, time_r.h: New files.
7298 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7300 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
7301 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7303 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7305 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7306 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7309 * timegm.c: Switch to glibc implementation, with the following changes:
7310 [defined HAVE_CONFIG_H]: Include <config.h>.
7311 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7312 (__mktime_internal) [!defined _LIBC]: New decl.
7313 (__gmtime_r) [!defined _LIBC]: New macro and function.
7314 (timegm): Use a prototype, since gnulib assumes C89.
7315 Do not bother declaring tmp to be const, as it's not really usefu.
7316 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7317 (timegm): Declare only if HAVE_DECL_TIMEGM.
7319 2003-09-03 Paul Eggert <eggert@twinsun.com>
7321 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7322 Bug reported by Lute Kamstra in
7323 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7325 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7326 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
7327 course with correspondingly smaller numbers for tomorrow and
7328 yesterday. From Tadayoshi Funaba. Originally installed into
7329 sh-utils on 1999-08-07, but the patch got lost (I guess during the
7332 2003-08-31 Simon Josefsson <jas@extundo.com>
7334 * timegm.h: New file.
7335 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
7337 2003-08-31 Karl Berry <karl@gnu.org>
7339 * argp.h: update from libc.
7341 2003-08-28 Bruno Haible <bruno@clisp.org>
7343 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7344 warning on QNX, which defines O_BINARY to 000000.
7346 2003-08-24 Bruno Haible <bruno@clisp.org>
7348 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7349 MSVC7 <stdio.h> is included later.
7351 2003-08-20 Bruno Haible <bruno@clisp.org>
7353 * progname.h: New file, from GNU gettext.
7354 * progname.c: New file, from GNU gettext.
7355 * progreloc.c: New file, from GNU gettext.
7357 2003-08-19 Bruno Haible <bruno@clisp.org>
7359 * xstrdup.c: Assume <string.h> exists.
7361 2003-08-18 Jim Meyering <jim@meyering.net>
7363 * setenv.h: Indent nested cpp directive.
7364 * vasnprintf.c: Remove trailing blanks.
7366 2003-08-17 Simon Josefsson <jas@extundo.com>
7367 Bruno Haible <bruno@clisp.org>
7369 * xstrndup.h: New file.
7370 * xstrndup.c: New file.
7372 2003-08-17 Bruno Haible <bruno@clisp.org>
7374 * strndup.h: New file.
7376 2003-08-16 Paul Eggert <eggert@twinsun.com>
7378 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7379 space, undoing this 2003-08-12 change:
7380 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7382 2003-08-16 Jim Meyering <jim@meyering.net>
7384 Merge from coreutils.
7385 * xstrtoimax.c: #else #if -> #elif.
7386 * xstrtoumax.c: Likewise.
7388 2003-08-15 Paul Eggert <eggert@twinsun.com>
7390 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7391 rather than tab, after '#' in shell-script copyright notices.
7392 Suggested by Bruno Haible.
7394 2003-08-15 Jim Meyering <jim@meyering.net>
7395 and Paul Eggert <eggert@twinsun.com>
7397 Merge from coreutils.
7398 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7399 member but strut utmpx does not. Needed for AIX 4.3.3.
7400 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7402 2003-08-15 Jim Meyering <jim@meyering.net>
7404 Merge from coreutils.
7405 * xgethostname.c: Include <stdlib.h>.
7406 (xghostname): Don't exit for anything other than memory-related
7407 failure; just return NULL.
7408 * userspec.c: Include "posixver.h".
7409 (parse_user_spec): Accept `.' as a separator only
7410 in pre-POSIX-200112 mode.
7411 * strtoimax.c: Use #elif rather than #else #if.
7412 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7413 Remove function, now that we can rely on a working tzset function.
7414 [!_LIBC]: Ensure that the required autoconf test has been run.
7415 [!defined _NL_CURRENT && HAVE_STRFTIME]:
7416 Use underlying_strftime for %r.
7417 * sha.c: Merge in some clean-up and optimization changes from glibc.
7418 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7419 Ensure that it is a multiple of 64.
7420 Rearrange loop exit tests so as to avoid performing an
7421 additional fread after encountering an error or EOF.
7422 * realloc.c: Update copyright date.
7424 2003-08-14 Jim Meyering <jim@meyering.net>
7426 Merge from coreutils.
7427 * obstack.h: Whitespace changes.
7428 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7429 and xcalloc return values.
7430 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7431 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
7432 hang on OSF/1 5.1 for DIR on both local and remote file systems.
7433 Reported by (and fix confirmed by) Nelson H. F. Beebe.
7434 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7436 Use mntctl's return value to drive the entry-processing loop, since
7437 we can't rely on the value of the vmt_length member in the last
7438 entry. On some systems doing so could result in exhausting
7439 virtual memory. Based in part on a patch from Mike Jetzer.
7441 2003-08-14 Jim Meyering <jim@meyering.net>
7442 and Paul Eggert <eggert@twinsun.com>
7444 Merges from coreutils, plus other fixes.
7445 * physmem.c: Merge in portability changes from gcc/libiberty
7446 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
7447 for credits and details. Thanks to Kaveh Ghazi for helping
7448 to keep these files in sync.
7449 (ARRAY_SIZE): Define it.
7450 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7451 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7452 (memcasecmp): Don't assume size_t fits in unsigned int.
7453 Remove casts and duplicate code.
7454 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7455 (memcpy): Remove definition.
7456 Merge in some clean-up and optimization changes from glibc.
7457 [BLOCKSIZE]: Move definition to top of file.
7458 Ensure that it is a multiple of 64.
7459 Rearrange loop exit tests so as to avoid performing an
7460 additional fread after encountering an error or EOF.
7461 * md5.h (md5_uintptr): Define.
7462 * makepath.c (CLEANUP_CWD): Report an error if we failed to
7463 return to the initial working directory. Preserve errno
7465 * idcache.c: Include "xalloc.h".
7466 (xmalloc, xrealloc): Remove decls.
7467 (getuser): Remove casts no longer required in C89.
7468 * human.c: Include stdio.h, for sprintf.
7469 * group-member.c: Include "xalloc.h".
7470 (xmalloc, xrealloc): Remove decls.
7471 (get_group_info): Remove casts no longer required in C89.
7472 * getusershell.c (readname): Remove casts no longer required in C89.
7473 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7474 * getline.c: Whitespace fix, from coreutils.
7476 2003-08-13 Paul Eggert <eggert@twinsun.com>
7478 * exclude.c: Include <ctype.h>
7479 (IN_CTYPE_DOMAIN): New macro.
7481 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7484 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7485 Undo previous (whitespace-only) change.
7487 2003-08-12 Paul Eggert <eggert@twinsun.com>
7489 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7490 Normalize leading white space and remove trailing white space.
7491 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7492 notice, as per ../config/srclist-update.
7494 Merge from coreutils.
7495 * euidaccess.h: New file.
7496 * euidaccess.c: Include it.
7497 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7498 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
7499 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7501 2003-08-11 Bruno Haible <bruno@clisp.org>
7503 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7504 (vasnprintf): Use it instead of wcslen.
7506 2003-08-11 Bruno Haible <bruno@clisp.org>
7508 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7509 value to ensure that _Bool promotes to int. Use #define for _Bool when
7510 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7512 2003-08-10 Karl Berry <karl@gnu.org>
7514 * regex.h: update from libc (whitespace fix).
7516 2003-08-09 Paul Eggert <eggert@twinsun.com>
7518 Merge some files from coreutils. These changes were
7519 originally made by Jim Meyering.
7520 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7521 many older Unixes require this.
7522 * alloca.c (alloca): Remove cast to argument of free;
7523 no longer needed in C89.
7524 * alloca_.h, regex.h: Fix white space to match
7525 what GNU indent does.
7527 2003-08-05 Paul Eggert <eggert@twinsun.com>
7529 * bumpalloc.h: Remove.
7531 2003-08-04 Paul Eggert <eggert@twinsun.com>
7533 * getloadavg.c: Change copyright notice and spacing to conform to
7536 Merge from coreutils.
7537 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7539 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7540 from Karl Berry, implemented by Jim Meyering.
7541 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7542 from Dmitry V. Levin.
7543 Remove anachronistic cast of xrealloc.
7544 * fnmatch_.h (__const): Remove. Use 'const'.
7545 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7546 type. Otherwise, it wouldn't compile with at least /bin/cc on
7547 ymp-cray-unicos9.0.2.X.
7548 Combine two mostly-identical uses of alloca into one.
7549 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7551 2003-08-04 Dave Love <d.love@dl.ac.uk>
7555 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7556 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7557 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7558 obsolete NLIST_NAME_UNION.
7559 [__GNU__]: Undef BSD and FSCALE.
7560 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7562 2003-08-03 Paul Eggert <eggert@twinsun.com>
7564 * stdbool_.h (_Bool): Make it signed char, instead of
7565 an enum type, so that it's guaranteed to promote to int. See:
7566 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7568 2003-07-31 Paul Eggert <eggert@twinsun.com>
7570 * strerror.c: Include config.h, limits.h. Declare sprintf.
7571 (strerror): Don't assume that a printable int fits in 14 bytes.
7573 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7574 Bruno Haible <bruno@clisp.org>
7576 * getline.h (getline, getdelim): Change return type to ssize_t.
7577 * getline.c (getline, getdelim): Likewise.
7578 Remove _GNU_SOURCE define; now it's defined in config.h through
7581 2003-07-22 Paul Eggert <eggert@twinsun.com>
7583 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7584 over-parenthesization in macros.
7586 Sync with coreutils.
7588 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7591 Use `exit_failure' for xalloc and xmemcoll instead of their own
7592 private exit-failure variables.
7593 * xalloc.h (xalloc_exit_failure): Remove.
7594 * xmalloc.c: Likewise. Include exitfail.h.
7595 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7596 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7597 * xmemcoll.c: Likewise. Include exitfail.h.
7598 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7600 2003-07-18 Paul Eggert <eggert@twinsun.com>
7602 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7603 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7604 to test that it can stand by itself. Include "exitfail.h".
7605 Clients should set exit_failure instead.
7606 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7608 2003-07-18 Andreas Schwab <schwab@suse.de>
7610 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7612 2003-07-18 Bruno Haible <bruno@clisp.org>
7614 * getndelim2.h: New file.
7615 * getndelim2.c: Make into a module of its own. Include config.h,
7617 (getndelim2): Make non-static. Change return type to ssize_t.
7618 * getline.h: Change argument names.
7619 * getline.c: Include getndelim2.h instead of getndelim2.c.
7620 * getnline.c: Include getndelim2.h.
7622 2003-07-17 Bruno Haible <bruno@clisp.org>
7624 * Makefile.am: Remove file.
7625 * Makefile.in: Remove file.
7627 2003-07-17 Bruno Haible <bruno@clisp.org>
7629 * getnline.h: New file.
7630 * getnline.c: New file.
7631 * getndelim2.c: New file, extracted from getline.c.
7632 (getndelim2): Renamed from getdelim2, with added nmax argument.
7633 * getline.c: Include getndelim2.c.
7634 (getdelim2): Moved out to getndelim2.c.
7635 (getline, getdelim): Update.
7637 2003-07-15 <karl@gnu.org>
7639 * vasnprintf.c: update from gettext.
7641 2003-07-15 Jim Meyering <jim@meyering.net>
7643 * makepath.c (make_path): Enclose diagnostic in _(...).
7645 2003-07-14 Paul Eggert <eggert@twinsun.com>
7647 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7648 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7649 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7650 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7651 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7652 updated automatically by ../config/srclist-update. This changes
7653 their license from LPGL to GPL.
7655 2003-07-14 Jim Meyering <jim@meyering.net>
7657 Don't emit diagnostics. Let callers do that.
7658 * save-cwd.c: Don't include "error.h".
7659 (save_cwd): Don't call error. Ensure that errno is valid
7660 when returning nonzero.
7662 * save-cwd.h (restore_cwd): Update prototype.
7663 * save-cwd.c (restore_cwd): Remove two parameters.
7664 Simplify. Don't call error upon failure. Let callers do that.
7665 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7666 when auditing is enabled. But don't bother updating the #if.
7668 2003-07-14 Simon Josefsson <jas@extundo.com>
7670 * mempcpy.h: New file.
7671 * mempcpy.c: New file.
7673 2003-07-14 Paul Eggert <eggert@twinsun.com>
7675 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7676 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7677 unicodeio.c, unicodeio.h, unlocked-io.h:
7678 Switch from LGPL to GPL.
7680 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7682 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7683 it breaks C++ compilation.
7684 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7686 2003-07-10 Jim Meyering <jim@meyering.net>
7688 * vasnprintf.c: Remove trailing blanks.
7689 Make cpp indentation consistent.
7691 2003-07-09 Paul Eggert <eggert@twinsun.com>
7693 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7694 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7695 Switch from LGPL to GPL.
7697 2003-07-07 Paul Eggert <eggert@twinsun.com>
7699 * mktime.c: Fix some boundary cases and remove need for floating point.
7701 Issue a compile-time diagnostic if time_t is floating point, or if
7702 two's complement arithmetic is not in effect, or if arithmetic
7703 right shift does not propagate the sign. These assumptions were
7704 all in the original code but they weren't checked.
7706 (TIME_T_MIDPOINT, verify): New macros.
7707 (__isleap): Remove; it has integer overflow problems.
7708 (leapyear): New function, without those problems.
7709 (ydhms_tm_diff): Remove; splitting into two parts.
7710 (ydhms_diff): New function, containing the arithmetic part of
7711 the old ydhms_tm_diff function. Issue a compile-time
7712 diagnostic if we are not using C99 integer division.
7713 Avoid casts when possible.
7714 (guess_time_tm): New function, containing the checking part of
7715 the old ydhms_tm_diff function. Return the new value, rather than
7716 the difference between it and the old. Accept a new argument T
7717 so that *T specifies the old value. Check for overflow in the result.
7719 (__mktime_internal): Use a time_t offset, not a long int offset.
7720 This undoes the 2003-06-04 change, which is no longer needed now
7721 that we have better overflow checking.
7722 (localtime_offset): Likewise.
7724 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7725 and long are 64-bit but int is only 32-bit.
7726 (ydhms_diff): Use long int to store year1 and yday1.
7727 Issue a compile-time diagnostic if long int is not wide enough.
7729 (__mktime_internal): Use long int to store adjusted year and yday.
7730 Use plain C rather than preprocessor commands, if that doesn't
7732 Check for overflow (and try to repair) after each probe
7733 rather than checking only at the very end. This avoids some bugs
7734 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7735 does not equal GMT offset at maximum time).
7736 Use integer to check for overflow rather than floating point; this
7737 is more portable to non-IEEE hosts, and is a tad faster.
7738 When we detect that we are oscillating between two values,
7739 don't check whether tm_isdst has the requested value, since
7740 we already know the answer. When tm_isdst has the wrong value,
7741 use a different heuristic to find the right one, based on the
7742 extreme values actually observed in practice in tz2003a,
7743 rather than the (overly optimistic) "previous 3 calendar quarters".
7745 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7746 "T const" to accommodate glibc style.
7747 (check_result): Use less-confusing report format. "long" -> "long int.
7749 Don't loop if the iteration overflows time_t.
7750 Allow a negative step in the iteration.
7752 2003-07-01 Paul Eggert <eggert@twinsun.com>
7754 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7755 having it depend on HAVE_SYS_TYPES_H.
7757 2003-06-25 Bruno Haible <bruno@clisp.org>
7759 * readlink.c: New file.
7761 2003-06-20 Bruno Haible <bruno@clisp.org>
7763 Assume C89, so PARAMS isn't needed.
7764 * unicodeio.h (PARAMS): Remove.
7765 * unicodeio.c: Don't use PARAMS.
7767 2003-06-18 Jim Meyering <jim@meyering.net>
7769 Merge changes from coreutils.
7770 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7771 Remove explicit declarations of xmalloc and realloc.
7773 (read_utmp): Remove anachronistic cast of xmalloc.
7775 2003-06-17 Paul Eggert <eggert@twinsun.com>
7777 Assume C89, so PARAMS isn't needed.
7778 * backupfile.h (PARAMS): Remove. All uses removed.
7779 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7780 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7781 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7782 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7783 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7784 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7785 xstrtol.h: Likewise.
7786 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7787 same.h, strverscmp.h: Do not include config.h; no longer needed.
7788 Anyway, config.h should always be included before any other file.
7790 2003-06-11 Simon Josefsson <jas@extundo.com>
7792 * sysexit_.h: New file.
7794 2003-05-20 Derek Price <derek@ximbiot.com>
7796 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7798 2003-06-10 Simon Josefsson <jas@extundo.com>
7800 * strchrnul.h: New file.
7801 * strchrnul.c: New file.
7803 2003-06-10 Simon Josefsson <jas@extundo.com>
7805 * argp.h: New file, from glibc.
7806 * argp-ba.c: New file, from glibc.
7807 * argp-eexst.c: New file, from glibc.
7808 * argp-fmtstream.c: New file, from glibc.
7809 * argp-fmtstream.h: New file, from glibc.
7810 * argp-fs-xinl.c: New file, from glibc.
7811 * argp-help.c: New file, from glibc.
7812 * argp-namefrob.h: New file, from glibc.
7813 * argp-parse.c: New file, from glibc.
7814 * argp-pv.c: New file, from glibc.
7815 * argp-pvh.c: New file, from glibc.
7816 * argp-xinl.c: New file, from glibc.
7818 2003-06-07 Jim Meyering <jim@meyering.net>
7820 * readtokens.h: Put `Free Software Foundation, Inc.'
7821 in place of my name in the copyright comment.
7822 Remove definition and uses of __P.
7825 * stat.c: Don't declare xmalloc explicitly.
7826 Instead, include "xalloc.h".
7827 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7828 xrealloc, and xcalloc return values.
7829 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7831 * xgetcwd.h: Remove definition/uses of PARAMS.
7833 2003-06-06 Jim Meyering <jim@meyering.net>
7835 * stdbool_.h: Renamed from stdbool.h.in.
7837 2003-06-06 Jim Meyering <jim@meyering.net>
7839 Merge from coreutils.
7840 * same.c: (same_name): Declare *_basename locals to be `const'.
7841 Consolidate declarations and initializations of *_base* locals.
7843 Merge from coreutils.
7844 This avoids a core dump on systems without GNU putenv,
7845 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7846 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7847 (unsetenv): New static function, from GNU libc.
7848 (rpl_putenv): Use it.
7850 * modechange.c: Remove trailing blanks.
7852 Merge from coreutils.
7853 * fsusage.c: Remove declaration of statfs.
7854 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7856 * posixtm.c: Include <stdbool.h> unconditionally.
7858 2003-06-05 Paul Eggert <eggert@twinsun.com>
7860 * mktime.c (__mktime_internal): When resolving a tm_isdst
7861 mismatch, look in future quarters as well as past. This fixes a
7862 bug when processing fall-backwards gaps immediately after a long
7863 period of daylight-saving time.
7865 * mktime.c: Assume freestanding C89 or better.
7866 (HAVE_LIMITS_H): Remove. Assume it's 1.
7867 (__P): Remove; not used.
7868 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7869 (mktime, not_equal_tm, print_tm, check_result,
7870 main): Use prototypes. Use const * where appropriate.
7871 (main): Fix typo in testing code that uncovered by above changes.
7872 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7874 2003-06-04 Paul Eggert <eggert@twinsun.com>
7876 * mktime.c: Fix Debian bug 177940
7877 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7878 (localtime_offset): Now long int, not time_t, because we want it
7879 to be guaranteed to be signed. All uses changed.
7880 (__mktime_internal): If overflow would occur when adding offset,
7883 Merge 'human' changes from coreutils. Rewrite to support
7884 locale-specific notations like thousands separators.
7885 * human.c: Simplify authorship notice.
7886 Include human.h immediately after config.h.
7887 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7888 <limits.h>: Do not include, since human.h does.
7889 (SIZE_MAX, UINTMAX_MAX): New macros.
7890 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7891 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7892 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7893 (power_letter): Renamed from suffixes.
7894 (generate_suffix_backwards): Remove.
7895 (adjust_value): Now takes int style (because of human.h changes)
7896 and long double value (for greater precision on some platforms).
7897 (group_number): New function.
7898 (human_readable): Use it. Use integer options, not enum.
7899 Put the options before the sizes in the arg list.
7900 Support all the new options.
7901 The old human_readable function has been removed;
7902 use inttostr.h instead.
7903 (human_readable, default_block_size, humblock):
7904 Use uintmax_t, not int, for block sizes.
7905 (human_readable_inexact, block_size_types): Remove.
7906 (block_size_opts): New constant.
7907 (human_options): Renamed from human_block_size, with new signature
7908 that allows block sizes up to UINTMAX_MAX. All callers changed.
7909 * human.h: Add copyright and authorship notice.
7910 Include <limits.h> and <stdbool.h> unconditionally.
7911 (PARAMS): Remove. All uses removed.
7912 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7913 (enum human_inexact_style): Remove tag; now a nameless enum.
7914 (human_floor, human_ceiling, human_round_to_even): Now have
7915 values 2, 0, 1 rather than -1, 1, 0.
7916 (human_group_digits, human_suppress_point_zero, human_autoscale,
7917 human_base_1024, human_SI, human_B): New constants.
7918 (human_readable_inexact, human_block_size): Remove.
7919 (human_readable): Size args are now uintmax_t, not int.
7920 (human_options): New decl.
7922 * exclude.c: (new_exclude, add_exclude): Remove casts that are
7923 unnecessary now that we assume C89 or better. This change
7924 imported from coreutils.
7926 * mktime.c (__mktime_internal): Do not reject negative timestamps
7927 arbitrarily. This is the same patch as 2003-05-28, but it got lost
7928 in the 2003-05-30 sync from glibc.
7930 .h files should stand alone, but we shouldn't include <sys/types.h>
7931 if we can get away with just <stddef.h>.
7933 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7934 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7935 rather than <sys/types.h>, as we merely need size_t.
7936 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7938 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7939 Include <stdio.h>, to get FILE.
7940 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7941 memcasecmp.h has included <stddef.h> and all we need is size_t.
7942 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7943 our interface, instead of including <sys/types.h>
7945 2003-06-02 Paul Eggert <eggert@twinsun.com>
7948 Fix some minor time-related bugs with POSIX time arguments.
7949 Some valid time stamps were being rejected (notably -1, and
7950 time stamps before 1900 on 64-bit hosts). And some invalid
7951 time stamps were being accepted, e.g. September 31.
7953 * posixtm.h (posixtime): Return bool instead of time_t, so
7954 that we can return (time_t) -1 successfully.
7955 * posixtm.c: Likewise.
7956 [HAVE_STDBOOL_H]: Include <stdbool.h>.
7957 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7958 (t): Remove static var.
7959 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7960 of static var. All uses changed.
7961 (year): Do not reject years before 1900; they can occur with
7963 (posix_time_parse): Do not check for out-of-range components;
7964 that is now the caller's responsibility, since our checks were
7965 only approximations.
7966 (posixtime): Use mktime to check for out-of-range components,
7967 since it knows them exactly.
7968 If mktime returns (time_t) -1, check whether an error actually occurred
7969 by invoking localtime on -1.
7970 (main) [TEST_POSIXTIME]: Check for input data errors, and report
7971 posixtime failures better.
7972 Improve the test data (in comments only).
7974 2003-05-30 <karl@gnu.org>
7976 * mktime.c: update from libc.
7978 2003-05-30 Bruno Haible <bruno@clisp.org>
7980 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7981 * localcharset.h: Likewise.
7982 * localcharset.c: Likewise.
7984 2003-05-28 Paul Eggert <eggert@twinsun.com>
7986 Assume the headers required for C89 freestanding compilers.
7987 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7988 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7989 without checking for HAVE_LIMITS_H.
7990 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7991 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7993 * fatal.c: Include <stdarg.h> without checking for __STDC__.
7994 * exclude.c: Include <stdbool.h> unconditionally.
7995 * tempname.c: Include <stddef.h> unconditionally.
7996 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7997 * modechange.c, rpmatch.c (NULL): Don't define, since
7998 <stddef.h> does that.
7999 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
8000 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
8001 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
8002 * xstrtol.c: Likewise.
8003 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
8004 * savedir.c: Include <stddef.h> instead of defining NULL.
8006 * addext.c (addext): Use assignment rather than cast, to avoid
8007 warnings on some platforms.
8009 * mktime.c (__mktime_internal): Do not reject negative timestamps
8012 2003-05-10 Bruno Haible <bruno@clisp.org>
8014 * linebreak.c (iconv_string_length): Don't return -1 just because the
8015 string is longer than 4 KB.
8017 2003-05-12 Jim Meyering <jim@meyering.net>
8019 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
8020 the space-padded-by-default conversion specifiers, %e, %k, %l.
8022 2003-05-03 Bruno Haible <bruno@clisp.org>
8024 Upgrade to Unicode-4.0.
8025 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
8026 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
8027 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
8028 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
8029 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
8030 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
8031 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
8032 Change width of U+E0100..U+E01EF from 1 to 0.
8034 2003-04-25 Bruno Haible <bruno@clisp.org>
8036 * copy-file.c: Include <stddef.h>, for size_t.
8038 2003-04-25 Jim Meyering <jim@meyering.net>
8040 * copy-file.c (copy_file_preserving): Declare buf_size to be
8041 of type size_t, not int.
8043 2003-04-11 Jim Meyering <jim@meyering.net>
8045 Merge changes from Coreutils.
8047 2003-03-22 Jim Meyering <jim@meyering.net>
8049 * strftime.c (widen): Cast alloca return value to proper type.
8051 2003-01-19 Ulrich Drepper <drepper@redhat.com>
8054 * strftime.c (my_strftime): Handle very large width
8055 specifications for numeric values correctly. Improve checks for
8058 2003-01-19 Jim Meyering <jim@meyering.net>
8060 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
8061 (nl_get_alt_digit) [! defined my_strftime]: Define.
8062 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
8063 _nl_get_alt_digit and _nl_get_walt_digit.
8065 * strftime.c (my_strftime): Merge in locale-related changes from libc.
8066 These changes have no effect outside of _LIBC.
8068 2003-04-10 Bruno Haible <bruno@clisp.org>
8070 * findprog.h: New file, from GNU gettext.
8071 * findprog.c: New file, from GNU gettext.
8073 2003-04-05 Jim Meyering <jim@meyering.net>
8075 Merge changes from Coreutils.
8077 * exclude.h (PARAMS): Remove definition and uses.
8078 * exclude.c: Remove uses of `PARAMS'.
8080 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8081 Add test-cases for DOS filenames. Declare program_name.
8082 (main): Set up program_name. Patch by Rich Dawe.
8084 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8086 Use mntctl's return value to drive the entry-processing loop, since
8087 we can't rely on the value of the vmt_length member in the last
8088 entry. On some systems doing so could result in exhausting
8089 virtual memory. Based in part on a patch from Mike Jetzer.
8091 2003-04-04 Bruno Haible <bruno@clisp.org>
8093 * linebreak.h: New file, from GNU gettext.
8094 * linebreak.c: New file, from GNU gettext with slight modifications.
8095 * lbrkprop.h: New file, from GNU gettext.
8097 2003-04-03 Bruno Haible <bruno@clisp.org>
8099 * utf8-ucs4.h: New file, from GNU gettext.
8100 * utf16-ucs4.h: New file, from GNU gettext.
8101 * ucs4-utf8.h: New file, from GNU gettext.
8102 * ucs4-utf16.h: New file, from GNU gettext.
8104 2003-04-02 Bruno Haible <bruno@clisp.org>
8106 * binary-io.h: New file, from GNU gettext.
8108 2003-04-01 Bruno Haible <bruno@clisp.org>
8110 * pathname.h: New file, from GNU gettext.
8111 * concatpath.c: New file, from GNU gettext.
8113 2003-03-30 Bruno Haible <bruno@clisp.org>
8115 * copy-file.c (copy_file_preserving): Don't set owner if the function
8116 chown() doesn't exist.
8118 2003-03-28 Bruno Haible <bruno@clisp.org>
8120 * copy-file.h: New file, from GNU gettext.
8121 * copy-file.c: New file, from GNU gettext.
8123 2003-03-18 Jim Meyering <jim@meyering.net>
8125 * quote.c (quote_n): Fix typo in comment.
8127 2003-03-14 Jim Meyering <jim@meyering.net>
8129 Merge changes from Coreutils.
8130 * obstack.h (obstack_object_size): Declare temporary, __o,
8131 to be const, in order to avoid warnings.
8132 (obstack_room): Likewise.
8133 (obstack_empty_p): Likewise.
8135 2003-03-13 Paul Eggert <eggert@twinsun.com>
8137 Merge changes from Bison.
8138 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8139 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8140 when compiling Bison 1.875's `bitset bset = obstack_alloc
8141 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8142 * hash.c: Include <stdbool.h> unconditionally.
8144 2003-03-09 Paul Eggert <eggert@twinsun.com>
8146 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8147 Reported by Bruce Becker; see:
8148 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8150 2003-03-03 Paul Eggert <eggert@twinsun.com>
8151 Bruno Haible <bruno@clisp.org>
8153 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8154 Reported by John Hughes, see
8155 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8157 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
8159 * poll_.h: New file.
8162 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
8164 * mathl.h: New file.
8165 * acosl.c: New file.
8166 * asinl.c: New file.
8167 * atanl.c: New file.
8168 * ceill.c: New file.
8171 * floorl.c: New file.
8172 * frexpl.c: New file.
8173 * ldexpl.c: New file.
8175 * sincosl.c: New file.
8177 * sqrtl.c: New file.
8179 * trigl.c: New file.
8180 * trigl.h: New file.
8182 2003-02-17 Bruno Haible <bruno@clisp.org>
8184 * mkdtemp.h: New file, from GNU gettext.
8185 * mkdtemp.c: New file, from GNU gettext.
8187 2003-01-31 Bruno Haible <bruno@clisp.org>
8189 * rename.c: #undef rename before defining rpl_rename.
8190 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8192 2003-01-30 Bruno Haible <bruno@clisp.org>
8194 * printf-args.h: New file, from GNU gettext.
8195 * printf-args.c: New file, from GNU gettext.
8196 * printf-parse.h: New file, from GNU gettext.
8197 * printf-parse.c: New file, from GNU gettext.
8198 * vasnprintf.h: New file, from GNU gettext.
8199 * vasnprintf.c: New file, from GNU gettext.
8200 * asnprintf.c: New file, from GNU gettext.
8201 * vasprintf.h: New file, from GNU gettext with modifications.
8202 * vasprintf.c: New file, from GNU gettext.
8203 * asprintf.c: New file, from GNU gettext.
8205 2003-01-29 Bruno Haible <bruno@clisp.org>
8207 * stpncpy.h: New file, from GNU gettext with modifications.
8208 * stpncpy.c: New file, from GNU gettext with modifications.
8210 2003-01-28 Bruno Haible <bruno@clisp.org>
8212 * c-ctype.h: New file, from GNU gettext, with changes suggested by
8214 * c-ctype.c: New file, from GNU gettext, with changes suggested by
8217 2003-01-27 Bruno Haible <bruno@clisp.org>
8219 * xsetenv.h: New file, from GNU gettext.
8220 * xsetenv.c: New file, from GNU gettext.
8222 2003-01-23 Bruno Haible <bruno@clisp.org>
8224 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8226 2003-01-22 Bruno Haible <bruno@clisp.org>
8228 * exit.h: New file, from GNU gettext.
8230 2003-01-11 Bruno Haible <bruno@clisp.org>
8232 * stpcpy.h (stpcpy): Use ANSI C function declarations.
8233 * strcase.h (strcasecmp, strncasecmp): Likewise.
8235 2003-01-14 Jim Meyering <jim@meyering.net>
8237 * same.c (same_name): Tweak a comment.
8239 2003-01-11 Bruno Haible <bruno@clisp.org>
8241 * same.c (same_name): Reorder tests so as to avoid calling stat()
8242 when a string comparison is sufficient.
8244 2003-01-11 Bruno Haible <bruno@clisp.org>
8246 * readtokens.c (readtoken): Cast character to 'unsigned char', not
8249 2003-01-11 Bruno Haible <bruno@clisp.org>
8251 * hash-pjw.c: Add comment about low quality of this function.
8253 2003-01-12 Paul Eggert <eggert@twinsun.com>
8255 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8256 to avoid collisions with libcurses and libreadline.
8258 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8259 * getstr.h, getstr.c: Remove.
8260 * getline.c: Include "getline.h", to check interface.
8261 Move body of old getstr.c here: this defines MIN_CHUNK and
8262 declares getdelim2, which is renamed from getstr.
8263 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8265 * linebuffer.c (readlinebuffer): Renamed from readline.
8267 * linebuffer.h: Likewise.
8268 (readline): Remove backward-compatibility macro.
8270 2003-01-12 Jim Meyering <jim@meyering.net>
8272 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
8274 2003-01-10 Bruno Haible <bruno@clisp.org>
8276 * alloca_.h: New file.
8277 * getdate.y: Unconditionally include alloca.h.
8278 * makepath.c: Likewise.
8279 * setenv.c: Likewise.
8280 * userspec.c: Likewise.
8282 2003-01-09 Bruno Haible <bruno@clisp.org>
8284 * stdbool.h.in: New file.
8286 2003-01-08 Bruno Haible <bruno@clisp.org>
8288 * safe-read.c: Include specification header first, to ensure its
8290 * full-write.c: Likewise.
8292 2003-01-08 Jim Meyering <jim@meyering.net>
8294 * full-write.c: Undefine and define-away `const' after inclusion
8295 of errno.h, not before. Suggestion from Bruno Haible.
8297 2003-01-07 Jim Meyering <jim@meyering.net>
8299 * full-write.c: Rework so that it may serve to define full_read, too.
8300 * full-read.c: Simply #define FULL_READ and include full-write.c.
8302 2003-01-06 Jim Meyering <jim@meyering.net>
8304 * version-etc.c: Update year in translatable copyright string.
8306 2002-12-25 Bruno Haible <bruno@clisp.org>
8308 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8309 * xstrtol.h: Likewise.
8310 * xstrtoimax.c: Likewise.
8311 * xstrtoumax.c: Likewise.
8312 * human.h: Likewise.
8314 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8315 on systems that have <inttypes.h> but not <stdint.h>.
8317 2002-12-31 Paul Eggert <eggert@twinsun.com>
8319 * memcoll.c (memcoll): Fall back on a simple algorithm using
8320 memcmp if strcoll doesn't work.
8322 2002-12-23 Bruno Haible <bruno@clisp.org>
8324 * localcharset.h: New file.
8325 * localcharset.c: Include it.
8326 * unicodeio.c: Likewise.
8328 2002-12-22 Bruno Haible <bruno@clisp.org>
8330 * utime.c (utime_null): No need to call ftruncate if the file was
8333 2002-12-23 Bruno Haible <bruno@clisp.org>
8335 * memcoll.c (STRCOLL): New macro.
8338 2002-12-22 Bruno Haible <bruno@clisp.org>
8340 * getstr.h (getstr): Define, to avoid clash with libcurses.
8341 * linebuffer.h (readline): Define, to avoid clash with libreadline.
8343 2002-12-22 Bruno Haible <bruno@clisp.org>
8345 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8347 2002-12-23 Bruno Haible <bruno@clisp.org>
8349 * getline.h: Include <stddef.h>, for size_t.
8351 * unicodeio.h: Include <stddef.h>, for size_t.
8352 * unicodeio.c: Don't include <stddef.h>.
8354 2002-12-17 Bruno Haible <bruno@clisp.org>
8356 * canon-host.c (strdup): Remove unused declaration.
8358 * fsusage.c: Include full_read.h.
8359 (get_fs_usage): Use full_read instead of safe_read.
8361 * utime.c (utime_null): Use SAFE_READ_ERROR.
8363 2002-12-11 Bruno Haible <bruno@clisp.org>
8365 * setenv.h: Rewritten to cope with systems that have setenv() but not
8367 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8370 2002-12-11 Bruno Haible <bruno@clisp.org>
8372 * setenv.c (alloca): Fall back to malloc.
8374 (setenv): Use freea() to free memory allocated with alloca().
8376 2002-11-13 Bruno Haible <bruno@clisp.org>
8378 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8379 function declarations.
8380 * unsetenv.c (unsetenv): Likewise.
8382 2002-03-04 Bruno Haible <bruno@clisp.org>
8384 Portability to AIX 4.3.3.
8385 * unsetenv.c: New file, extracted from setenv.c.
8386 * setenv.c: Move the unsetenv() function to unsetenv.c.
8388 2001-12-20 Bruno Haible <bruno@clisp.org>
8390 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8391 use malloc instead. For SunOS 4.
8393 2001-12-11 Bruno Haible <bruno@clisp.org>
8395 * setenv.c: Declare alloca.
8396 (compar_fn_t): New typedef.
8397 (KNOWN_VALUE, STORE_VALUE): Use it.
8399 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8402 2002-12-10 Paul Eggert <eggert@twinsun.com>
8404 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8405 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8406 Choose values that are less likely to collide with system fnmatch
8408 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8409 defined (e.g., a pure POSIX system).
8410 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8411 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8413 2002-12-06 Jim Meyering <jim@meyering.net>
8415 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8417 Merge in changes from libc's misc/error.c, in preparation
8418 for the merge of gnulib's changes back into libc.
8420 * error.c (_): Define only if not already defined.
8421 Move definition to follow all #include directives.
8422 Include unlocked-io.h only if !_LIBC.
8423 [_LIBC]: Include <libio/libioP.h>.
8424 [USE_IN_LIBIO]: Include <libio/iolibio.h>
8425 (fflush): Tweak definition to use INTUSE.
8428 2002-12-05 Paul Eggert <eggert@twinsun.com>
8430 * alloca.c [defined emacs]: Include "lisp.h".
8431 (xalloc_die) [defined emacs]: New macro.
8432 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8433 [! defined emacs]: Include <xalloc.h>.
8434 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8435 (pointer): Typedef to POINTER_TYPE *.
8436 (malloc): Remove decl; we now always use xmalloc.
8437 (alloca): Use old-style definition, since Emacs needs this.
8438 Check for arithmetic overflow when computing combined size.
8440 2002-12-04 Paul Eggert <eggert@twinsun.com>
8442 Do not generate unlocked-io.h automatically, since it's easier to
8443 maintain it by hand.
8445 * unlocked-io.h: New file, from GNU diffutils,
8446 but with proper copyright notice and attribution.
8448 * Makefile.am: Add copyright notice.
8449 (libfetish_a_SOURCES): Add unlocked-io.h.
8450 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8451 (DISTCLEANFILES, io_functions): Remove macros.
8452 (EXTRA_DIST): Remove gen_uio.
8453 (unlocked-io.h): Remove rule.
8455 2002-12-04 Jim Meyering <jim@meyering.net>
8457 Reflect the fact that stat.c and lstat.c are no longer generated.
8458 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8459 (DISTCLEANFILES): Likewise.
8460 (EXTRA_DIST): Likewise.
8461 (all_local): Don't depend on stat.c or lstat.c.
8462 (stat.c, lstat.c): Remove rules.
8463 (EXTRA_DIST): Remove xstat.in.
8465 * xstat.in: Remove file. Contents moved into stat.c.
8466 * stat.c: New file. Contents mostly from xstat.in.
8467 * stat.c: Rework so that it may serve to define rpl_lstat, too.
8468 * lstat.c: New file. Simply #define LSTAT and include stat.c.
8470 * safe-read.c: Rework so that it may serve to define safe_write, too.
8471 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8473 2002-12-03 Jim Meyering <jim@meyering.net>
8475 * safe-read.c, safe-write.c: Change variable names and comments, but
8476 not semantics, to minimize the differences between these two files.
8477 (safe_read): Change comment to mention SAFE_READ_ERROR.
8479 * safe-read.c (IS_EINTR): Define.
8480 (safe_read): Use IS_EINTR in place of in-function cpp directives.
8482 2002-12-02 Bruno Haible <bruno@clisp.org>
8484 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8485 Define, taken from safe-read.c.
8486 (INT_MAX): Provide fallback.
8487 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8488 * safe-write.h (SAFE_WRITE_ERROR): Define.
8490 * safe-read.c (EINTR): Remove definition.
8491 (safe_read): Don't use EINTR if it is absent.
8493 2002-12-02 Jim Meyering <jim@meyering.net>
8495 * safe-read.c (EINTR): Define.
8496 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8497 (INT_MAX): Provide fallback.
8498 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8500 * safe-read.h (SAFE_READ_ERROR): Define.
8502 2002-12-01 Jim Meyering <jim@meyering.net>
8504 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8505 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8507 2002-11-27 Paul Eggert <eggert@twinsun.com>
8509 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8510 hash_rehash): Replace `if (limit <= value) abort ();' with
8511 `if (! (value < limit)) abort ();', for readability.
8513 2002-11-26 <karl@gnu.org>
8515 * strdup.c: copy from libc again, with jim's ok.
8516 * .cppi-disable: re-add strdup.c
8518 2002-11-25 <karl@gnu.org>
8520 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8521 instead of "strtol.c".
8523 2002-11-25 Jim Meyering <jim@meyering.net>
8525 * mktime.c: Sync from libc, now that it has the latest fix.
8527 2002-11-24 <karl@gnu.org>
8529 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8530 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8532 2002-11-24 Jim Meyering <jim@meyering.net>
8534 Update from coreutils:
8536 * mktime.c: Merge in changes from libc.
8538 Avoid a link-time failure on some Linux systems.
8539 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8540 (__mon_yday): Declare with the STATIC attribute.
8541 (__mktime_internal): Likewise.
8542 Based on a report from Greg Schafer.
8544 2002-11-23 Jim Meyering <jim@meyering.net>
8546 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8547 Use `unsigned', not `int', as type of index.
8549 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8551 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8553 2002-11-22 Paul Eggert <eggert@twinsun.com>
8555 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8556 hint that one should use `if (! x) abort ();' rather than `assert
8557 (x);', and anyway it's one less thing to worry about configuring.
8558 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8559 hash_rehash, hash_insert): Use abort rather than assert.
8561 2002-11-22 Paul Eggert <eggert@twinsun.com>
8563 * quotearg.h: Allow multiple inclusion by surrounding with
8564 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8565 so that we can be included first.
8566 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8567 * quotearg.c: Include quotearg.h immediately after config.h.
8568 No need to include stddef.h or sys/types.h any more.
8569 Surround local include files with "", not "<>".
8570 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8571 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8572 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8573 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8574 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8575 (ISPRINT): Remove; no longer needed now that we assume C89.
8577 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8580 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8581 quotearg_char): Use SIZE_MAX rather than
8582 (size_t) -1 when we are talking about "infinity".
8584 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8586 2002-11-22 Bruno Haible <bruno@clisp.org>
8588 * safe-read.h: Assume C89. Add comments.
8589 (safe_read): Change return type to size_t.
8590 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8591 counts > SSIZE_MAX correctly.
8592 * safe-write.h: New file.
8593 * safe-write.c: New file.
8594 * full-read.h: New file.
8595 * full-read.c: New file.
8596 * full-write.h: Assume C89. Add comments.
8597 * full-write.c: Include safe-write.h.
8598 (full_write): Rewritten to use safe_write.
8599 Suggested by Jim Meyering and Paul Eggert.
8601 2002-11-21 Bruno Haible <bruno@clisp.org>
8603 Remove case insensitive option matching.
8604 * argmatch.h (argcasematch): Remove declaration.
8605 (ARGCASEMATCH): Remove macro.
8606 (__xargmatch_internal): Remove case_sensitive argument.
8607 (XARGMATCH): Update.
8608 (XARGCASEMATCH): Remove macro.
8609 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8610 case_sensitive argument.
8611 (argcasematch): Remove function.
8612 (__xargmatch_internal): Remove case_sensitive argument.
8613 (main): Use XARGMATCH instead of XARGCASEMATCH.
8615 * xmalloc.c: Change compile-time error message. Add comment about
8616 required autoconf version.
8618 2002-11-21 Jim Meyering <jim@meyering.net>
8620 * strdup.c (strdup): Tweak comment and initial #if/#include.
8622 Merge in changes from the coreutils.
8624 2002-09-25 Paul Eggert <eggert@twinsun.com>
8625 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8626 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8627 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8628 int. Work more efficiently if X is the same width as uintmax_t.
8629 Do not compare X to -1, to avoid bogus compiler warning.
8630 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8631 Don't assume that f_frsize and f_bsize are the same type.
8633 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8636 * makepath.c (make_path): Restore umask *before* creating the final
8638 (make_path): Minor reformatting.
8640 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8641 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8643 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8644 ones. At least on GNU/Linux systems, `auto' means something else.
8647 2002-11-20 Paul Eggert <eggert@twinsun.com>
8649 Merge argmatch cleanups from Bison. Assume C89.
8651 * argmatch.c: Include config.h here, not in argmatch.h.
8652 Include stdlib.h, for EXIT_FAILURE.
8653 Always include <string.h>, since we assume C89.
8654 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8655 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8656 Include <stddef.h> instead, since it's all we need for size_t.
8657 (PARAMS): Remove. All uses removed.
8658 (ARRAY_CARDINALITY): Do not bother to #undef.
8659 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8660 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8661 Remove unnecessary parentheses.
8662 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8663 Insert necessary parentheses.
8664 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8665 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8667 2002-11-19 Bruno Haible <bruno@clisp.org>
8669 * mbswidth.c: Include mbswidth.h right at the beginning.
8670 * mbswidth.h: Include <stddef.h>, for size_t.
8672 * mbswidth.h (PARAMS): Remove macro.
8673 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8674 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8676 * gcd.h (PARAMS): Remove macro.
8677 (gcd): Use ANSI C function declarations.
8678 * gcd.c (gcd): Likewise.
8680 2002-11-15 Bruno Haible <bruno@clisp.org>
8682 * strcspn.c: Include <stddef.h>.
8683 (strcspn): Use ANSI C function declaration. Change return type to
8685 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8686 (strpbrk): Use NULL.
8687 * strpbrk.h (PARAMS): Remove macro.
8688 (strpbrk): Use ANSI C function declaration.
8689 * strstr.c: Don't include <sys/types.h>.
8690 * strstr.h (PARAMS): Remove macro.
8691 (strstr): Use ANSI C function declarations.
8693 2002-11-06 Bruno Haible <bruno@clisp.org>
8695 * gcd.h (gcd): Change argument type to 'unsigned long'.
8696 * gcd.c (gcd): Likewise.
8698 2002-11-05 Bruno Haible <bruno@clisp.org>
8700 * gcd.h: New file, from gettext-0.11.5.
8701 * gcd.c: New file, from gettext-0.11.5.
8703 2002-11-05 Bruno Haible <bruno@clisp.org>
8705 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8706 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8707 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8708 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8710 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8711 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8713 * closeout.c: Include gettext.h instead of <libintl.h>.
8714 * human.c: Include gettext.h instead of <libintl.h>.
8715 * quotearg.c: Include gettext.h instead of <libintl.h>.
8716 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8717 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8718 * userspec.c: Include gettext.h instead of <libintl.h>.
8719 * version-etc.c: Include gettext.h instead of <libintl.h>.
8720 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8721 (textdomain): Remove definition.
8722 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8724 * long-options.c: Remove include of <libintl.h> and definition of _.
8725 * same.c: Remove include of <libintl.h> and definition of _.
8727 2002-11-04 Bruno Haible <bruno@clisp.org>
8729 * stpcpy.h: New file, from GNU gettext-0.11.5.
8730 * strcase.h: New file, from GNU gettext-0.11.5.
8731 * strpbrk.h: New file, from GNU gettext-0.11.5.
8732 * strstr.h: New file, from GNU gettext-0.11.5.
8733 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8735 2002-05-09 Bruno Haible <bruno@clisp.org>
8737 * config.charset: Update for newest glibc. Add canonical names
8738 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8740 2002-05-09 Bruno Haible <bruno@clisp.org>
8742 * localcharset.c (get_charset_aliases): Add more Windows specific
8745 2002-05-08 Owen Taylor <otaylor@redhat.com>
8747 * config.charset: A few additions for Solaris.
8749 2001-12-05 Bruno Haible <bruno@clisp.org>
8751 * localcharset.c (locale_charset): Don't return an empty string.
8753 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8755 * config.charset: msdos in uk_UA uses CP1125.
8757 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8759 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8760 * localcharset.c (locale_charset): Declare as extern "C".
8762 2002-02-15 Bruno Haible <bruno@clisp.org>
8764 * config.charset [msdosdjgpp]: For Russian, use CP866.
8766 2002-02-11 Bruno Haible <bruno@clisp.org>
8768 * config.charset: Add support for NetBSD.
8770 2002-09-25 <karl@gnu.org>
8772 * strdup.c: copy from libc/string (via ../config/srclist*).
8773 * getopt*: copy from libc/posix.
8774 * gettext.h: copy from gettext.
8775 * .cppi-disable: add strdup.c, gettext.h.
8777 2002-07-01 Jim Meyering <meyering@lucent.com>
8779 * c-stack.c: Include sys/time.h.
8780 From Volker Borchert.
8782 2002-06-11 Paul Eggert <eggert@twinsun.com>
8784 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8785 New macro. Use it uniformly instead of
8786 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8787 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8788 reported by Vin Shelton.
8790 2002-06-22 Jim Meyering <meyering@lucent.com>
8792 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8793 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8795 2002-06-22 Paul Eggert <eggert@twinsun.com>
8797 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8798 Do not assume SA_SIGINFO behavior.
8799 Bug reported by Jim Meyering on NetBSD 1.5.2.
8801 2002-06-22 Jim Meyering <meyering@lucent.com>
8803 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8805 * exitfail.c, exitfail.h: Likewise.
8806 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8808 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8810 (EXTRA_DIST): Add fnmatch_loop.c.
8811 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8813 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8814 * fnmatch.c: Update from diffutils-2.8.2.
8815 * fnmatch_.h: New file. From diffutils-2.8.2.
8816 * fnmatch.h: Remove file.
8818 2002-06-18 Paul Eggert <eggert@twinsun.com>
8820 * file-type.h: Report an error if neither S_ISREG nor
8821 S_IFREG is defined, instead of using a test specific to glibc
8822 2.2. This should be safe, since POSIX requires S_ISREG and
8823 Unix Version 7 had S_IFREG. We don't need to check for
8824 <sys/types.h> since we don't use any symbols that it defines.
8826 2002-06-15 Jim Meyering <meyering@lucent.com>
8828 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8829 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8830 have been included before this file.
8832 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8834 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8835 so that each temporary file name is unique and valid in the first
8836 8 characters, for operation under DOS.
8838 2002-06-15 Jim Meyering <meyering@lucent.com>
8840 Work even with DJGPP 2.03, which lacks support for symlinks.
8842 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8844 * lchown.c (S_ISLNK): Likewise.
8846 2002-06-14 Jim Meyering <meyering@lucent.com>
8848 * file-type.h: Use the version from diffutils-2.8.2.
8849 * file-type.c: Likewise.
8851 2002-05-27 Jim Meyering <meyering@lucent.com>
8853 Fix a problem seen only on nonconforming systems whereby ls.c's
8854 use of localtime, and then of gettimeofday would cause trouble:
8855 the localtime call used to initialize rpl_gettimeofday's save
8856 mechanism would clobber ls's current local time information so
8857 that in any long listing the first file would always be listed
8858 with date 1970-01-01. Analysis by Volker Borchert.
8860 * gettimeofday.c (localtime): Undefine.
8861 (rpl_localtime): New function.
8863 2002-05-22 Jim Meyering <meyering@lucent.com>
8865 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8866 * file-type.h: New file.
8867 * file-type.c (file_type): New file/function. Extracted from diffutils.
8869 2002-04-29 Paul Eggert <eggert@twinsun.com>
8871 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8873 2002-04-28 Paul Eggert <eggert@twinsun.com>
8875 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8876 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8877 of 127, since 64 is the largest conceivable number for ancient
8879 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8881 2002-04-28 Jim Meyering <meyering@lucent.com>
8883 * sig2str.c (WTERMSIG): Remove definition (unused).
8885 2002-04-28 Paul Eggert <eggert@twinsun.com>
8887 * sig2str.h, sig2str.c: New files.
8888 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8890 2002-04-24 Jim Meyering <meyering@lucent.com>
8892 * gettext.h: New file, from Gettext.
8893 * Makefile.am (INCLUDES): Remove -I../intl.
8894 (libfetish_a_SOURCES): Add gettext.h.
8896 2002-04-16 Jim Meyering <meyering@lucent.com>
8898 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8899 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8900 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8902 2002-04-12 Jim Meyering <meyering@lucent.com>
8904 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8906 2002-03-10 Jim Meyering <meyering@lucent.com>
8908 * makepath.c (make_path): Remove a comma from a diagnostic.
8909 Suggestion from Santiago Vila.
8911 2002-03-08 Jim Meyering <meyering@lucent.com>
8913 * rename.c: Mention that this wrapper is needed also on
8914 mips-dec-ultrix4.4 systems.
8916 2002-03-02 Jim Meyering <meyering@lucent.com>
8918 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8919 not HAVE_CLOCK_SETTIME.
8921 2002-02-27 Paul Eggert <eggert@twinsun.com>
8923 * nanosleep.h: Rename to....
8924 * timespec.h: New name for nanosleep.h. All uses changed.
8926 * gettime.c: New file.
8927 * settime.c: New file.
8930 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8931 timespec.h. Remove nanosleep.h.
8933 2002-02-25 Paul Eggert <eggert@twinsun.com>
8935 * acl.c, acl.h: New files.
8936 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8938 2002-02-24 Jim Meyering <meyering@lucent.com>
8940 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8941 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8942 cause trouble. Reported by Nelson Beebe.
8944 2002-02-23 Paul Eggert <eggert@twinsun.com>
8946 * path-concat.c (xpath_concat): Reorder code to pacify
8947 compilers that don't know that xalloc_die never returns.
8949 2002-02-20 Jim Meyering <meyering@lucent.com>
8951 * getdate.c: Regenerate using bison-1.33.
8953 2002-02-15 Paul Eggert <eggert@twinsun.com>
8955 * posixver.c, posixver.h: New files.
8956 * Makefile.am (libfetish_a_SOURCES): Add them.
8958 2002-02-02 Paul Eggert <eggert@twinsun.com>
8959 Bruno Haible <bruno@clisp.org>
8961 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8962 (fwrite_success_callback): New declaration.
8963 * unicodeio.c (unicode_to_mb): New function, extracted from
8964 print_unicode_char. Call failure callback instead of error.
8965 (fwrite_success_callback): New function.
8966 (exit_failure_callback): New function.
8967 (fallback_failure_callback): New function.
8968 (print_unicode_char): Call unicode_to_mb.
8970 2002-01-26 Jim Meyering <meyering@lucent.com>
8972 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8974 2002-01-22 Jim Meyering <meyering@lucent.com>
8976 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8977 Otherwise, some versions of automake would omit the rule that makes
8978 Makefile from Makefile.in.
8980 2001-01-21 Paul Eggert <eggert@twinsun.com>
8982 * xmemcoll.h, xmemcoll.c: New files.
8983 * Makefile.am (libfetish_a_SOURCES): Add them.
8984 * memcoll.c: Include errno.h, and declare errno if not defined.
8985 (memcoll): Set errno to zero if there is no error.
8987 * quotearg.c (quotearg_buffer_restyled):
8988 Fix bug with quoting buffers containing NUL when backslashing escapes.
8989 This bug was exposed by the other changes in this patch.
8990 (quotearg_n_options): New arg ARGSIZE.
8991 All callers changed.
8992 (quoting_options_from_style): New function.
8993 (quotearg_n_style): Use it.
8994 (quotearg_n_style_mem): New function.
8996 * quotearg.h (quotearg_n_style_mem): New function.
8998 2002-01-16 Jim Meyering <meyering@lucent.com>
9000 * getdate.y: Add three semicolons, each just before a closing brace.
9001 Bison (as of version 1.31) no longer papers over that mistake.
9003 2002-02-14 Paul Eggert <eggert@twinsun.com>
9005 * backupfile.c (ISDIGIT): Comment fix.
9006 * getdate.y (ISDIGIT): Likewise.
9007 * posixtm.c (ISDIGIT, year): Likewise.
9008 * strverscmp.c (ISDIGIT): Likewise.
9009 * userspec.c (ISDIGIT): Likewise.
9011 2002-01-05 Jim Meyering <meyering@lucent.com>
9013 * version-etc.c (version_etc_copyright): Update copyright year.
9015 2001-01-19 Paul Eggert <eggert@twinsun.com>
9017 * closeout.c (close_stdout_status): If ferror (stdout), do
9018 not silently exit merely because the output buffer happens to
9019 have nothing pending.
9021 2001-12-18 Paul Eggert <eggert@twinsun.com>
9023 See the big note in ../ChangeLog.
9024 * human.c (suffixes): Prefer K to k for 1024.
9025 (generate_suffix_backwards): New function.
9026 (human_readable_inexact): Use it.
9027 * xstrtol.c (__xstrtol): If there is no number but there
9028 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
9029 Accept 'K' as well as 'k'.
9031 2001-12-15 Jim Meyering <meyering@lucent.com>
9033 * regex.h (__restrict_arr): Update from libc.
9035 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
9036 as `remote' if the name starts with `//'. Suggested by Michael Stone.
9039 2001-12-10 Jim Meyering <meyering@lucent.com>
9041 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
9042 Instead, include "xalloc.h".
9043 (initbuffer): Don't cast xmalloc return value to char*.
9044 (readline): Reword comment.
9045 Don't cast xrealloc return value to char*
9048 2001-12-09 Jim Meyering <meyering@lucent.com>
9050 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
9051 `signed and unsigned type in conditional expression'.
9052 * posixtm.c (posix_time_parse): Likewise.
9054 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
9056 * readtokens.c (readtoken): Declare an index to be of type unsigned
9057 to avoid a pedantic warning.
9059 * getstr.c: Don't include assert.h.
9060 (getstr): Remove warning-evoking assertions.
9061 Return -1 if offset parameter is out of bounds.
9062 Change the type of a local from int to size_t.
9064 * strftime.c (my_strftime_localtime_r): Include this function
9065 definition in the `#if ! HAVE_TM_GMTOFF' block.
9067 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
9068 Include xalloc.h instead.
9070 2001-12-02 Jim Meyering <meyering@lucent.com>
9072 * tempname.c: Don't declare getenv, thus reverting the change of
9073 2001-11-18. It's no longer necessary, now that stdlib.h is always
9076 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9077 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
9079 2001-11-30 Akim Demaille <akim@epita.fr>
9081 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9082 before being defined.
9084 2001-11-27 Paul Eggert <eggert@twinsun.com>
9086 * quotearg.h (quotearg_n, quotearg_n_style):
9087 First arg is int, not unsigned.
9088 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9089 (SIZE_MAX, UINT_MAX): New macros.
9090 (quotearg_n_options): Abort if N is negative.
9091 Avoid overflow check on hosts where size_t is 64 bits and int
9092 is 32 bits, as overflow is impossible there.
9093 Fix off-by-one typo that caused unnecessary reallocation.
9095 2001-11-27 Jim Meyering <meyering@lucent.com>
9097 * tempname.c: Merge with version from libc.
9098 * regex.c: Likewise.
9100 * tempname.c: Include stdlib.h unconditionally. On some old systems
9101 for which STDC_HEADERS is 0, it was not included, resulting in a
9102 warning about an integer-to-pointer conversion problem with getenv.
9103 Reported by Volker Borchert.
9105 2001-11-26 Jim Meyering <meyering@lucent.com>
9107 * gtod.h: Remove file.
9108 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9109 * gettimeofday.c: Don't include gtod.h.
9110 (GTOD_init): Remove function.
9111 (rpl_gettimeofday): Do its job here instead, rather than aborting.
9112 Suggestion from Volker Borchert.
9114 2001-11-23 Jim Meyering <meyering@lucent.com>
9116 * hash.h (struct hash_table): Don't define here. Merely declare it.
9117 * hash.c (struct hash_table): Define it here instead.
9119 2001-11-22 Jim Meyering <meyering@lucent.com>
9121 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9123 2001-11-18 Paul Eggert <eggert@twinsun.com>
9125 * tempname.c (TMP_MAX): Remove; no longer needed.
9126 (TEMPORARIES): New macro.
9127 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
9128 removes an artificial limitation (e.g. HP-UX 10.20, where
9131 2001-11-18 Jim Meyering <meyering@lucent.com>
9133 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9136 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9137 files will be created before anything else.
9139 2001-11-17 Jim Meyering <meyering@lucent.com>
9141 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9142 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9143 rather than group writable. Patch by Juan F. Codagnone.
9145 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9146 Instead, include "xalloc.h".
9148 * mountlist.c: Include unlocked-io.h after all system headers.
9149 Remove explicit declarations of xmalloc, xrealloc,
9150 and xstrdup. Instead, include "xalloc.h".
9152 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9153 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9154 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9156 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9157 Reported by Padraig Brady.
9159 * mkstemp.c: #undef mkstemp.
9161 (rpl_mkstemp): Rename from mkstemp.
9164 2001-11-16 Jim Meyering <meyering@lucent.com>
9166 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9167 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9168 determine the amount of total physical memory, use pstat_getstatic.
9169 HPUX-11 doesn't define _SC_PHYS_PAGES.
9170 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9171 If sysconf couldn't be used to determine the amount of available
9172 physical memory, use both pstat_getstatic and pstat_getdynamic.
9173 Based on a patch from Bob Proulx.
9175 2001-11-05 Jim Meyering <meyering@lucent.com>
9177 * xstat.in (slash_aware_lstat): Correct a misleading comment.
9179 2001-11-03 Jim Meyering <meyering@lucent.com>
9181 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9182 in argmatch_to_argument call.
9184 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9187 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9188 e.g., a fault due to an attempt to free a NULL pointer.
9190 2001-11-01 Jim Meyering <meyering@lucent.com>
9192 * dirfd.c, dirfd.h: New files.
9193 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9195 * hash.c (hash_print) [TESTING]: Clean up.
9197 2001-10-22 Paul Eggert <eggert@twinsun.com>
9199 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9200 to avoid a warning if -Wall.
9202 2001-10-21 Paul Eggert <eggert@twinsun.com>
9204 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9206 2001-10-21 Jim Meyering <meyering@lucent.com>
9208 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
9209 this code would end up calling gettext even in packages built
9211 * getopt.c (_): Likewise.
9212 * regex.c (_): Likewise.
9214 2001-10-20 Paul Eggert <eggert@twinsun.com>
9216 * error.c (strerror_r): Do not declare unless !_LIBC.
9217 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9218 Use strerror_r that is only a macro, even if it is not a function.
9219 (strerror): Check for HAVE_DECL_STRERROR before declaring.
9220 (private_strerror): Use prototypes, not old-style function definition.
9221 (print_errno_message): New function.
9222 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9224 (error_tail, error, error_at_line): Use it.
9226 2001-10-11 Jim Meyering <meyering@lucent.com>
9228 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9229 and quote_n (1, ... to avoid clobbering a buffer.
9231 2001-10-05 Jim Meyering <meyering@lucent.com>
9233 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9234 * hash-pjw.c: New file (factored out of fileutils' remove.c).
9235 * hash-pjw.h: New file.
9237 2001-09-30 Jim Meyering <meyering@lucent.com>
9239 * mountlist.c [MOUNTED_GETFSSTAT]:
9240 Include <sys/ucred.h>, for Apple Darwin.
9241 Include sys/mount.h and sys/fs_types.h only if available.
9243 (read_filesystem_list): Use FS_TYPE.
9245 2001-09-29 Paul Eggert <eggert@twinsun.com>
9247 * exclude.c (excluded_filename): 0 -> false, since it's
9250 2001-09-28 Paul Eggert <eggert@twinsun.com>
9252 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9253 #defines strtoimax. Also treat the other strto* functions
9256 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9257 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9258 (strtoimax, strtoumax): Do not declare if already defined as a macro.
9260 2001-09-26 Jim Meyering <meyering@lucent.com>
9262 Most macros in unlocked-io.h had the wrong number of arguments.
9263 * gen-uio: New script.
9264 (USE_UNLOCKED_IO): Define to 1 if not already defined.
9265 * unlocked-io.hin: Remove file.
9266 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9267 rather than trying to embed it here.
9268 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
9269 Reported by Padraig Brady.
9271 2001-09-25 Volker Borchert <bt@teknon.de>
9273 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9275 2001-09-23 Jim Meyering <meyering@lucent.com>
9277 * mountlist.c: Remove useless parentheses in #if directives.
9278 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9279 the deprecated MOUNTED symbol is no longer defined in mntent.h.
9281 2001-09-22 Jim Meyering <meyering@lucent.com>
9283 * localcharset.c: Update from latest gettext.
9284 * config.charset: Likewise.
9286 2001-09-20 Jim Meyering <meyering@lucent.com>
9288 * xstrtol.c (strtoimax): Guard declaration with
9289 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9290 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9291 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9292 (strtoumax): Likewise, for completeness (it wasn't necessary).
9294 2001-09-06 Paul Eggert <eggert@twinsun.com>
9296 * strtoimax.c (HAVE_LONG_LONG):
9297 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9298 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9299 to work around bug in IBM C compiler.
9301 2001-09-16 Jim Meyering <meyering@lucent.com>
9303 * mkdir.c: New file.
9305 2001-09-04 Paul Eggert <eggert@twinsun.com>
9307 * xgetcwd.c: Revert some of the previous change; intead,
9308 fix the HAVE_GETCWD_NULL code to behave more like the
9309 !HAVE_GETCWD_NULL code used to.
9312 (xgetcwd): Do not return NULL when memory is exhausted; instead,
9315 2001-09-04 Paul Eggert <eggert@twinsun.com>
9317 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
9318 Use ssize_t, not int, to store result of readlink.
9319 Check for ssize_t overflow as well as size_t overflow,
9320 as POSIX says the result of readlink is implementation-defined
9321 when ssize_t overflows.
9322 Remove unnecessary cast to char*.
9323 Use free+malloc instead of realloc, as the storage doesn't need
9324 to be preserved and it's clearer and can be more efficient that way.
9325 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9326 * xreadlink.h (xreadlink): Update prototype.
9328 2001-09-03 Paul Eggert <eggert@twinsun.com>
9330 * exclude.c (fnmatch_no_wildcards): Fix confusion between
9331 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
9332 spotted by Jim Meyering.
9334 2001-09-03 Jim Meyering <meyering@lucent.com>
9336 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9338 2001-09-03 Paul Eggert <eggert@twinsun.com>
9340 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9341 like the HAVE_GETCWD_NULL code.
9342 Include pathmax.h if not HAVE_GETCWD.
9343 Do not include xalloc.h.
9344 (INITIAL_BUFFER_SIZE): New symbol.
9345 Do not use xmalloc / xrealloc, since the caller is responsible for
9346 handling errors. Preserve errno around `free' during failure.
9347 Do not overrun buffer when using getwd.
9349 2001-09-03 Paul Eggert <eggert@twinsun.com>
9351 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9352 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9354 2001-09-02 Jim Meyering <meyering@lucent.com>
9356 * error.c: Update from GNU libc.
9358 2001-09-01 Jim Meyering <meyering@lucent.com>
9360 * xreadlink.c: New file.
9361 * xreadlink.h: New file.
9362 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9364 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9365 doesn't conflict with sparc Solaris 7's definition in
9366 /usr/include/sys/int_types.h.
9368 * exclude.c: Use `""', not `<>' to #include non-system header files.
9369 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9370 and strncasecmp as r-values. Unixware didn't have declarations.
9372 2001-08-31 Jim Meyering <meyering@lucent.com>
9374 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9375 Use an initial, malloc'd, buffer of length 128 rather than
9376 a statically allocated one of length 1024.
9378 2001-08-30 Paul Eggert <eggert@twinsun.com>
9380 * xgetcwd.c: Don't include pathmax.h.
9381 Include stdlib.h and unistd.h if available.
9383 (xmalloc, xstrdup, free): Remove decls.
9384 (xgetcwd): Don't assume sizes fit in unsigned.
9385 Check for overflow when computing sizes.
9386 Simplify reallocation code.
9388 2001-08-28 Paul Eggert <eggert@twinsun.com>
9390 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9392 * strtoimax.c: Renamed from strtoxmax.c, removing the
9395 Also, make the following further changes to make this file's
9396 configuration more similar to that of strtol.c:
9397 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
9398 (strtoumax, uintmax_t, strtoull, strtol): Remove.
9399 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9400 (strtoimax): Renamed from strtoumax. All uses of unsigned values
9401 changed to signed values.
9403 And make the following changes as well:
9404 Fix copyright notice, as 1999 was missing.
9405 (verify): New macro.
9406 (strtoimax): Check sizes at compile-time, not run-time.
9407 Prefer strtol to strtoll if both work.
9408 (main): Remove; it was not that useful and was a pain to maintain.
9410 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9412 2001-08-30 Paul Eggert <eggert@twinsun.com>
9414 * savedir.c (savedir): Remove size parameter, as POSIX says that
9415 a directory's st_size can have an arbitrary value, so the old
9416 usage could waste an arbitrary amount of memory. All uses
9418 * savedir.h: Update prototype.
9420 2001-08-30 Paul Eggert <eggert@twinsun.com>
9422 * xstrtol.c (strtoimax): New decl.
9424 2001-08-28 Paul Eggert <eggert@twinsun.com>
9426 * xstrtol.h: Add copyright notice.
9427 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9428 LONGINT_INVALID_SUFFIX_CHAR.
9430 2001-08-30 Paul Eggert <eggert@twinsun.com>
9432 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9435 2001-08-30 Paul Eggert <eggert@twinsun.com>
9437 * hash.c: Remove '2001' from copyright notice.
9439 2001-08-30 Paul Eggert <eggert@twinsun.com>
9441 * full-write.h: New file.
9442 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9443 * full-write.c: Correct credits, as cccp.c no longer
9444 exists and anyway it was so heavily changed from the old cccp
9445 code as to be unrecognizable. Include full-write.h.
9446 (full_write) Return size_t, with short writes meaning failure.
9447 All callers changed. This fixes a bug with large buffers
9449 * utime.c: Include full-write.h.
9451 2001-08-30 Paul Eggert <eggert@twinsun.com>
9453 Merge 'exclude' changes from tar 1.13.22.
9454 This fixes one or two unlikely storage allocation overflow bugs,
9455 but doesn't change user-visible behavior otherwise.
9457 2001-08-30 Paul Eggert <eggert@twinsun.com>
9459 * exclude.c (bool): Declare, perhaps by including stdbool.h.
9460 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9461 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9462 Include if available.
9463 (<xalloc.h>): Include
9464 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9465 (verify): New macro. Use it to verify that EXCLUDE macros do not
9466 collide with FNM macros.
9467 (struct patopts): New struct.
9468 (struct exclude): Use it, as exclude patterns now come with options.
9469 (new_exclude): Support above changes.
9470 (new_exclude, add_exclude_file):
9471 Initial size must now be a power of two to simplify overflow checking.
9472 (free_exclude, fnmatch_no_wildcards): New function.
9473 (excluded_filename): No longer requires options arg, as the options
9474 are determined by add_exclude. Now returns bool, not int.
9475 (excluded_filename, add_exclude):
9476 Add support for the fancy new exclusion options.
9477 (add_exclude, add_exclude_file): Now takes int options arg.
9478 Check for arithmetic overflow when computing sizes.
9479 (add_exclude_file): xrealloc might modify errno, so don't
9480 realloc until after errno might be used.
9482 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9484 (free_exclude): New decl.
9485 (add_exclude, add_exclude_file): Now takes int options arg.
9486 (excluded_filename): No longer requires options arg, as the options
9487 are determined by add_exclude. Now returns bool, not int.
9489 2001-08-30 Paul Eggert <eggert@twinsun.com>
9491 * alloca.c (alloca): Arg is of type size_t, not unsigned.
9493 2001-08-27 Jim Meyering <meyering@lucent.com>
9495 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9497 * version-etc.c (N_): Remove definition.
9498 Revert most of last change.
9499 Instead, simply don't mark the `Copyright...' string for translation.
9500 Based on advice from Paul Eggert.
9502 * strtoxmax.c: Tweak comment.
9504 2001-08-26 Jim Meyering <meyering@lucent.com>
9506 * version-etc.c (version_etc_copyright_fmt): Replace literal year
9507 of copyright with `%s' so translators don't get an untranslated
9509 (COPYRIGHT_YEAR): Define.
9510 (version_etc): Use fprintf rather than fputs.
9511 Suggestion from Ulrich Drepper.
9513 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9515 * strtoll.c: New file, from GNU libc.
9516 * xstrtoimax.c: New file.
9518 * xstrtol.h: Add xstrtoimax.
9519 * strtoumax.c: New file. Simply include "strtoumax.c".
9520 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9522 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9523 * strtoxmax.c: ... then renamed to this.
9525 2001-08-13 Paul Eggert <eggert@twinsun.com>
9527 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9528 Port to Solaris 8, where 'sed' requires a space after the 'r'
9529 command, and where sh dislikes "$/". Clean up the spacing a bit.
9530 Redirect output to $tmp just once.
9532 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9534 * addext.c (<errno.h>): Include.
9535 (errno): Declare if not defined.
9536 (addext): Work correctly when pathconf returns -1 and leaves
9537 errno alone because there is no limit. Also, work even if
9538 pathconf returns a value greater than SIZE_MAX.
9540 2001-08-12 Jim Meyering <meyering@lucent.com>
9542 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9543 Simply `return getcwd (NULL, 0);'.
9544 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9545 Use 1300 as initial value for length, not PATH_MAX.
9547 * pathmax.h: Clean up cpp syntax.
9549 2001-08-12 Jim Meyering <meyering@lucent.com>
9551 * gettimeofday.c: New file.
9553 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9555 2001-08-04 Jim Meyering <meyering@lucent.com>
9557 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9558 to get in sync with glibc.
9560 2001-08-03 Paul Eggert <eggert@twinsun.com>
9562 The following changes are from gettext 0.10.39 as maintained by
9565 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9566 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9567 with inverted sense. All uses changed.
9569 * mbswidth.c: Don't include <limits.h>.
9570 Include <stdlib.h> and <string.h> unconditionally.
9571 (iswcntrl, mbsinit, ISCNTRL): New macros.
9572 (mbsnwidth): Use K&R style function declarations.
9573 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9574 can optimize it when MB_CUR_MAX == 1.
9575 The width of control characters is zero, not 1.
9577 2001-07-15 Jim Meyering <meyering@lucent.com>
9579 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9580 (BUILT_SOURCES): Add unlocked-io.h.
9581 (io_functions): Define.
9582 (unlocked-io.h): New rule.
9583 (DISTCLEANFILES): Add unlocked-io.h.
9584 (all-local): Depend on unlocked-io.h, to ensure it is created.
9586 * unlocked-io.hin: New file
9588 * regex.c: Update from glibc.
9590 2001-07-05 Jim Meyering <meyering@lucent.com>
9592 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9594 (libfetish_a_SOURCES): Put all .h files here instead.
9595 Remove a thus-exposed (better checks in automake) duplicate and
9596 two unnecessary .h files.
9598 2001-06-11 Jim Meyering <meyering@lucent.com>
9600 * regex.c: Update from GNU libc.
9602 2001-05-27 Jim Meyering <meyering@lucent.com>
9604 * readutmp.h (UT_TYPE): Define.
9606 2001-05-24 Jim Meyering <meyering@lucent.com>
9608 * argmatch.c: Include "quote.h".
9609 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9610 quote function. Reported by Göran Uddeborg.
9612 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9614 * dirname.c (dir_name): Compute append_dot using path, not newpath
9615 which is not yet declared.
9617 2001-05-11 Paul Eggert <eggert@twinsun.com>
9619 * Makefile.am (libfetish_a_SOURCES):
9620 Add strftime.c, since we now compile it on all hosts.
9622 * strftime.c (my_strftime):
9623 Define to nstrftime if emacs, but only if my_strftime is not defined.
9624 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9625 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9626 Add one more extra argument: a nanoseconds value.
9629 (my_strftime function): Add %N format.
9630 (emacs_strftimeu): Renamed from emacs_strftime,
9631 with extra ut argument.
9633 2001-05-11 Paul Eggert <eggert@twinsun.com>
9635 dirname code cleanup. base_name now behaves more compatibly
9636 with POSIX basename when given file names that have trailing
9637 slashes, and similarly for dir_name. Add new primitives
9638 base_len and dir_len. Put the directory-name-related decls
9641 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9642 * backupfile.c (base_name): Likewise.
9643 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9644 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9645 * makepath.c (strip_trailing_slashes): Likewise.
9646 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9648 * rename.c (strip_trailing_slashes): Likewise.
9649 * same.c (base_name): Likewise.
9650 * stripslash.c (ISSLASH): Likewise.
9652 * addext.c: Include <dirname.h> after size_t is defined.
9653 * backupfile.c: Likewise.
9655 * addext.c (addext): Use base_len to trim redundant
9656 trailing slashes instead of doing it ourselves.
9657 But do not trim the last slash if it is not redundant.
9659 * backupfile.c (find_backup_file_name,
9660 max_backup_version): Use base_len instead of rolling it ourselves.
9661 Handle the case of "" and (on DOS) "C:" correctly.
9663 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9664 Include <string.h>, <dirname.h>.
9665 (base_name): Allow file names ending in slashes, other than names
9666 that are all slashes. In this case, return the basename followed
9667 by the slashes. This is more general, and can be used in places
9668 where the original base_name purposely had an assertion failure.
9669 (base_len): New function.
9671 * dirname.c: Include <string.h> instead of <stdlib.h>.
9672 Do not include <assert.h>; no longer needed.
9674 (memrchr): Remove decl.
9675 (dir_name_r): Remove.
9676 (dir_len): Renamed from dirlen. All callers changed.
9677 Rewrite in terms of base_name, for simplicity and consistency.
9678 (dir_name): Never return NULL. All callers changed.
9679 Do not include <stdlib.h> in test program; no longer needed.
9680 return 0; is fine for test program.
9682 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9684 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9686 * path-concat.c (path_concat): Use base_len to compute
9687 base length, not strlen; this means we cannot rely on memcpy
9690 * same.c (STREQ): Remove.
9691 (same_name): Handle the case where the basename ends in trailing '/'.
9693 * stripslash.c (strip_trailing_slashes): Return nonzero if
9694 a slash was stripped. Do not strip the last slash after a
9697 2001-04-08 Jim Meyering <meyering@lucent.com>
9699 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9700 recomputed; that's necessary when the offset spans a DST transition.
9701 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9703 2001-04-02 Jim Meyering <meyering@lucent.com>
9705 * regex.h, regex.c: Update from GNU libc.
9707 2001-03-19 Paul Eggert <eggert@twinsun.com>
9709 * version-etc.c (version_etc_copyright): Update to 2001.
9711 2001-03-16 Paul Eggert <eggert@twinsun.com>
9713 * tempname.c (uint64_t): Define to uintmax_t if
9714 not defined, and if UINT64_MAX is not defined.
9715 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9716 Reported by John David Anglin.
9718 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9720 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9721 alias if codeset is empty.
9722 * config.charset (BeOS): Use wildcard syntax.
9724 2001-03-13 Jim Meyering <meyering@lucent.com>
9726 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9727 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9730 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9732 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9734 * unicodeio.c (print_unicode_char): Simplify accordingly.
9736 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9738 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9739 support for DOS/DJGPP.
9741 2001-02-28 Paul Eggert <eggert@twinsun.com>
9743 * Makefile.am (libfetish_a_SOURCES):
9744 Add dup-safer.c, fopen-safer.c.
9745 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9747 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9749 2001-02-25 Paul Eggert <eggert@twinsun.com>
9751 The mkstemp replacement is taken from glibc 2.2.2, with some
9752 portability fixes for use outside glibc, as follows:
9754 * tempname.c (struct_stat64): New macro.
9755 (direxists, __gen_tempname): Use it.
9756 This avoids a portability problem with Solaris 8.
9758 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9759 (<stddef.h>, <stdint.h>, <string.h>):
9760 Include only if STDC_HEADERS || _LIBC.
9761 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9762 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9763 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9764 (__set_errno): Define this macro if <errno.h> doesn't.
9765 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9766 Define these macros if <stdio.h> doesn't.
9767 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9768 Define these macros if <sys/stat.h>
9769 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9770 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9771 __xstat64): Define if not _LIBC.
9772 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9773 (__gen_tempname): Invoke gettimeofday only if
9774 HAVE_GETTIMEOFDAY || _LIBC;
9775 otherwise, fall back on plain "time".
9776 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9778 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9780 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9782 2001-02-17 Jim Meyering <meyering@lucent.com>
9784 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9785 around included file name.
9787 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9789 * strftime.c: Update from GNU libc (the only changes were to comments).
9791 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9793 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9795 2001-02-17 Paul Eggert <eggert@twinsun.com>
9797 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9798 Remove workaround macros for hosts that have mbrtowc but not
9799 mbstate_t, as we now insist on proper declarations for both
9800 before using mbrtowc.
9802 2001-02-17 Jim Meyering <meyering@lucent.com>
9804 * regex.c: Update from libc.
9806 2001-02-16 Paul Eggert <eggert@twinsun.com>
9808 * alloca.c (malloc): Undef before defining, since stdlib.h
9809 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9810 Reported by Mark Hounschell via Paul Eggert.
9812 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9814 * config.charset: Update for FreeBSD 4.2.
9816 2001-01-26 Jim Meyering <meyering@lucent.com>
9818 * quotearg.c: Include stddef.h.
9819 * quote.c: Include stddef.h.
9820 Reported by Axel Kittenberger.
9822 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9823 line in double quotes so that it evokes a better diagnostic.
9824 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9825 Reported by Axel Kittenberger.
9827 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9829 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9830 to avoid a warning. Add back 'const' to inptr.
9832 2001-01-16 Jim Meyering <meyering@lucent.com>
9834 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9837 2001-01-14 Jim Meyering <meyering@lucent.com>
9839 * rename.c: New file. From Volker Borchert.
9840 Include stdlib.h, string.h or strings.h, and xalloc.h.
9841 Use strip_trailing_slashes rather than open-coding it.
9843 2001-01-03 Paul Eggert <eggert@twinsun.com>
9845 * strftime.c: Sync with glibc time/strftime.c 1.81.
9847 2001-01-03 Jim Meyering <meyering@lucent.com>
9849 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9850 local `inptr' to avoid warning with some system declarations of iconv.
9852 2000-12-29 Paul Eggert <eggert@twinsun.com>
9854 * modechange.c: Do not assume that mode_t uses the
9855 traditional octal encoding. E.g. "chmod 1 FOO" should set
9856 the other-execute bit of FOO even if S_IXOTH != 1.
9858 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9859 WOTH, XOTH, ALLM): New macros.
9860 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9861 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9863 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9864 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9866 No need to use uintmax_t; unsigned long is long enough.
9867 Don't bother to get suffix since we don't use it.
9869 2000-12-24 Jim Meyering <meyering@lucent.com>
9871 * hash.c (is_prime): Return explicit boolean values.
9872 (hash_get_first): Return NULL to appease Irix5.6's 89.
9873 Reported by Nelson Beebe.
9875 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9877 * localcharset.c (locale_charset): Add support for Win32.
9879 2000-12-18 Paul Eggert <eggert@twinsun.com>
9881 * physmem.h, physmem.c: New files.
9883 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9884 (noinst_HEADERS): Add physmem.h.
9886 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9887 't' for compatibility with Solaris 8 sort.
9889 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9891 * config.charset: Add support for BeOS.
9893 2000-12-16 Jim Meyering <meyering@lucent.com>
9895 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9896 SHELLS_FILE to a file name that's useful on djgpp systems.
9898 (ADDITIONAL_DEFAULT_SHELLS): Define.
9899 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9900 Based mostly on a patch from Prashant TR.
9902 2000-12-16 Jim Meyering <meyering@lucent.com>
9904 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9905 N and M) would have treated it like `chown N:N FILE'.
9907 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9909 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9911 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9912 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9913 to the list of canonical encodings. Rename EUC-CN to GB2312.
9915 2000-12-08 Andreas Schwab <schwab@suse.de>
9917 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9918 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9920 2000-12-07 Jim Meyering <meyering@lucent.com>
9922 * stripslash.c (ISSLASH): Define.
9923 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9926 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9927 (dir_name_r): Declare this function as static.
9928 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9929 manifest itself on a name containing a mix of slashes and
9931 Make this function work with names starting with a DOS-style
9932 drive letter and colon prefix.
9933 (dir_name): Append `.' if necessary.
9934 Based mostly on patches from Prashant TR and Eli Zaretskii.
9936 * dirname.h (dir_name_r): Remove prototype.
9938 2000-12-05 Jim Meyering <meyering@lucent.com>
9940 * dirname.c (dir_name_r): Add `const' in a few local declarations.
9942 2000-12-04 Jim Meyering <meyering@lucent.com>
9944 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9945 Also include memory.h, stdlib.h, unistd.h if appropriate.
9946 Reported by Andreas Jaeger (conflicting declaration of malloc).
9948 2000-12-02 Jim Meyering <meyering@lucent.com>
9950 * closeout.h: Make idempotent, to avoid some obscure warnings.
9952 2000-12-01 Paul Eggert <eggert@twinsun.com>
9954 * memrchr.c: Include <config.h> before any system include file.
9956 2000-11-29 Paul Eggert <eggert@twinsun.com>
9958 * dirname.c (dir_name_r): Fix typo: int -> size_t.
9960 2000-11-26 Jim Meyering <meyering@lucent.com>
9962 * memcoll.c: Include sys/types.h. From Werner Almesberger.
9964 2000-11-22 Paul Eggert <eggert@twinsun.com>
9966 * strftime.c (my_strftime): Do not invoke mbrlen with a
9967 size of (size_t) -1; it's not portable.
9969 2000-11-17 Akim Demaille <akim@epita.fr>
9971 * obstack.h: Formatting changes.
9972 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9973 prevent type checking.
9974 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9975 cast the value to (void *): assigning a `foo *' to a `void *'
9977 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9979 2000-11-17 Jim Meyering <meyering@lucent.com>
9981 * strstr.c: Update from GNU libc.
9983 2000-11-16 Jim Meyering <meyering@lucent.com>
9985 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9987 2000-11-11 Jim Meyering <meyering@lucent.com>
9989 * error.c: Add a couple #includes, merging from GNU libc version.
9991 2000-11-10 Jim Meyering <meyering@lucent.com>
9993 * obstack.h: Update from GNU libc.
9994 * obstack.c: Likewise.
9996 2000-11-06 Paul Eggert <eggert@twinsun.com>
9998 * getusershell.c (setusershell): Use rewind rather than
9999 fseek/fseeko, to avoid configuration hassles with fseeko.
10000 Don't bother opening SHELLS_FILE if shellstream is NULL;
10001 it's not necessary.
10003 2000-11-05 Jim Meyering <meyering@lucent.com>
10005 * makepath.h (make_dir): Declare.
10006 * makepath.c (make_dir): Remove `static' attribute.
10009 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
10011 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
10012 last one in a bucket, advance to the next bucket.
10014 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
10016 * fnmatch.c: Do not comment out all the code if we are using
10017 the GNU C library, because in some cases we are replacing buggy
10018 code in the GNU C library itself.
10020 2000-10-30 Paul Eggert <eggert@twinsun.com>
10022 * error.h, getline.h, modechange.h:
10023 Remove "2000" from Copyright line, as the file hasn't been
10024 changed this year other than in the copyright notice.
10026 * xalloc.h: Add "2000" to Copyright line, as this file
10027 was changed this year.
10029 2000-10-30 Paul Eggert <eggert@twinsun.com>
10031 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
10032 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10033 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10035 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
10037 * regex.h (__restrict_arr): Move definition out of #ifndef block.
10038 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
10039 doesn't define __restrict_arr.
10041 2000-10-29 Jim Meyering <meyering@lucent.com>
10043 * xstat.in: Fix grammar in comment.
10045 2000-10-28 Jim Meyering <meyering@lucent.com>
10047 * memchr.c: Update from libc.
10048 Adjust for portability:
10049 [HAVE_STDLIB_H]: Include stdlib.h.
10050 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
10051 Undef __memchr, too.
10052 [!weak_alias]: Define __memchr to memchr.
10054 * regex.c: Update from libc.
10055 * regex.h: Likewise.
10056 * getopt1.c: Likewise.
10057 * memcmp.c: Likewise.
10059 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
10060 Avoid using fseek, when possible -- it's broken by design.
10061 Patch by Ulrich Drepper.
10063 2000-10-26 Jim Meyering <meyering@lucent.com>
10065 * strftime.c: Update from libc.
10067 2000-10-25 Jim Meyering <meyering@lucent.com>
10069 * obstack.c: Update from libc.
10071 2000-10-23 Jim Meyering <meyering@lucent.com>
10073 * hard-locale.c (hard_locale): Revert last change -- it was simply
10074 wrong. That set_locale call must not have any side effects.
10077 2000-10-22 Jim Meyering <meyering@lucent.com>
10079 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10080 [CYCLIC]: Remove now-unused definition.
10082 * save-cwd.c (O_DIRECTORY): Define, if needed.
10083 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10084 Suggestion from Ulrich Drepper.
10086 2000-10-21 Jim Meyering <meyering@lucent.com>
10088 * dirname.c (dir_name_r): New function, factored out of dir_name.
10089 (dir_name): Use dir_name_r.
10090 * dirname.h (dir_name_r): Declare it.
10092 2000-10-21 Jim Meyering <meyering@lucent.com>
10094 * dirname.c (memrchr): Declare if necessary.
10095 (dir_name): Remove the restriction that there be no
10096 trailing slashes. Now, this code skips past them, effectively
10098 [TEST_DIRNAME] (main): New unit tests.
10100 * memrchr.c: New file from GNU libc.
10101 Undef __memrchr, too.
10102 [!weak_alias]: Define __memrchr to memrchr.
10103 Guard weak_alias use with `#ifdef weak_alias'.
10105 2000-10-17 Jim Meyering <meyering@lucent.com>
10107 * quote.h (PARAMS): Define and use.
10108 Reported by Akim Demaille.
10110 * getopt.c: Update from libc.
10112 2000-10-16 Jim Meyering <meyering@lucent.com>
10114 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10117 2000-09-25 Jim Meyering <meyering@lucent.com>
10119 * md5.h (rol): Define (from GnuPG).
10121 * sha.c: Give credit (GnuPG) where due.
10122 (M): Use rol rather than open-coding it.
10123 Add a FIXME comment.
10125 2000-09-21 Jim Meyering <meyering@lucent.com>
10127 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10128 Reported by Michael Stone.
10130 2000-09-20 Jim Meyering <meyering@lucent.com>
10132 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10133 (noinst_HEADERS): Add sha.h.
10134 Based on code from Scott G. Miller and from GnuPG.
10136 2000-09-15 Jim Meyering <meyering@lucent.com>
10138 * regex.c: Update from libc.
10140 2000-09-10 Jim Meyering <meyering@lucent.com>
10142 * getopt.c (_getopt_internal): Update from glibc.
10144 2000-09-09 Jim Meyering <meyering@lucent.com>
10146 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10147 think it should be used as a general replacement for isascii.
10148 * fnmatch.c: Likewise.
10149 * mbswidth.c: Likewise
10150 * regex.c: Likewise.
10153 * userspec.c: Include sys/param.h and limits.h.
10155 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10156 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10157 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10158 UID, GID. Check range.
10160 2000-09-06 Jim Meyering <meyering@lucent.com>
10162 * getopt.c (_getopt_internal): Update from glibc.
10164 2000-08-30 Jim Meyering <meyering@lucent.com>
10166 * strftime.c: Merge in changes from GNU libc.
10168 2000-08-26 Jim Meyering <meyering@lucent.com>
10170 * closeout.c: Include "__fpending.h".
10171 (close_stdout_status): Return right away if there's nothing to flush.
10173 * Makefile.am (noinst_HEADERS): Add __fpending.h.
10174 * __fpending.c: New file.
10175 * __fpending.h: New file.
10177 2000-08-07 Paul Eggert <eggert@twinsun.com>
10179 Standardize on "memory exhausted" instead of "Memory exhausted"
10180 or "virtual memory exhausted".
10181 * obstack.c (print_and_abort): Use "memory exhausted", not
10182 "virtual memory exhausted".
10183 * same.c (same_name): Invoke xalloc_die instead of printing
10185 * userspec.c (parse_user_spec): Likewise.
10186 * bumpalloc.h: comment fix
10187 * same.c, userspec.c: Include xalloc.h.
10189 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10190 not char *const and pointing to a constant array.
10191 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10192 (xrealloc): Comment fix.
10194 * userspec.c (parse_user_spec):
10195 Don't translate a message until just before returning,
10196 to avoid unnecessary translation.
10198 2000-08-07 Jim Meyering <meyering@lucent.com>
10200 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10201 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10202 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10203 getgroups.c, gethostname.c, getopt.h, group-member.c,
10204 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10205 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10206 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10207 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10208 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10209 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10210 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10211 yesno.c: Back out Copyright date changes for each file with no change
10212 this year. This eases coordination with other programs using the same
10213 source code modules. From Paul Eggert.
10215 2000-08-03 Greg McGary <greg@mcgary.org>
10217 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10218 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10219 (EXTEND_BUFFER): Use them.
10221 2000-08-01 Jim Meyering <meyering@lucent.com>
10223 * dirname.c (ISSLASH): Define.
10224 (BACKSLASH_IS_PATH_SEPARATOR): Define.
10225 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10226 both `\' and `/' may be use as path separators.
10227 Based on a patch from Prashant TR.
10229 2000-07-31 Paul Eggert <eggert@twinsun.com>
10231 * quotearg.c (quotearg_n_options): Don't make the initial
10232 slot vector a constant, since it might get modified.
10234 2000-07-31 Jim Meyering <meyering@lucent.com>
10236 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10237 * obstack.c (print_and_abort): Likewise.
10239 2000-07-30 Paul Eggert <eggert@twinsun.com>
10241 * quotearg.c (quotearg_n_options): Preallocate a slot 0
10242 buffer, so that the caller can always quote one small
10243 component of a "memory exhausted" message in slot 0.
10244 From a suggestion by Jim Meyering.
10246 2000-07-30 Jim Meyering <meyering@lucent.com>
10248 * makepath.c (make_path): Quote the other instance, too.
10250 * quotearg.c (N_STATIC_SLOTVECS): Define.
10251 (STATIC_BUF_SIZE): Define.
10252 (quotearg_n_options): Use only statically allocated storage when
10253 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10254 than STATIC_BUF_SIZE.
10256 2000-07-29 Jim Meyering <meyering@lucent.com>
10258 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10259 * dirname.c (dir_name): Likewise.
10261 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10263 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10264 (dir_name): Assert that there are no trailing slashes.
10266 2000-07-18 Bruno Haible <haible@clisp.cons.org>
10268 * mbswidth.h (mbswidth): Add a flags argument.
10269 (mbswidth): New declaration.
10270 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10271 * mbswidth.c (mbswidth): Add a flags argument.
10272 (mbsnwidth): New function.
10274 2000-07-24 Jim Meyering <meyering@lucent.com>
10276 * mbswidth.c: Remove useless #else. From Bruno Haible.
10278 2000-07-23 Paul Eggert <eggert@twinsun.com>
10280 * mbswidth.c (_XOPEN_SOURCE):
10281 Don't define; this causes problems on Solaris 7.
10282 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10284 2000-07-23 Paul Eggert <eggert@twinsun.com>
10287 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10288 so that mbstate_t is always defined.
10290 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10291 be 1 in at least one GCC installation, and this configuration
10292 error is likely to be common. Ignoring MB_LEN_MAX hurts
10293 performance on hosts that have mbrtowc but have only unibyte
10294 locales, but I assume these hosts are rare.
10296 2000-07-23 Paul Eggert <eggert@twinsun.com>
10298 * quotearg.c: Streamline by invoking multibyte code only if needed.
10299 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10300 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10301 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10302 invoke multibyte primitives.
10304 2000-07-23 Jim Meyering <meyering@lucent.com>
10306 * basename.c (base_name): Add an assertion.
10308 2000-07-15 Bruno Haible <clisp.cons.org>
10310 * quotearg.c: When the system forces us to redefine mbstate_t,
10311 shadow its mbsinit function.
10313 2000-07-16 Bruno Haible <haible@clisp.cons.org>
10315 * mbswidth.h: New file.
10316 * mbswidth.c: New file.
10317 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10318 (noinst_HEADERS): Add mbswidth.h.
10320 2000-07-17 Bruno Haible <haible@clisp.cons.org>
10322 * config.charset: Add support for FreeBSD. Improve support for HP-UX
10325 2000-07-15 Jim Meyering <meyering@lucent.com>
10327 * makepath.c: Include quote.h.
10328 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10329 corresponding argument in a `quote (...)' call.
10330 Give better diagnostics.
10332 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10333 (noinst_HEADERS): Add quote.h.
10335 * quote.c (quote, quote_n): New file. Two functions taken verbatim
10336 from tar's src/misc.c.
10337 * quote.h: New file. Prototypes for same.
10339 2000-07-10 Paul Eggert <eggert@twinsun.com>
10341 From a suggestion by Bruno Haible.
10342 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10343 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10344 to decide whether to define the BeOS workaround macro;
10345 this adjusts to the change to AC_MBSTATE_T.
10347 2000-07-13 Paul Eggert <eggert@twinsun.com>
10349 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10351 * quotearg.c (quoting_style_args, quoting_style_vals,
10352 quotearg_buffer_restyled): Add support for
10353 clocale_quoting_style. Undo previous change to
10354 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10355 and "{RIGHT QUOTATION MARK}" msgids.
10357 2000-07-05 Paul Eggert <eggert@twinsun.com>
10359 The old behavior of quoting `like this' doesn't look good with
10360 newer, ISO-style fonts. See:
10361 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10363 Instead, quote "like this" by default. Let the translator
10364 tailor the locale-specific quoting behavior by providing
10365 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10367 * quotearg.c (N_): New macro.
10368 (gettext_default): New function.
10369 (quotearg_buffer_restyled): Use
10370 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10371 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10373 2000-07-09 Jim Meyering <meyering@lucent.com>
10375 * Most files: Update copyright dates to include 2000.
10377 2000-07-08 Jim Meyering <meyering@lucent.com>
10379 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10381 (xgethostname): Remove now-unnecessary #ifdef.
10382 Move declaration of `err' into loop where it's used.
10384 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10386 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10387 by allocating a larger buffer. Test the gethostname return value for
10388 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
10389 returns an error and ENAMETOOLONG isn't defined.
10391 2000-07-05 Paul Eggert <eggert@twinsun.com>
10392 and Bruno Haible <haible@clisp.cons.org>
10394 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10396 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10398 * quotearg.c (struct quoting_options): Simplify quote_these_too
10401 2000-07-03 Jim Meyering <meyering@lucent.com>
10403 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10404 Reported by Bruno Haible.
10406 2000-07-04 Jim Meyering <meyering@lucent.com>
10408 * quotearg.c: Make inclusion of <wchar.h> independent of whether
10409 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
10412 2000-07-03 Paul Eggert <eggert@twinsun.com>
10413 and Bruno Haible <haible@clisp.cons.org>
10415 * quotearg.c (mbrtowc):
10416 Assign to *pwc, and return 1 only if result is nonzero.
10417 (iswprint): Use ISPRINT when substituting our own mbrtowc.
10419 2000-07-03 Jim Meyering <meyering@lucent.com>
10421 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10422 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10425 2000-07-02 Jim Meyering <meyering@lucent.com>
10427 * quotearg.c (mbstate_t): Don't define here.
10429 2000-07-02 Jim Meyering <meyering@lucent.com>
10431 * nanosleep.c (SIGCONT): Define if not already defined.
10433 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10435 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10436 per change in ../m4/ls-mntd-fs.m4.
10437 (read_filesystem_list): Ignore symbolic links.
10439 2000-06-29 Jim Meyering <meyering@lucent.com>
10441 * same.c: Include <string.h> or <strings.h>, as appropriate,
10442 for declaration of strcmp.
10444 * long-options.c: Include <stdlib.h>, for declaration of exit.
10446 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10447 Avoid warning by casting result to `char *' to remove `const'.
10449 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10451 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10453 2000-06-26 Paul Eggert <eggert@twinsun.com>
10455 savedir now sets errno on failure and invokes xmalloc to get memory.
10456 Fix a couple of other minor bugs while we're at it.
10458 * savedir.c (<unistd.h>): Do not include; there's no need.
10459 (NAMLEN): Remove macro.
10460 (malloc, realloc): Remove decls.
10461 (stpcpy): Likewise.
10462 ("xalloc.h"): Include.
10463 (NAME_SIZE_DEFAULT): New macro.
10464 (savedir): Use xmalloc / xrealloc to allocate memory.
10465 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10466 Skip "" directory entries.
10467 Use strlen to calculate directory entry length, since the old method
10468 is rarely used these days and isn't worth supporting.
10469 Don't use a pointer after freeing it.
10470 Check for integer overflow when calculating allocation size.
10471 Use memcpy to copy entries, instead of stpcpy.
10472 Set errno properly when returning NULL.
10473 Check for readdir error.
10475 2000-06-26 Jim Meyering <meyering@lucent.com>
10477 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10479 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10481 * getusershell.c (xmalloc, xrealloc): Remove functions.
10483 Don't include <stdlib.h>. Don't declare malloc, realloc.
10485 2000-06-23 Bruno Haible <haible@clisp.cons.org>
10487 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10489 2000-06-24 Jim Meyering <meyering@lucent.com>
10491 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10493 2000-06-21 Jim Meyering <meyering@lucent.com>
10495 * getpass.c: New file, from Bruno Haible. Required for BeOS.
10497 2000-06-19 Paul Eggert <eggert@twinsun.com>
10499 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10500 (mbrtowc, mbstate_t): Define substitutes if
10501 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10502 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10503 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10505 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10507 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10508 than 1024, return a memory chunk of least possible size, instead
10509 of size PATH_MAX + 2. In the loop, increment the size proportionally.
10510 Use free/xmalloc instead of xrealloc to avoid copying for very long
10513 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10515 * canon-host.c (canon_host): Use malloc and memcpy to copy an
10516 address, not strdup. Include <stdlib.h> and don't declare free().
10518 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10520 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10523 2000-06-21 Jim Meyering <meyering@lucent.com>
10525 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10526 (noinst_HEADERS): Add getstr.h.
10528 * getline.c (getstr): Move into a separate file.
10529 * getstr.c (getstr): New file, extracted from getline.c, with
10530 the following changes: new parameter, delim2; both delim[12]
10531 parameters have type `int', not `char'. The latter would lose
10532 with 8-bit delimiters.
10533 * getstr.h: New file.
10535 2000-06-19 Jim Meyering <meyering@lucent.com>
10537 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10539 2000-06-18 Jim Meyering <meyering@lucent.com>
10541 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10542 Besides, these days every porting target provides a mkdir function.
10544 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10545 (this snippet comes from src/system.h).
10547 2000-06-15 Paul Eggert <eggert@twinsun.com>
10549 * human.c (adjust_value): New function.
10550 (human_readable_inexact): Apply rounding style even when
10551 printing approximate values.
10553 2000-06-14 Paul Eggert <eggert@twinsun.com>
10555 * human.c (human_readable_inexact): Allow an input block
10556 size that is not a multiple of the output block size, and vice versa.
10557 Reported by Piergiorgio Sartor.
10559 2000-06-14 Paul Eggert <eggert@twinsun.com>
10561 * getdate.y (get_date): Apply relative times after time
10562 zone indicator, not before. Reported by Todd A. Jacobs.
10564 2000-06-13 Jim Meyering <meyering@lucent.com>
10566 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10568 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10570 2000-06-12 Paul Eggert <eggert@twinsun.com>
10572 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10574 2000-06-04 Paul Eggert <eggert@twinsun.com>
10576 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10578 2000-06-04 Jim Meyering <meyering@lucent.com>
10580 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10581 SunOS 4.1.4 for which gid_t is an unsigned type.
10583 2000-06-03 Jim Meyering <meyering@lucent.com>
10585 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10587 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10589 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10590 newer, don't install charset.alias.
10591 * config.charset: Change the Linux/glibc rules so they become empty
10592 on glibc-2.1 or newer.
10594 2000-06-02 Jim Meyering <meyering@lucent.com>
10596 * mountlist.c: Back out last change. Instead, do this...
10597 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10598 member using the same `ignore'-testing code.
10599 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10603 2000-05-29 Jim Meyering <meyering@lucent.com>
10605 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10606 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10608 2000-05-22 Jim Meyering <meyering@lucent.com>
10610 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10612 2000-05-18 Jim Meyering <meyering@lucent.com>
10614 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10615 back, too, since it may have been modified by allocate_entry.
10616 (hash_delete): Rewrite to use neither the assignment operator
10617 nor the comma operator in an if-expression.
10619 2000-05-15 Paul Eggert <eggert@twinsun.com>
10622 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10623 Remove; no longer needed.
10624 "quotearg.h": Add include.
10625 (file_name): Do not bother to explicitly initialize to NULL; it's less
10626 efficient on some hosts.
10627 (close_stdout_status): Remove test as to whether stdout was already
10628 closed; it breaks for the case "echo x | sort >&-".
10629 Quote file name colons.
10630 Do not assume that _("write error") lacks format strings.
10632 2000-05-15 Jim Meyering <meyering@lucent.com>
10634 * version-etc.c (version_etc_copyright): Update the copyright string
10635 used in all --version output.
10637 2000-05-14 Jim Meyering <meyering@lucent.com>
10639 * closeout.c (close_stdout_set_file_name): New function.
10640 (close_stdout_status): Use new file-scoped global.
10641 Return right away if fstat says the stdout file descriptor is invalid.
10642 * closeout.h (close_stdout_set_file_name): Declare.
10644 2000-05-10 Jim Meyering <meyering@lucent.com>
10646 * closeout.c [default_exit_status]: New file-scoped variable.
10647 (close_stdout_set_status): New function.
10648 * closeout.h (close_stdout_set_status): Declare.
10650 2000-05-08 Jim Meyering <meyering@lucent.com>
10652 * long-options.c: Don't include closeout.h.
10653 (parse_long_options): Don't call close_stdout for --version.
10655 2000-05-06 Jim Meyering <meyering@lucent.com>
10657 * strnlen.c: Undefine __strnlen and strnlen.
10658 [!weak_alias]: Define __strnlen to strnlen.
10660 * atexit.c: New file, from libiberty.
10662 2000-05-06 Jim Meyering <meyering@lucent.com>
10664 * closeout.c (close_stdout_status): Also check for errors on the
10667 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10669 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10670 instead of xmalloc, xrealloc, path_concat.
10671 (locale_charset): Treat empty environment variables as absent.
10672 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10674 2000-05-04 Jim Meyering <meyering@lucent.com>
10676 * getopt.c: Update from glibc.
10677 * obstack.c: Likewise.
10678 * obstack.h: Likewise.
10679 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10681 * regex.h: Likewise.
10682 * strndup.c: Likewise.
10683 * strnlen.c: New file, from glibc.
10685 2000-05-01 Jim Meyering <meyering@lucent.com>
10687 * full-write.c (full_write): Remove `FIXME' part of comment.
10689 2000-04-29 Jim Meyering <meyering@lucent.com>
10691 * path-concat.c: Declare strdup only if it's not defined.
10692 * canon-host.c: Likewise.
10694 2000-04-28 Jim Meyering <meyering@lucent.com>
10696 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10697 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10698 included first, then limits.h is included by locale.h by libintl.h.
10699 From John David Anglin.
10701 2000-04-25 Jim Meyering <meyering@lucent.com>
10703 * makepath.c (S_IRWXUGO): Define.
10704 (make_path): Always perform explicit chmod if MODE specifies any
10705 of the `special' permission bits. Prompted by a bug report against
10706 install from Mate Wierdl and Joost van Baal.
10708 2000-04-18 Jim Meyering <meyering@lucent.com>
10710 * README: New file.
10712 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10713 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10715 2000-04-17 Jim Meyering <meyering@lucent.com>
10717 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10718 the definition of it to rpl_strftime also defined-away the system's
10721 2000-04-15 Jim Meyering <meyering@lucent.com>
10723 Use `C' to denote so-called `contiguous' files, the same way
10725 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10726 (ftypelet): Use S_ISCTG.
10727 From Michael Deutschmann.
10729 2000-04-14 Jim Meyering <meyering@lucent.com>
10731 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10733 2000-04-08 Jim Meyering <meyering@lucent.com>
10735 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10736 names don't conflict. Reported by Eli Zaretskii.
10738 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10740 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10741 bug. Deal with the different error behavior of Irix iconv.
10743 2000-04-07 Jim Meyering <meyering@lucent.com>
10745 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10746 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10748 2000-04-05 Jim Meyering <meyering@lucent.com>
10750 Portability tweaks required for ultrix4.3.
10751 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10752 * readutmp.c: Include sys/types.h before sys/stat.h.
10753 * canon-host.c: Declare strdup.
10754 * path-concat.c: Likewise.
10755 From John David Anglin.
10757 2000-04-04 Jim Meyering <meyering@lucent.com>
10759 Be more DOS 8.3-friendly.
10760 * ref-add.sin: Renamed from ref-add.sed.in.
10761 * ref-del.sin: Renamed from ref-del.sed.in.
10762 * Makefile.am: Reflect renaming.
10763 Reported by Eli Zaretskii.
10765 Use a temporary file name that won't clash with `charset.alias'
10766 in the DOS 8.3 name space.
10767 * Makefile.am (charset_tmp): Define.
10768 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10769 (uninstall-local): Likewise.
10770 Reported by Eli Zaretskii.
10772 2000-03-29 Paul Eggert <eggert@twinsun.com>
10774 * time/strftime.c (my_strftime): Make sure we call the system
10775 strftime, not ourselves, when invoking the underlying strftime.
10777 2000-03-24 Jim Meyering <meyering@lucent.com>
10779 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10780 (charset_alias): Define.
10781 (install-exec-local): Factor out common code.
10782 (uninstall-local): Split lines longer than 80.
10783 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10784 (SUFFIXES): Define.
10785 (.sed.in.sed): New rule. Don't redirect directly to $@.
10786 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10788 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10790 * config.charset: Output a line containing "Packages using this file".
10791 * ref-add.sed.in, ref-del.sed.in: New files.
10792 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10793 ref-del.sed): New rules.
10795 2000-03-17 Jim Meyering <meyering@lucent.com>
10797 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10798 Otherwise, include <strings.h>
10800 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10802 * unicodeio.c (utf8_wctomb): New function.
10803 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10804 format instead of in UCS-4 with platform dependent endianness.
10806 2000-03-07 Paul Eggert <eggert@twinsun.com>
10808 * savedir.c (savedir): Work even if directory size is
10809 negative; this can happen with some screwy NFS configurations.
10811 2000-03-06 Jim Meyering <meyering@lucent.com>
10813 * localcharset.c (get_charset_aliases): Don't try to free file_name
10814 if it's NULL (because we ran out of memory). From Bruno Haible.
10816 2000-03-05 Jim Meyering <meyering@lucent.com>
10818 * localcharset.c ("path-concat.h"): Include.
10819 (get_charset_aliases): Use path_concat instead of ANSI string
10822 * unicodeio.h (PARAMS): Define.
10823 Use it to guard prototype.
10825 2000-03-04 Jim Meyering <meyering@lucent.com>
10827 * Makefile.am (install-exec-local): Create $(libdir) before installing
10829 (uninstall-local): Uncomment this rule so `make distcheck' works
10832 * unicodeio.c (<errno.h>): Include it.
10833 (errno): Declare if not defined.
10835 * localcharset.c: Add Bruno's comment justifying use of volatile.
10837 * config.charset: New version, incorporating remarks from a linux
10838 i18n mailing list. From Bruno Haible.
10840 2000-03-02 Jim Meyering <meyering@lucent.com>
10842 * Makefile.am (EXTRA_DIST): Add config.charset.
10844 2000-03-01 Jim Meyering <meyering@lucent.com>
10846 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10847 * unicodeio.c: Likewise.
10849 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10851 * config.charset: New file.
10852 * localcharset.c: New file.
10853 * unicodeio.h, unicodeio.c: New files.
10854 * Makefile.am (DEFS): Add -DLIBDIR=...
10855 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10856 (noinst_HEADERS): Add unicodeio.h.
10857 (all-local, install-exec-local, charset.alias): New targets.
10859 2000-02-28 Paul Eggert <eggert@twinsun.com>
10861 * quotearg.c (ALERT_CHAR): New macro.
10862 (quotearg_buffer_restyled): Use it.
10864 2000-02-27 Jim Meyering <meyering@lucent.com>
10866 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10867 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10869 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10870 not `#if STDC_HEADERS'.
10871 Declare malloc if needed.
10873 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10874 now that autoconf always defines the HAVE_DECL_ symbols.
10875 * human.c: Likewise.
10876 * same.c: Likewise.
10877 * strtoumax.c: Likewise.
10879 * backupfile.c: Arrange for cpp to fail if the configure-time
10880 declaration check was not run.
10881 * hash.c: Likewise.
10882 * human.c: Likewise.
10883 * same.c: Likewise.
10884 * strtoumax.c: Likewise.
10886 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10887 then first look up the entire `.'-containing string as a login name.
10889 2000-02-18 Paul Eggert <eggert@twinsun.com>
10891 * getdate.y: Handle two-digit years with leading zeros correctly.
10892 (textint): New typedef.
10893 (parser_control): Member year changed from int to textint.
10895 (YYSTYPE): Removed; replaced by %union with int and textint members.
10896 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10897 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10898 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10899 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10900 (date, number, to_year): Use width of number in digits, not its value,
10901 to determine whether it's a 2-digit year, or a 2-digit time.
10902 (yylex): Store number of digits of numeric tokens.
10903 Reported by John Kendall.
10905 (parser_control): Changed from struct parser_control to typedef (for
10906 consistency). All uses changed.
10908 (tID): Removed; not used.
10909 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10911 2000-02-14 Paul Eggert <eggert@twinsun.com>
10913 * getpagesize.h (getpagesize): Port to VMS for Alpha;
10914 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10916 2000-02-12 Jim Meyering <meyering@lucent.com>
10918 * userspec.c (ISDIGIT): Define it.
10919 (isdigit): Remove definition.
10920 (is_number): Use ISDIGIT, not isdigit.
10921 <libintl.h>: Include.
10922 (_ and N_): Define.
10923 (parse_user_spec): Mark translatable strings.
10925 2000-02-10 Jim Meyering <meyering@lucent.com>
10927 With these changes, nanosleep.[ch] are finally enough like the other
10928 lib/* replacement files to compile on a few more losing systems.
10930 * nanosleep.h: Don't include config.h.
10931 Remove prototype from declaration of nanosleep.
10932 (PARAMS): Remove now-unneeded definition.
10933 * nanosleep.c: #undef nanosleep.
10934 (rpl_nanosleep): Rename from nanosleep.
10936 2000-02-03 Jim Meyering <meyering@lucent.com>
10938 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10939 rather than with `#if HAVE_UTMPNAME'.
10941 2000-02-01 Jim Meyering <meyering@lucent.com>
10943 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
10945 2000-01-31 Jim Meyering <meyering@lucent.com>
10947 * nanosleep.h (nanosleep): Guard declaration with
10948 `#if ! HAVE_DECL_NANOSLEEP'.
10949 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10950 the declaration in that vendor's sys/timers.h.
10951 Reported by Christian Krackowizer.
10953 * quotearg.c (ISASCII): Add #undef and move definition to follow
10954 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10955 (ISPRINT): Likewise.
10956 Reported by Tom Tromey.
10958 2000-01-30 Jim Meyering <meyering@lucent.com>
10960 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10961 uses of ->ut_name. The latter doesn't work with new Linux header files
10962 where only utmpx.ut_user is declared.
10964 * readutmp.h (UT_USER): Define.
10966 2000-01-23 Jim Meyering <meyering@lucent.com>
10968 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10971 2000-01-22 Jim Meyering <meyering@lucent.com>
10973 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10974 [! HAVE_DECL_STRTOULL]: Declare strtoull.
10975 Required for some AIX systems. Reported by Christian Krackowizer.
10976 [TESTING] (main): New function.
10978 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
10979 * dirname.c (dir_name): Support for DOS-style file names with drive
10982 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10984 * strverscmp.c (ISDIGIT): Define.
10985 (strverscmp): Use ISDIGIT, not isdigit.
10987 2000-01-17 Paul Eggert <eggert@twinsun.com>
10989 * nanosleep.c (nanosleep):
10990 Don't use SA_INTERRUPT to decide whether to call sigaction, as
10991 POSIX.1 doesn't require SA_INTERRUPT and some systems
10992 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
10993 it's been part of POSIX.1 since day 1 (in 1988).
10995 2000-01-17 Jim Meyering <meyering@lucent.com>
10997 * interlock: Remove unused file. Reported by François Pinard.
10999 2000-01-16 Paul Eggert <eggert@twinsun.com>
11001 * quotearg.c (quotearg_buffer_restyled): Do not quote
11002 alert, backslash, formfeed, and vertical tab unnecessarily in
11003 shell quoting style.
11006 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
11007 Free Software Foundation, Inc.
11008 Copying and distribution of this file, with or without modification,
11009 are permitted provided the copyright notice and this notice are preserved.