1 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
4 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
6 * dirchownmod.c: Likewise.
9 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
10 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
11 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
12 just before including <inttypes.h>, to avoid circular inclusion.
14 2006-08-28 Bruno Haible <bruno@clisp.org>
16 * inttypes_.h (SCNX*): Remove definitions.
17 Reported by Eric Blake.
19 2006-08-26 Bruno Haible <bruno@clisp.org>
21 * vasnprintf.c (EOVERFLOW): Remove definition.
22 (VASNPRINTF): Return a string of length > INT_MAX without failing.
23 * vasprintf.c: Include errno.h, limits.h.
24 (EOVERFLOW): New fallback definition.
25 (vasprintf): Test here whether the string length is > INT_MAX.
26 * vsnprintf.c: Include errno.h, limits.h.
27 (EOVERFLOW): New fallback definition.
28 (vsnprintf): Fix bug when generated string was too long for the buffer.
29 Test here whether the string length is > INT_MAX.
31 2006-08-26 Bruno Haible <bruno@clisp.org>
32 Simon Josefsson <jas@extundo.com>
35 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
37 2006-08-28 Bruno Haible <bruno@clisp.org>
39 * c-strstr.h: New file, from GNU gettext.
40 * c-strstr.c: New file, from GNU gettext.
42 2006-08-26 Bruno Haible <bruno@clisp.org>
44 * inttypes_.h: New file.
45 * inttypes.h: Remove file.
46 * stdint_.h: Include <inttypes.h> through its absolute filename.
48 * imaxabs.c: New file.
50 * imaxdiv.c: New file.
52 2006-08-22 Bruno Haible <bruno@clisp.org>
54 * readutmp.h: Skip most definitions if neither <utmp.h> nor
57 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
60 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
61 Problem reported by Bruno Haible.
63 2006-08-21 Bruno Haible <bruno@clisp.org>
66 * mbchar.h: Include <wctype.h> only if it exists.
68 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
70 * cycle-check.h: Include <stdint.h> unconditionally, since we
71 now assume the stdint module. Do not include inttypes.h.
72 * fsusage.h: Likewise.
73 * getndelim2.c: Likewise.
75 * inttostr.h: Likewise.
76 * obstack.c: Likewise.
77 * regex_internal.h: Likewise.
78 * tempname.c: Likewise.
79 * utimecmp.c: Likewise.
80 * xstrtol.h: Likewise.
82 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
84 * strtoimax.c: Adjust to macro name changes in Autoconf,
85 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
88 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
90 * fchmodat.c: New file, from coreutils. This was inadvertently
91 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
93 2006-08-18 Bruno Haible <bruno@clisp.org>
95 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
96 (ME_DUMMY): Treat "kernfs" as a dummy.
97 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
99 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
101 Update from coreutils.
103 * __fpending.h: Add copyright notice.
104 * fprintftime.h: Likewise.
105 * savedir.c: Use (C) in copyright notice.
106 * savedir.h: Likewise.
108 2006-08-15 Jim Meyering <jim@meyering.net>
110 * at-func.c: New file, with the logic of all emulated at-functions.
111 * openat-priv.h: Include <errno.h> and define ENOSYS,
112 in support of the EXPECTED_ERRNO macro.
113 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
114 Instead, define the appropriate symbols and include "at-func.c".
115 * mkdirat.c (mkdirat): Likewise.
116 * fchmodat.c (fchmodat): Likewise.
117 (ENOSYS): Remove definition.
118 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
119 Don't include "unistd--.h" -- it wasn't ever used.
121 2006-01-17 Jim Meyering <jim@meyering.net>
123 Rewrite fts.c not to change the current working directory,
124 by using openat, fstatat, fdopendir, etc..
126 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
127 (HAVE_OPENAT_SUPPORT): Define.
128 [_LIBC] (fchdir): Don't undef or define; no longer used.
129 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
130 Now, this `function' always succeeds, and consumes its file descriptor
131 parameter -- so callers must not close such FDs. Update callers.
132 (diropen_fd, opendirat, cwd_advance_fd): New functions.
133 (diropen): Add parameter, SP. Adjust all callers.
134 Implement using diropen_fd, rather than open.
135 (fts_open): Initialize new member, fts_cwd_fd.
136 Remove fts_rft-setting code.
137 (fts_close): Close fts_cwd_fd, if necessary.
138 (__opendir2): Define in terms of opendir or opendirat,
139 depending on whether the FST_NOCHDIR flag is set.
140 (fts_build): Since fts_safe_changedir consumes its FD, and since
141 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
142 and close the dup'd file descriptor upon failure.
143 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
144 (fts_safe_changedir): Tweak semantics to reflect that this function
145 now calls cwd_advance_fd and hence consumes its FD argument.
146 * fts_.h [struct FTS] (fts_cwd_fd): New member.
147 [struct FTS] (fts_rft): Remove now-unused member.
148 [struct FTS] (fts_cycle.state): Improve comment.
150 * openat.c (openat_needs_fchdir): New function.
151 * openat.h (openat_needs_fchdir): Declare it.
153 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
155 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
156 Problem and fix reported by Pádraig Brady in
157 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
159 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
161 * memcoll.c (memcoll): Optimize for the common case where the
162 arguments are bytewise equal.
164 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
166 Change copyright notice from LGPL 2 to GPL 2, since that's the
167 standard form used in the gnulib repository.
168 * lock.c: LGPL -> GPL.
170 * strnlen1.c: Likewise.
171 * strnlen1.h: Likewise.
174 * tmpdir.c: Likewise.
176 * TODO: Remove; this belongs only in coreutils.
178 2006-08-14 Eric Blake <ebb9@byu.net>
180 Import the following change from libc:
182 2006-08-12 Ulrich Drepper <drepper@redhat.com>
185 * misc/error.c: Add space between program name and message if file
188 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
190 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
191 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
193 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
194 in wchar_t. Problem reported by Eric Blake.
196 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
197 LEN is smaller than SIZE. Suggested by Bruno Haible.
198 Also, help the compiler to keep LEN in a register.
200 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
202 * .cppi-disable: Add snprintf.h, socket_.h.
203 * snprintf.c: Include <errno.h> and <limits.h>.
204 (EOVERFLOW): Define if the system does not.
205 Do not include "minmax.h"; it wasn't used.
206 (snprintf): Don't assume size_t promotes to an unsigned type.
207 Fix bug when generated string was too long for the buffer: the
208 buffer's contents are supposed to be the initial prefix of the
209 output. Don't assume vasnprintf returns EOVERFLOW if the size
210 exceeds INT_MAX; do the check ourselves.
212 Import the following changes from libc:
214 2006-06-02 Jakub Jelinek <jakub@redhat.com>
216 * posix/regex_internal.c (re_string_skip_chars): If no character has
217 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
218 to the byte which couldn't be converted.
219 (re_string_reconstruct): Don't clear valid_raw_len before calling
220 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
221 tip_context using re_string_context_at.
223 2006-05-02 Ulrich Drepper <drepper@redhat.com>
225 * posix/regex.h: g++ still cannot handled [restrict].
227 2006-04-21 Ulrich Drepper <drepper@redhat.com>
229 * posix/regex.h: Remove special handling for VMS.
231 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
235 2006-07-19 Mike Frysinger <vapier@gentoo.org>
237 * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
238 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
240 2006-08-08 Eric Blake <ebb9@byu.net>
242 * verror.c (verror_at_line): Work around glibc bug 2997, so that
243 verror_at_line output complies with GNU Coding Standards even when
246 2006-08-08 Eric Blake <ebb9@byu.net>
248 * verror.h, verror.c: New files.
250 2006-08-07 Bruno Haible <bruno@clisp.org>
252 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
254 Reported by Ralf Wildenhues.
256 2006-08-06 Eric Blake <ebb9@byu.net>
258 * error.h: Fold in some upstream changes from glibc.
261 2006-07-29 Bruno Haible <bruno@clisp.org>
263 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
265 2006-07-29 Bruno Haible <bruno@clisp.org>
267 * setenv.c: Undo unintended modification done on 2006-02-27.
269 2006-07-28 Eric Blake <ebb9@byu.net>
271 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
274 2006-07-28 Simon Josefsson <jas@extundo.com>
276 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
279 2006-07-28 Simon Josefsson <jas@extundo.com>
281 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
284 2006-07-28 Bruno Haible <bruno@clisp.org>
286 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
288 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
290 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
293 2006-07-28 Bruno Haible <bruno@clisp.org>
295 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
296 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
298 Avoids link error on FreeBSD 4.x.
299 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
301 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
303 * mbswidth.c (iswcntrl): Likewise.
305 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
307 * modechange.c (mode_compile): Numeric modes now affect setuid and
308 setgid on directories only if they set these bits.
309 * modechange.h: Remove obsolete comment about masks.
311 2006-07-27 Bruno Haible <bruno@clisp.org>
313 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
314 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
317 2006-07-26 Eric Blake <ebb9@byu.net>
319 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
320 like mingw that lack mkstemp.
321 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
322 avoid compilation warning on mingw.
324 2006-07-25 Bruno Haible <bruno@clisp.org>
326 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
327 <stdarg.h> or config.h.
329 2006-07-24 Bruno Haible <bruno@clisp.org>
331 * clean-temp.h: New file, from GNU gettext.
332 * clean-temp.c: New file, from GNU gettext.
334 2006-07-24 Bruno Haible <bruno@clisp.org>
336 * tmpdir.h: New file, from GNU gettext.
337 * tmpdir.c: New file, from GNU gettext.
339 2006-07-23 Bruno Haible <bruno@clisp.org>
341 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
342 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
343 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
344 gl_linked_remove_at): Use it.
346 2006-07-23 Eric Blake <ebb9@byu.net>
348 * tmpfile-safer.c: New file.
349 * stdio-safer.h (fopen_safer): Add prototype.
350 * stdio--.h (tmpfile): Make safer.
352 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
354 * close-stream.c, close-stream.h: New files.
356 2006-07-22 Bruno Haible <bruno@clisp.org>
358 Merge from GNU gettext 0.15.
360 2005-07-05 Bruno Haible <bruno@clisp.org>
362 * printf-args.c (printf_fetchargs): Work around broken
363 definition of wint_t on mingw.
365 2005-02-12 Bruno Haible <bruno@clisp.org>
367 * xallocsa.h: Add extern "C" for C++.
369 2006-05-17 Bruno Haible <bruno@clisp.org>
372 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
374 2006-04-30 Bruno Haible <bruno@clisp.org>
376 * progreloc.c: Include <mach-o/dyld.h> if available.
377 (find_executable): Use _NSGetExecutablePath when possible.
379 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
381 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
384 2005-12-29 Bruno Haible <bruno@clisp.org>
386 * progreloc.c (set_program_name_and_installdir): Fix
389 2005-12-04 Bruno Haible <bruno@clisp.org>
392 * progreloc.c: Include <windows.h> also on Cygwin.
393 (find_executable): Add support for Cygwin.
394 (set_program_name_and_installdir): Handle also platforms with
397 2006-07-11 Bruno Haible <bruno@clisp.org>
399 * javacomp.c: Fix a comment.
400 Reported by Jim Meyering.
402 2006-04-30 Bruno Haible <bruno@clisp.org>
404 * javacomp.h (compile_java_class): Add source_version,
405 target_version arguments.
406 * javacomp.c: Rewritten to choose only a compiler that
407 respects the specified source_version and target_version.
409 2006-06-27 Bruno Haible <bruno@clisp.org>
411 Assume correct S_ISDIR macro.
412 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
414 2006-07-22 Bruno Haible <bruno@clisp.org>
416 * javaversion.h: New file, from GNU gettext.
417 * javaversion.c: New file, from GNU gettext.
418 * javaversion.java: New file, from GNU gettext.
419 * javaversion.class: New file, from GNU gettext.
421 2006-05-17 Bruno Haible <bruno@clisp.org>
424 * javaexec.c (execute_java_class): Test for jview program
427 2006-04-09 Bruno Haible <bruno@clisp.org>
429 * fatal-signal.c: Don't include string.h.
430 (at_fatal_signal): Use a copying loop instead of memcpy.
432 2005-12-04 Bruno Haible <bruno@clisp.org>
434 * csharpexec.c: Add support for 'clix' launcher (untested).
435 (execute_csharp_using_sscli): New function.
436 (execute_csharp_program): Call it.
438 2006-06-21 Bruno Haible <bruno@clisp.org>
440 Avoid warnings from recent versions of mcs.
441 * csharpcomp.c (compile_csharp_using_mono): Don't use options
442 -o, -L, -r any more. Use options documented since mcs-1.0
443 instead. Similarly for -g.
445 2005-07-09 Bruno Haible <bruno@clisp.org>
447 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
449 Reported by Mark Junker <mjscod@gmx.de>.
451 2006-06-17 Bruno Haible <bruno@clisp.org>
453 * config.charset: Update for NetBSD 3.0.
455 2006-05-17 Bruno Haible <bruno@clisp.org>
458 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
460 2006-05-16 Bruno Haible <bruno@clisp.org>
462 * localcharset.c [CYGWIN]: Include <windows.h>.
463 (get_charset_aliases): For Cygwin, return the same CPxxx
464 aliases list as under WIN32.
465 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
466 the environment variables. Fall back to GetACP().
468 2006-04-05 Bruno Haible <bruno@clisp.org>
470 * config.charset: Update Juan Manuel Guerrero's address.
472 2005-02-12 Bruno Haible <bruno@clisp.org>
474 * allocsa.h: Add extern "C" for C++.
476 2005-02-10 Bruno Haible <bruno@clisp.org>
478 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
479 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
481 2006-07-22 Bruno Haible <bruno@clisp.org>
483 * gettext.h: Update to GNU gettext-0.15.
485 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
486 and Simon Josefsson <jas@extundo.com>
488 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
490 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
492 2006-07-21 Eric Blake <ebb9@byu.net>
494 * stdlib-safer.h: New file from coreutils, required by
497 2006-07-19 Derek R. Price <derek@ximbiot.com>
499 * getaddrinfo.h: Don't define unimplemented AI_* flags.
500 Reindent and repaginate.
502 2006-07-17 Bruno Haible <bruno@clisp.org>
504 * gl_list.h: New file.
505 * gl_list.c: New file.
506 * gl_array_list.h: New file.
507 * gl_array_list.c: New file.
508 * gl_carray_list.h: New file.
509 * gl_carray_list.c: New file.
510 * gl_linked_list.h: New file.
511 * gl_linked_list.c: New file.
512 * gl_anylinked_list1.h: New file.
513 * gl_anylinked_list2.h: New file.
514 * gl_avltree_list.h: New file.
515 * gl_avltree_list.c: New file.
516 * gl_anyavltree_list1.h: New file.
517 * gl_anyavltree_list2.h: New file.
518 * gl_rbtree_list.h: New file.
519 * gl_rbtree_list.c: New file.
520 * gl_anyrbtree_list1.h: New file.
521 * gl_anyrbtree_list2.h: New file.
522 * gl_anytree_list1.h: New file.
523 * gl_anytree_list2.h: New file.
524 * gl_linkedhash_list.h: New file.
525 * gl_linkedhash_list.c: New file.
526 * gl_anyhash_list1.h: New file.
527 * gl_anyhash_list2.h: New file.
528 * gl_avltreehash_list.h: New file.
529 * gl_avltreehash_list.c: New file.
530 * gl_rbtreehash_list.h: New file.
531 * gl_rbtreehash_list.c: New file.
532 * gl_anytreehash_list1.h: New file.
533 * gl_anytreehash_list2.h: New file.
535 * gl_oset.h: New file.
536 * gl_oset.c: New file.
537 * gl_array_oset.h: New file.
538 * gl_array_oset.c: New file.
539 * gl_avltree_oset.h: New file.
540 * gl_avltree_oset.c: New file.
541 * gl_rbtree_oset.h: New file.
542 * gl_rbtree_oset.c: New file.
543 * gl_anytree_oset.h: New file.
545 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
547 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
549 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
550 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
551 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
552 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
553 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
554 callers changed. Revamp internals significantly, by not
555 attempting to create directories that are temporarily more
556 permissive than the final results. Do not attempt to use
557 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
558 This removes some race conditions, fixes some bugs, and simplifies
559 things. Use new dirchownmod function to do owner and mode changes.
560 * mkdir-p.h: Likewise.
561 * modechange.c (octal_to_mode): New function.
562 (struct mode_change): New member mentioned.
563 (make_node_op_equals): New arg mentioned. All callers changed.
564 (mode_compile): Keep track of which mode bits the user has explicitly
566 (mode_adjust): New arg DIR, so that we implement the X op correctly.
567 New arg PMODE_BITS, to keep track of which mode bits the user
568 mentioned; it treats S_ISUID and S_ISGID speciall.
570 * modechange.h: Likewise.
572 2006-07-11 Derek R. Price <derek@ximbiot.com>
574 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
576 2006-07-10 Derek R. Price <derek@ximbiot.com>
578 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
579 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
580 macros into the GNU _D_EXACT_NAMLEN.
581 * savedir.c: Likewise.
582 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
584 2006-07-09 Jim Meyering <jim@meyering.net>
586 * argp-pv.c: Remove a doubled word in a comment.
587 * check-version.c (check_version): Likewise.
588 * javacomp.c (compile_java_class): Likewise.
590 2006-07-08 Jim Meyering <jim@meyering.net>
592 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
594 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
596 * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
597 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
598 brackets. Other minor changes to suppress some compiler
601 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
603 * getloadavg.c: Use __VMS, not VMS.
604 * getopt.c: Likewise.
605 * getpagesize.h: Likewise.
606 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
607 probably does not work.
609 2006-07-06 Derek R. Price <derek@ximbiot.com>
610 and Paul Eggert <eggert@cs.ucla.edu>
612 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
613 Don't worry about this obsolete case any more.
614 (HAVE_DIR): Remove. All uses removed; we now assume you can read
616 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
617 worry about this obsolete case any more.
619 * getcwd.c: Likewise.
621 * savedir.c: Likewise.
623 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
625 * .cppi-disable: Add wcwidth.
626 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
627 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
628 (ISGRAPH): Remove. All uses changed to isgraph.
629 (FOLD) [!defined _LIBC]: Remove special case.
630 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
631 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
633 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
635 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
637 * strtod.c (strtod): cast the argument of tolower to unsigned char.
639 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
641 * memcasecmp.c: Include <limits.h>.
642 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
643 * strtod.c (strtod): Don't assume isspace works on negative chars.
644 Don't assume isdigit succeeds only on '0' through '9'.
646 2006-07-05 Derek R. Price <derek@ximbiot.com>
648 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
649 All uses of is_space replaced by isspace.
650 * exit.h: Don't talk about STDC_HEADERS.
651 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
652 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
653 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
654 replaced by isprint etc.
655 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
656 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
657 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
658 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
659 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
660 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
662 2006-07-05 Eric Blake <ebb9@byu.net>
664 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
665 missing from netdb.h.
666 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
668 2006-06-27 Bruno Haible <bruno@clisp.org>
670 Assume ANSI C header files and <ctype.h> functions.
671 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
672 (mbsnwidth): Use isprint, iscntrl instead.
674 2006-07-03 Jim Meyering <jim@meyering.net>
676 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
677 macro is used before the first cycle_check call.
679 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
681 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
682 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
683 reported by Mark D. Baushke, one in
684 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
686 Merge from coreutils.
688 * .cppi-disable: Add stdint_.h.
689 * .cvsignore: Add stdint.h.
691 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
693 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
694 both double and long double versions.
695 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
696 * xstrtold.c: New file.
697 * xstrtod.h (xstrtold): New decl.
699 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
701 * filemode.c (setst): Remove.
702 (strmode): Rewrite to avoid setst. This makes the code shorter,
703 (arguably) clearer, and the generated code is a bit smaller on my
704 Debian GNU/Linux stable x86 host.
706 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
708 * filemode.c: Include "filemode.h" first, to test the interface.
709 Assume that filemode.h includes sys/types.h and sys/stat.h.
710 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
711 (ftypelet): Reorder to put common cases first, for efficiency.
712 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
714 (strmode): Renamed from mode_string, and now stores 12 bytes instead
715 of 10, for compatibility with FreeBSD. All callers changed.
716 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
717 that can't be deduced solely from st_mode. First arg is now a const
719 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
720 (strmode): Renamed from mode_string.
721 (filemodestring): New decl.
722 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
723 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
724 (S_ISPORT, S_ISWHT): New macros, if not already defined.
726 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
728 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
729 fsusage.h now does that. Include fsusage.h first, to test interface.
730 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
731 at most one method (the old code could have generated decls that
732 didn't conform to C89, not that this was ever exercised).
733 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
735 2006-03-19 Jim Meyering <jim@meyering.net>
737 Work even in a chroot where d_ino values for entries in "/"
738 don't match the stat.st_ino values for the same names.
739 * getcwd.c (__getcwd): When no d_ino value matches the target inode
740 number, iterate through all entries again, using lstat instead.
741 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
742 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
744 * getcwd.c (__getcwd): Clarify a comment.
745 Use memcpy in place of a call to strcpy.
747 2006-03-12 Jim Meyering <jim@meyering.net>
749 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
750 that of the current directory (which we're about to chdir ".." out of),
751 then save the dev-ino of the parent, instead.
753 * same-inode.h (SAME_INODE): New file/macro.
754 * chdir-safer.c (SAME_INODE): Remove definition.
755 Include "same-inode.h", instead.
757 * cycle-check.h: Include "same-inode.h".
758 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
759 * cycle-check.c (SAME_INODE): Remove definition.
760 * root-dev-ino.h: Include "same-inode.h".
762 2006-03-11 Eric Blake <ebb9@byu.net>
764 * same.c (same_name): s/base_name/last_component/
765 * backupfile.c (check_extension, numbered_backup): Likewise.
766 * filenamecat.c (file_name_concat): Likewise.
768 2006-03-11 Eric Blake <ebb9@byu.net>,
769 Paul Eggert <eggert@cs.ucla.edu>
771 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
772 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
774 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
775 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
776 (last_component): New method.
777 * dirname.c (dir_len): Determine when drive letters need a
778 subsequent slash. Preserve // when it is special.
779 (dir_name): Don't append dot when drive letter is absolute.
780 [TEST_DIRNAME]: Move into a full-blown gnulib test.
781 * basename.c (base_name): New semantics - malloc the result.
782 Preserve // when it is special. Preserve relative files that look
784 (base_len): Preserve // when it is special.
785 (last_component): New method, similar to old base_name semantics.
786 * stripslash.c (strip_trailing_slashes): Use last_component, not
787 base_name. Strip redundant slashes from ///.
789 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
791 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
792 both are 64 bits, since this seems to be the tradition, and this
793 prevents gcc -Wformat from warning about usages with PRIuMAX. If
794 we ever run into a host that prefers long long to long in this
795 case, we'll need another configure-time test. Problem reported by
798 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
800 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
801 possible collision with system files.
802 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
803 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
804 WCHAR_MIN and WCHAR_MAX in this case.
805 (<stddef.h>): Do not include; no longer needed.
806 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
807 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
808 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
809 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
810 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
811 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
812 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
813 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
814 !defined(__c99))]: Include in this case too, since it's harmless
816 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
818 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
819 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
820 (_STDINT_MIN, _STDINT_MAX): New macros.
821 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
822 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
823 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
824 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
825 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
826 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
827 macros, not typedefs; this simplifies things quite a bit.
828 Use long int for all types narrower than int64_t.
829 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
830 Define in terms of long long int or int64_t or long int,
831 not int64_t or int32_t. This saves some compile-time testing.
832 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
833 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
834 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
835 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
836 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
837 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
838 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
839 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
840 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
841 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
842 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
843 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
844 undef any previous version and define our own version, for
845 simplicity and consistency with the new macros for types.
846 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
847 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
848 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
849 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
850 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
851 @WINT_T_SUFFIX@ to keep things simple here.
852 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
853 Simplify by assuming typical 8/16/32/64 host, since we're
854 already doing that elsewhere anyway.
855 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
856 and assume long long int is 64 bits if available. This
857 speeds up 'configure'.
859 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
861 * getaddrinfo.c: fixed typo
863 2006-06-29 Eric Blake <ebb9@byu.net>
865 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
866 unused static function.
868 2006-06-29 Eric Blake <ebb9@byu.net>
872 2006-06-29 Derek R. Price <derek@ximbiot.com>
874 * strftime.c: Assume strftime() exists.
876 2006-06-28 Bruno Haible <bruno@clisp.org>
878 * getaddrinfo.h: Fix POSIX URL.
879 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
880 (use_win32_p): Make static.
881 (getaddrinfo): Reject service name if it is empty or does not consist
882 solely of decimal digits, or if its value is > 65535.
883 (getnameinfo): Remove useless casts.
885 2006-06-28 Derek R. Price <derek@ximbiot.com>
887 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
888 Autoconf 2.60 says this stuff was obsolete.
890 2006-05-12 Bruno Haible <bruno@clisp.org>
892 * mkdtemp.c [MINGW]: Include <io.h>.
893 (mkdir): Define using _mkdir.
895 2006-06-28 Bruno Haible <bruno@clisp.org>
897 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
898 declaration for wcwidth.
899 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
901 2006-06-28 Eric Blake <ebb9@byu.net>
903 * xvasprintf.h: Fix comments.
905 2006-06-28 Eric Blake <ebb9@byu.net>
907 * mbchar.h (wcwidth): Include wcwidth.h.
908 * mbswidth.c (wcwidth): Move from here...
909 * wcwidth.h: ...to this new file.
911 2006-06-28 Simon Josefsson <jas@extundo.com>
913 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
914 functions there. It will succeed on Windows XP, but on Windows
915 2000 and (presumably) earlier, it will fail, and use the internal
917 (use_win32_p): New function.
918 (getaddrinfo): Use strtoul on servname, to support numeric ports.
919 Support AI_NUMERICSERV to disable getservbyname.
920 (getnameinfo): New function, only supports
921 NI_NUMERICHOST|NI_NUMERICSERV for now.
923 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
924 only have some of them. Add AI_NUMERICSERV. Add prototype for
927 2006-06-27 Bruno Haible <bruno@clisp.org>
929 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
931 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
933 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
934 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
935 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
937 2006-06-26 Bruno Haible <bruno@clisp.org>
939 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
941 Reported by Mark D. Baushke and Larry Jones.
943 2006-06-26 Bruno Haible <bruno@clisp.org>
945 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
947 Suggested by Mark D. Baushke and Larry Jones.
949 2006-06-23 Mark D. Baushke <mdb@gnu.org>
951 * stdint_.h: Treat BSD/OS like OpenBSD.
953 2006-06-23 Bruno Haible <bruno@clisp.org>
955 * stdint_.h: Treat IRIX like OpenBSD.
957 2006-06-23 Bruno Haible <bruno@clisp.org>
959 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
960 ISO C 99 Technical Corrigendum 1.
962 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
964 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
965 Some compiler complained about some of them. Problem reported by
967 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
969 2006-06-21 Simon Josefsson <jas@extundo.com>
971 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
974 * socket_.h: Don't define WINVER.
976 * inet_pton.h, inet_pton.c: New file, taken from glibc but
977 slightly modified to work in gnulib.
979 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
981 * read-file.c (fread_file): Start with buffer allocation of
982 0 bytes rather than 1 byte; this simplifies the code.
983 Don't invoke feof; it's not needed. Refactor to avoid duplicate
984 code to free buffer and save/restore errno.
985 (internal_read_file): Remove unused local.
987 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
989 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
990 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
991 Problem reported by Denis Excoffier in
992 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
994 2006-06-19 Simon Josefsson <jas@extundo.com>
996 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
998 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1000 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1002 2006-06-17 Bruno Haible <bruno@clisp.org>
1004 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1006 2006-06-17 Bruno Haible <bruno@clisp.org>
1008 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1009 problem on Solaris 2.5.1.
1011 2006-06-16 Eric Blake <ebb9@byu.net>
1013 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1014 * unicodeio.c [!defined errno]: Likewise.
1015 * strtol.c [!defined errno]: Likewise.
1016 * strtod.c [!defined errno]: Likewise.
1018 2006-06-15 Bruno Haible <bruno@clisp.org>
1020 * stdint_.h: Rewritten to be fully auto-configured.
1021 Fixes bug on HP-UX/IA64.
1023 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1025 * getdate.y (__attribute__): Don't define if already defined.
1026 Problem reported by Larry Jones.
1027 * utimens.c (__attribute__): Likewise.
1029 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1031 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1032 reported by Andreas Schwab.
1034 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1035 Bruno Haible <bruno@clisp.org>
1037 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1039 2006-05-26 Martin Lambers <marlam@marlam.de>
1041 * getpass.c: Updates the test for the native W32 API, and adds
1042 missing includes, thus fixing compilation warnings.
1044 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1046 * tempname.c (small_open, large_open): New macros.
1047 (__open, __open64) [!_LIBC]: Remove.
1048 (__gen_tempname): Use small_open and large_open instead of __open
1049 and __open64. This fixes a portability bug on HP-UX 11.11i
1050 reported by Simon Wing-Tang in
1051 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1053 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1055 * exclude.c (exclude_fnmatch): New function.
1056 (excluded_file_name): Call exclude_fnmatch.
1057 * exclude.h (excluded_file_name): New prototype
1059 2006-05-24 Bruno Haible <bruno@clisp.org>
1061 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1062 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1063 Reported by Thorsten Maerz <torte@netztorte.de> via
1064 Aaron Stone <aaron@serendipity.cx>.
1066 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1068 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1069 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1070 (my_usleep): Don't mishandle maximum value.
1072 2006-05-19 Jim Meyering <jim@meyering.net>
1074 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1076 2006-05-17 Bruno Haible <bruno@clisp.org>
1079 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1081 2006-05-17 Bruno Haible <bruno@clisp.org>
1083 * stdint_.h: Fix recognition of Cygwin.
1085 2006-05-11 Jim Meyering <jim@meyering.net>
1087 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1089 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1091 * crc.c (crc32_update): Remove unnecessary L suffix.
1092 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1093 unwanted sign propagation, e.g., on hosts with 64-bit int.
1094 There still are some problems with reeelly weird theoretical hosts
1095 (e.g., 33-bit int) but it's not worth worrying about now.
1096 * sha1.c (rol): Likewise.
1097 (K1, K2, K3, K4): Remove unnecessary L suffix.
1099 2006-05-10 Bruno Haible <bruno@clisp.org>
1101 * des.c: Cast to avoid warnings.
1103 2006-05-10 Simon Josefsson <jas@extundo.com>
1105 * md4.c: Typo fix, update copyright years.
1106 (K1, K2): Don't use L because it turn computations into 64-bit on
1109 2006-05-09 Bruno Haible <bruno@clisp.org>
1111 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1112 (EOVERFLOW): Define fallback value.
1113 (xstrcat): New function.
1114 (xvasprintf): Recognize the special case of a string concatenation.
1116 2006-05-01 Bruno Haible <bruno@clisp.org>
1118 * stdint_.h: Shorter URL.
1119 * inttypes.h: Likewise.
1121 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1123 * verify.h: Document the internals better. Most of this change
1124 was written by Bruno Haible.
1126 2006-04-29 Bruno Haible <bruno@clisp.org>
1128 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1129 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1131 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1133 * getdate.y (get_date): When adding relative date, start with the
1134 initial time, not with the result of the first mktime call.
1136 2006-04-23 Bruno Haible <bruno@clisp.org>
1138 * copy-file.c: Include <unistd.h> unconditionally.
1139 * execute.c: Likewise.
1140 * fatal-signal.c: Likewise.
1141 * findprog.c: Likewise.
1142 * mkdtemp.c: Likewise.
1145 * wait-process.h: Likewise.
1147 2006-04-23 Bruno Haible <bruno@clisp.org>
1149 * fwriteerror.c (fwriteerror): Call fclose also when an error
1150 condition was already detected.
1151 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1153 2006-04-19 Derek Price <derek@ximbiot.com>
1154 Eric Blake <ebb9@byu.net>
1156 * inttypes.h: Correct grammar in comment.
1158 2006-04-18 Derek Price <derek@ximbiot.com>
1159 Paul Eggert <eggert@cs.ucla.edu>
1161 * inttypes.h: New file.
1162 * strtoimax.c: Assume <inttypes.h>.
1164 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1166 * utimens.c (futimens): glibc futimesat messes up if /proc
1167 isn't mounted. Problem reported by Kir Kolyshkin.
1169 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1171 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1172 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1173 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1175 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1177 Merge regex changes from libc, removing some of our
1178 POSIX-conformance changes that were rejected and redoing them in a
1181 * regcomp.c (re_compile_internal, init_dfa):
1182 Length arg is now size_t, not Idx. All uses changed.
1183 (peek_token): Forward decl now says internal_function.
1184 (__re_error_msgid, __re_error_msgid_idx):
1185 Now static rather than extern with attribute_hidden.
1186 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1187 For some reason libc prefers K&R style defns for external functions.
1188 (regerror) [!defined _LIBC]: Likewise.
1189 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1190 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1191 (build_range_exp, build_collating_symbol):
1193 (re_compile_fastmap): Use '\0' to memset, not 0.
1194 (utf8_sb_map): Make the calculations more obvious.
1195 (init_dfa, parse_bracket_exp, build_charclass_op):
1196 Call calloc and cast result, as glibc does.
1197 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1198 (build_range_exp, build_collating_symbol):
1199 Now internal functions.
1201 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1203 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1204 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1205 Don't depend on VMS; depend on __VMS instead, for POSIX
1206 namespace cleanness.
1207 (regoff_t): Define to ssize_t, not long int.
1209 Remove the REG_ macros named below. Instead, make the old names
1210 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1212 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1213 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1214 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1215 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1216 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1217 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1218 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1219 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1220 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1221 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1222 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1223 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1224 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1225 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1226 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1227 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1228 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1230 Remove. All uses replaced by the old RE_* names.
1231 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1232 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1233 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1234 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1235 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1236 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1237 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1238 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1239 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1240 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1241 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1242 Don't bother having these macros be independent of each others'
1243 values, since they no longer exist in the POSIX name space.
1245 Rename the following member names back to their old names,
1246 unless !__USE_GNU_REGEX. All uses changed back.
1247 (buffer): Renamed from re_buffer.
1248 (allocated): Renamed from re_allocated.
1249 (used): Renamed from re_used.
1250 (syntax): Renamed from re_syntax.
1251 (fastmap): Renamed from re_fastmap.
1252 (translate): Renamed from re_translate.
1253 (can_be_null): Renamed from re_can_be_null.
1254 (regs_allocated): Renamed from re_regs_allocated.
1255 (fastmap_accurate): Renamed from re_fastmap_accurate.
1256 (no_sub): Renamed from re_no_sub.
1257 (not_bol): Renamed from re_not_bol.
1258 (not_eol): Renamed from re_not_eol.
1259 (newline_anchor): Renamed from re_newline_anchor.
1260 (num_regs): Renamed from rm_num_regs.
1261 (start): Renamed from rm_start.
1262 (end): Renamed from rm_end.
1264 (free_state): Move up a bit.
1266 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1267 #define to be empty.
1268 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1269 when that is what is intended.
1270 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1271 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1273 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1274 All uses changed back to re_malloc, etc. It's now the caller's
1275 responsibility to check for overflow; all callers changed.
1276 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1277 (re_x2nrealloc): Remove.
1278 (free_state): Remove decl.
1280 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1281 (re_set_registers, re_exec):
1284 2006-01-31 Roland McGrath <roland@redhat.com>
1286 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1287 Reported by Mike Frysinger <vapier@gentoo.org>.
1289 2006-01-15 Andreas Jaeger <aj@suse.de>
1292 * regex_internal.c (re_string_reconstruct): Adjust for
1293 build_wcs_upper_buffer change.
1294 (build_wcs_upper_buffer): Change return type.
1296 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1298 * regex_internal.h: Include <stdint.h> if available.
1300 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1302 * regex_internal.h (SIZE_MAX): Provide a default definition.
1304 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1306 * regcomp.c: Adjust for changed secondary hash function.
1308 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1310 * regex.h: Pretty printing.
1311 Clean up namespace a bit.
1313 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1315 * regexec.c (update_cur_sifted_state, check_arrival,
1316 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1318 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1319 Ulrich Drepper <drepper@redhat.com>
1322 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1323 (bitset_word_t): Renamed from bitset_word. All uses changed.
1325 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1328 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1329 * regcomp.c: Remove unnecessary uses of
1330 unsigned RE_TRANSLATE_TYPE.
1331 * regex_internal.h: Likewise.
1332 * regex_internal.c: Likewise.
1333 * regexec.c: Likewise.
1334 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1336 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1338 * regexec.c (find_recover_state): Remove unnecessary
1340 (transit_state_bkref): Make DFA a const pointer.
1341 (get_subexp): Likewise.
1342 (check_arrival): Likewise.
1343 (update_cur_sifted_state): Likewise.
1344 (re_search_internal): Likewise.
1345 (prune_impossible_nodes): Likewise.
1346 (acquire_init_state_context): Likewise.
1347 (proceed_next_node): Likewise.
1348 (set_regs): Likewise.
1349 (free_fail_stack_return): Likewise.
1350 (check_arrival_expand_ecl): Mark DFA parameter as const.
1351 (check_arrival_expand_ecl_sub): Likewise.
1352 (check_subexp_limits): Likewise.
1353 (sub_epsilon_src_nodes): Likewise.
1354 (add_epsilon_src_nodes): Likewise.
1355 (merge_state_array): Likewise.
1356 (update_regs): Likewise.
1357 (build_trtable): Likewise.
1358 (sift_states_backward): Mark MCTX parameter as const.
1359 (build_sifted_states): Likewise.
1360 (update_cur_sifted_state): Likewise.
1361 (sift_states_mkref): Likewise.
1362 (check_arrival_expand_ecl): Mark eclosure as const.
1363 (check_dst_limits_calc_pos_1): Likewise.
1364 * regex_internal.h (re_match_context_t): Make dfa a const
1367 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1369 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1370 (transit_state_sb): Likewise.
1371 (transit_state_mb): Likewise.
1372 (sift_states_iter_mb): Likewise.
1373 (check_arrival_add_next_nodes): Likewise.
1374 (check_node_accept_bytes): Change first parameter to pointer-to-const.
1375 [_LIBC] (re_search_2_stub): Use mempcpy.
1377 * regex_internal.c (re_string_reconstruct): Avoid calling
1378 mbrtowc for very simple UTF-8 case.
1380 * regex_internal.c (re_acquire_state): Make DFA pointer arg
1382 (re_acquire_state_context): Likewise.
1383 * regex_internal.h: Adjust prototypes.
1385 * regex.c: Prevent using C++ compilers.
1387 * regex_internal.c (re_acquire_state): Minor code rearrangement.
1388 (re_acquire_state_context): Likewise.
1390 2006-03-29 Mark D. Baushke <mdb@gnu.org>
1391 Bruno Haible <bruno@clisp.org>
1393 * stdint_.h: On OpenBSD, don't redefine types already included in
1394 <sys/types.h> and <inttypes.h>.
1396 2006-03-24 Eric Blake <ebb9@byu.net>
1398 * time_r.c (copy_string_result): Remove, as it is no longer used.
1400 2006-03-24 Simon Josefsson <jas@extundo.com>
1402 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1403 including some doc fixes.
1404 (base64_encode_alloc): Fix +1 bug on allocation failures.
1406 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1408 * base64.c (base64_encode): Do not read past end of array with
1409 unsanitized input on systems with CHAR_BIT > 8.
1411 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1413 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1414 Typedef to long int, not to off_, as POSIX will likely change
1417 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
1419 * argp-help.c (validate_uparams): Fix typo
1420 * argp-parse.c (argp_default_options): Consistently begin help
1421 messages with a lowercase letter.
1423 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
1425 * time_r.h (asctime_r, ctime_r): Remove. These functions can
1426 overrun buffers and shouldn't be used (much as gets shouldn't be
1428 * time_r.c (asctime_r, ctime_r): Likewise.
1430 2006-03-08 Simon Josefsson <jas@extundo.com>
1432 * gc-gnulib.c (randomize): Don't open files called 'no', they
1433 signal that configure disabled the device.
1435 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
1437 * c-stack.c: Include unistd.h unconditionally, since we now assume
1439 * getlogin_r.c: Likewise.
1440 * getlogin_r.h: Likewise.
1442 * pagealign_alloc.c: Likewise.
1443 * unistd_.h: Remove; no longer needed.
1445 2006-03-07 Simon Josefsson <jas@extundo.com>
1447 * unistd_.h: New file.
1449 2006-03-07 Simon Josefsson <jas@extundo.com>
1451 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1453 2006-03-01 Simon Josefsson <jas@extundo.com>
1455 * readline.c: Fix typo, tiny patch from Stepan Kasal
1458 2006-02-28 Simon Josefsson <jas@extundo.com>
1460 * getopt.c: Protect #include of unistd.h, for MSVS.
1462 2006-02-27 Simon Josefsson <jas@extundo.com>
1464 * base64.h: Indent #define's. From Jim Meyering
1467 2006-02-27 Jim Meyering <jim@meyering.net>
1469 Revert the change of 2006-02-24, so these files can continue
1470 to be sync'd from gettext.
1471 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1474 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
1476 * glob.c: Say "invalid" rather than "illegal" in comments.
1478 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1480 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1482 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
1484 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1485 AT_FDCWD exceeds INT_MAX.
1486 * openat.h (AT_FDCWD): Likewise.
1488 2006-02-14 Jim Meyering <jim@meyering.net>
1490 Sync from coreutils.
1492 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1493 failure on deficient systems, and simplify gnulib lgpl dependencies.
1494 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1495 xmalloc/lstat combination. Based on a patch from Bruno Haible.
1497 * xalloc-die.c: Remove unused definition of N_.
1499 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
1501 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1503 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
1505 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1506 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1508 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
1510 * argp-namefrob.h: Restore changes accidentally lost during the
1511 "autoupdate" on 2005-12-12.
1513 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1515 * fnmatch.c (L_): Renamed from L, to work around a bug in
1516 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1517 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1520 2006-01-26 Simon Josefsson <jas@extundo.com>
1522 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1523 prototype is visible on mingw32.
1525 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1528 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1531 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
1533 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
1534 attempt to open for write; this always fails, at least on POSIX
1535 hosts. This reinstates the 2006-01-09 change, which was
1536 inadvertently removed.
1538 2006-01-26 Bruno Haible <bruno@clisp.org>
1539 Paul Eggert <eggert@cs.ucla.edu>
1541 * stdbool_.h (_Bool)
1542 [(! (defined __cplusplus || defined __BEOS__)
1543 && !defined __GNUC__
1544 && !(defined __HP_cc || defined __xlc__
1545 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1546 || defined __sgi))]:
1547 #define to signed char in these cases too; this simplifies
1548 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1549 etc., separately) and makes it more conservative.
1551 2006-01-21 Jim Meyering <jim@meyering.net>
1553 Sync from the stable (b5) branch of coreutils:
1555 * fts.c (fts_children): Don't let close() clobber errno from
1558 * fts.c (fts_stat): When following a symlink-to-directory,
1559 don't necessarily interpret stat-fails+lstat-succeeds as indicating
1560 a dangling symlink. That can also happen at least for ELOOP.
1561 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1562 FYI, this bug predates the inclusion of fts.c in coreutils.
1564 * fts.c (fts_open): Put new maxarglen declaration and uses
1565 in their own block, so pre-c99 compilers don't object.
1567 Avoid the double-free (first in fts_read, second in fts_close) that
1568 would occur when an `active' directory is made inaccessible (e.g.,
1569 via chmod a-x) during a traversal.
1570 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1571 before returning. Reproduce this failure by
1572 mkdir -p a/b; cd a; chmod a-x . b
1573 Reported by Stavros Passas.
1575 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
1577 * argp-namefrob.h: Bugfix. Remove stray #
1579 2006-01-25 Bruno Haible <bruno@clisp.org>
1581 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1583 Reported by Paul Eggert.
1585 2006-01-25 Jim Meyering <jim@meyering.net>
1587 * fileblocks.c: Remove more useless parentheses.
1588 * readutmp.h: Likewise.
1590 2006-01-24 Bruno Haible <bruno@clisp.org>
1592 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1594 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
1597 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1598 to avoid problems with the built-in _Bool type.
1599 Reported by Paul Eggert on 2005-11-26.
1601 2006-01-24 Jim Meyering <jim@meyering.net>
1603 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1605 2006-01-24 Simon Josefsson <jas@extundo.com>
1607 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1610 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1612 Work around porting bugs reported by Dieter in
1613 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1614 * getopt.c (_NOPROTO): Remove; no longer needed.
1615 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1616 Include "getopt.h" first, to check interface.
1617 (getenv): Declare only if defined HAVE_DECL_GETENV &&
1619 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1620 (__strndup): Revert to K&R-style function dfns, the glibc style.
1621 * strnlen.c: Don't claim it's taken from glibc; it's not.
1622 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1623 Include strnlen.h first, to get prototype properly.
1624 (strnlen): Renamed from __strnlen.
1627 2006-01-23 Ulrich Drepper <drepper@redhat.com>
1629 These changes imported from libc.
1630 * getopt.c: Use __fxprintf instead of inline stream orientation
1631 test and two separate function calls.
1632 * strndup.c (__strndup): Add libc_hidden_def.
1634 2006-01-22 Bruno Haible <bruno@clisp.org>
1636 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1637 temporary buffer for sprintf, take into account the precision also
1638 for 'd', 'i', 'u', 'o', 'x', 'X'.
1640 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1642 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1643 to pacify gcc -Wswitch-default.
1645 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
1647 * argp-help.c (usage_long_opt): Do not print DOC options.
1648 (__argp_base_name): Removed
1649 * argp-namefrob.h (__argp_basename): Removed definition. Was a
1651 (__argp_base_name): Provide macro definition or extern declaration
1652 depending on the configuration
1654 2006-01-20 Simon Josefsson <jas@extundo.com>
1656 * inet_ntop.h: Unconditionally include sys/socket.h.
1658 2006-01-19 Simon Josefsson <jas@extundo.com>
1660 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1662 2006-01-12 Simon Josefsson <jas@extundo.com>
1664 * base64.c: Fix warning, reported by Bruno Haible
1665 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1667 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
1669 Sync from coreutils.
1670 * md5.c: Fix commentary typos.
1671 (alignof, UNALIGNED_P): No need for a GCC-specific version.
1672 * md5.h (__attribute__): Remove; unused.
1673 * sha1.c: Fix commentary to match md5 better.
1674 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1675 so that we don't need to worry about alignment. All uses changed.
1676 This merges the 2005-10-28 md5 change into sha1.
1678 2006-01-11 Jim Meyering <jim@meyering.net>
1680 Sync from coreutils.
1681 * md5.c (OP): Fix spacing.
1683 2006-01-11 Simon Josefsson <jas@extundo.com>
1685 * stdint_.h (SIZE_MAX): Add missing (.
1687 2006-01-10 Bruno Haible <bruno@clisp.org>
1689 * argp.h (__const): Remove macro. Use const instead.
1690 * argp-fmtstream.h (__const): Likewise.
1691 * glob_.h (__const): Remove macro.
1692 * glob-libc.h: Use const instead of __const.
1694 2006-01-10 Jim Meyering <jim@meyering.net>
1696 Avoid the double-free (first in fts_read, second in fts_close) that
1697 would occur when an `active' directory is made inaccessible (e.g.,
1698 via chmod a-x) during a traversal.
1699 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1700 before returning. Reproduce this failure by
1701 mkdir -p a/b; cd a; chmod a-x . b
1702 Reported by Stavros Passas.
1704 Sync from coreutils.
1705 * sha1.c: Tweak grammar in a comment.
1707 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
1709 * regex_internal.h (BITSET_WORD_BITS):
1710 Work around a bug in 64-bit PGC (before version 6.1-2), where the
1711 preprocessor mishandles large unsigned values as if they were signed.
1712 Problem reported by Claudio Fontana in
1713 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1715 2006-01-10 Simon Josefsson <jas@extundo.com>
1717 * socket_.h: New file.
1719 2006-01-10 Bruno Haible <bruno@clisp.org>
1721 * localcharset.c: Update from GNU gettext.
1723 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
1725 Sync from coreutils.
1726 * chdir-long.c (cdb_free): Don't bother trying to open directory
1727 for write access: POSIX says that must fail.
1728 * fts.c (diropen): Likewise.
1729 * save-cwd.c (save_cwd): Likewise.
1730 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1731 well, for minor improvements on hosts that lack O_DIRECTORY.
1732 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1733 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1734 Fall back on chown if open failed with EACCES.
1736 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1737 Report an error at compile-time if only a 1-second nominal clock
1738 resolution is found.
1740 * lchmod.h: New file.
1741 * mkdir-p.c: Include lchmod.h, lchown.h.
1742 (make_dir_parents): Use lchown rather than chown, and
1743 lchmod rather than chmod.
1745 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1746 too. Problem with "none" reported by Bob Proulx. Problem with
1747 "proc" reported by n0dalus.
1749 * mountlist.c: Include <limits.h>.
1750 (dev_from_mount_options)
1751 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1752 New function. It no longer assumes "dev=" has the System V meaning
1753 on Linux (since it doesn't). It also parses "dev=" more carefully.
1754 (read_file_system_list)
1755 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1756 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1759 * posixtm.h (PDS_PRE_2000): New macro.
1760 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1761 All usages changed. Reject dates outside the range 1969-1999 if
1762 PDS_PRE_2000 is used.
1764 2006-01-09 Jim Meyering <jim@meyering.net>
1766 Sync from coreutils.
1768 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1770 * chdir-safer.h, chdir-safer.c: New files.
1772 * modechange.c (mode_compile): Reject an invalid mode string
1773 that starts with an octal digit. From Andreas Gruenbacher.
1775 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1776 and dup to open_safer and dup_safer, respectively.
1777 (openat_permissive): Fix typo in comment.
1779 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1780 "gettext.h"; either no longer needed or are guaranteed by openat.h.
1781 (_): Remove; no longer needed.
1782 (openat): Renamed from rpl_openat; no need for rpl_openat
1783 since openat.h renames openat for us.
1784 Replace most of the body with a call to openat_permissive,
1785 to avoid duplicate code.
1786 Port to (probably hypothetical) environments were mode_t is
1788 (openat_permissive): Require mode arg, so that we can check
1789 types better. Put it just after flags. Change cwd failure
1790 indicator from pointer-to-bool to pointer-to-errno-value.
1791 All callers changed.
1792 Invoke openat_save_fail and/or openat_restore_fail if
1793 cwd_errno is null, so that openat can call us.
1794 (openat_permissive, fdopendir, fstatat, unlinkat):
1795 Simplify errno handling to avoid some duplicate code,
1796 as it's OK to set errno on success.
1797 * openat.h: Revamp code so that function macros depend on
1798 __OPENAT_PREFIX only, not also on AT_FDCWD.
1799 (openat_ro): Remove. Caller changed to use openat_permissive.
1800 (openat_permissive): Now a macro, if not a function.
1801 (openat_restore_fail, openat_save_fail): Now always functions,
1802 since mkdirat needs them even if __OPENAT_PREFIX is defined.
1804 * openat-priv.h: New file, defining macros used by mkdirat.c
1806 * mkdirat.c: Include openat-priv.h.
1807 Remove definitions of macros defined therein.
1808 * openat.c: Likewise.
1810 * mkdirat.c (mkdirat): New file and function.
1811 * openat.h (mkdirat): Declare.
1813 * openat.c (fdopendir): Don't change errno when returning non-NULL.
1815 * openat.h (openat_permissive): Declare.
1816 (openat_ro): Define.
1818 * openat.c (EXPECTED_ERRNO): New macro.
1819 (openat_permissive): New function -- used in remove.c rewrite.
1820 (all functions): Set errno just before returning, only if there
1821 was an actual failure.
1822 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1824 Emulate openat-family functions using Linux's procfs, if possible.
1825 Idea and some code based on Ulrich Drepper's glibc changes.
1827 * openat.c: (BUILD_PROC_NAME): New macro.
1828 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1829 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1830 before falling back on save_cwd and restore_cwd.
1831 (fdopendir, fstatat, unlinkat): Likewise.
1833 * openat.c (fstatat, unlinkat): Perform the syscall directly,
1834 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1836 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1837 as second argument to va_arg. Otherwise, some versions of gcc
1838 warn that `if this code is reached, the program will abort'.
1840 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
1842 Sync from coreutils.
1844 Add POSIX ACL support
1845 * acl.h (copy_acl, set_acl): Add declarations.
1846 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1847 systems other than Linux.
1848 (chmod_or_fchmod): New function: use fchmod when possible,
1849 and chmod otherwise.
1850 (file_has_acl): Add a POSIX ACL implementation, with a
1851 Linux-specific subcase.
1852 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1853 S_ISVTX from one file to another. Fall back to fchmod/chmod when
1854 acls are unsupported.
1855 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1856 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
1859 2006-01-09 Bruno Haible <bruno@clisp.org>
1861 * sysexit_.h (EX_OK): New macro.
1862 Suggested by Martin Lambers <marlam@marlam.de>.
1864 2006-01-09 Bruno Haible <bruno@clisp.org>
1866 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1867 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1868 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1869 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1871 2006-01-09 Bruno Haible <bruno@clisp.org>
1873 * stdint_.h (SIZE_MAX): Write the value without involving negative
1876 2005-10-16 Bruno Haible <bruno@clisp.org>
1878 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1879 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1881 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
1883 * strftime.c (tzname): Don't declare if it is already #defined.
1884 Problem reported for Mingw by Mark Junker.
1886 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1888 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1889 long int, not int, for nanosecond counts, so that people who are
1890 used to POSIX struct timespec won't be surprised. Reported by Jim
1893 2005-12-16 Jim Meyering <jim@meyering.net>
1895 * fprintftime.c, fprintftime.h: New files.
1897 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
1899 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1900 * argp-help.c (fill_in_uparams): Check if the constructed
1901 struct uparams is valid. Fall back to the default values if it is
1904 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
1906 * argp-help.c (__argp_base_name): New function
1907 (__argp_short_program_name): Rewrite using __argp_base_name
1908 * argp-namefrob.h: Define program_invocation_name and
1909 program_invocation_short_name if requested
1910 (__argp_base_name): Add prototype
1911 * argp-parse.c (argp_def): Use gettext wrappers
1912 (argp_default_parser): Use __argp_base_name
1913 * argp-pin.c: New file. Defines program_invocation_name and
1914 program_invocation_short_name on systems that lack them.
1916 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
1918 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1919 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1920 porting problem reported by Georg Schwarz in
1921 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1923 2005-07-09 Bruno Haible <bruno@clisp.org>
1925 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1926 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1927 Reported by Mark Junker <mjscod@gmx.de>.
1929 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
1931 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1932 (uintmax_t) [defined uintmax_t]: Do not declare.
1933 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1934 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1935 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
1936 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1937 sake of portability to weird hosts that C allows (though we don't
1938 know of any practical examples).
1940 * savedir.h (fdsavedir): New decl.
1941 * savedir.c (fdsavedir, savedirstream): New functions; the latter
1942 contains most of the former guts of savedir.
1943 (savedir): Use savedirstream.
1946 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
1948 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1949 coreutils no longer futzes with rounding modes.
1951 2005-11-14 Jim Meyering <jim@meyering.net>
1953 * mkstemp-safer.c: Include <config.h>, required for possible
1954 replacement of mkstemp.
1956 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
1958 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1960 (gethrxtime) [! (HAVE_NANOUPTIME
1961 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1962 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1963 our own approximation.
1965 2005-11-10 Simon Josefsson <jas@extundo.com>
1967 * readline.c: Remove EOL.
1969 2005-11-08 Eric Blake <ebb9@byu.net>
1971 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1973 2005-11-08 Eric Blake <ebb9@byu.net>
1975 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1977 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
1979 Fix porting problem reported by Theodoros V. Kalamatianos.
1980 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1981 Don't assume that futimes failing means we must fail.
1983 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
1985 * getcwd.c (__getcwd): Don't assume that system calls after readdir
1986 leave errno alone. Problem reported by Dmitry V. Levin.
1988 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
1990 * savedir.c (savedir): Don't assume that xrealloc etc. leave
1991 errno alone. Problem reported by Frederic Jolliton.
1993 2005-10-28 Simon Josefsson <jas@extundo.com>
1995 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1996 "restrict" keywords, as per POSIX. Protect the function
1997 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1998 Don't use K&R prototypes. Check the sprintf return values.
1999 Re-define EAFNOSUPPORT if not present. Indent.
2001 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2002 suggested by Bruno Haible <bruno@clisp.org>.
2004 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2006 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2008 * gc-libgcrypt.c: Add MD2 (which is not available through
2011 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2013 * md2.h, md2.c: New files.
2015 2005-10-24 Simon Josefsson <jas@extundo.com>
2017 * md4.h: Shrink buffer size, now that we changed the type.
2019 2005-10-22 Simon Josefsson <jas@extundo.com>
2021 * arcfour.h, arcfour.c: Use fixed size indices in the
2022 arcfour_context struct (simplify test vector testing in GNU
2025 2005-10-22 Simon Josefsson <jas@extundo.com>
2027 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2028 suggested by Bruno Haible <bruno@clisp.org>.
2030 2005-10-22 Simon Josefsson <jas@extundo.com>
2032 * crc.h: Include stddef.h, for size_t.
2034 2005-10-21 Simon Josefsson <jas@extundo.com>
2036 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2037 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2039 2005-10-21 Simon Josefsson <jas@extundo.com>
2041 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2044 2005-10-21 Simon Josefsson <jas@extundo.com>
2046 * gc-gnulib.c: Support ARCTWO in CBC mode.
2048 2005-10-21 Simon Josefsson <jas@extundo.com>
2050 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2053 * hmac-sha1.c (hmac_sha1): Likewise.
2055 * crc.c (crc32_update): Actually use crc parameter, suggested by
2056 Bruno Haible <bruno@clisp.org>.
2058 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2061 2005-10-21 Simon Josefsson <jas@extundo.com>
2063 * des.h, des.c: New files.
2065 * gc-gnulib.c: Support DES.c
2067 2005-10-21 Simon Josefsson <jas@extundo.com>
2069 * arctwo.h, arctwo.c: New files.
2071 * gc-gnulib.c: Support ARCTWO.
2073 2005-10-21 Simon Josefsson <jas@extundo.com>
2075 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2077 2005-10-19 Simon Josefsson <jas@extundo.com>
2079 * gc-gnulib.c: Support ARCFOUR.
2081 2005-10-19 Simon Josefsson <jas@extundo.com>
2083 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2086 * gc.h: Add ECB enum type.
2088 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2090 2005-10-19 Simon Josefsson <jas@extundo.com>
2092 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2094 2005-10-18 Simon Josefsson <jas@extundo.com>
2096 * md4.h, md4.c: New files, based on md5.?.
2098 2005-10-17 Simon Josefsson <jas@extundo.com>
2100 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2102 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2104 2005-10-17 Simon Josefsson <jas@extundo.com>
2106 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2108 2005-10-17 Simon Josefsson <jas@extundo.com>
2110 * gc.h, gc-libgcrypt.c: Add ciphers.
2112 2005-10-17 Simon Josefsson <jas@extundo.com>
2114 * sha1.c: Use uint32_t instead of md5_uint32.t
2116 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2119 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2121 * md5.h: Use stdint.h and uint32_t. Doc fix.
2123 2005-10-15 Simon Josefsson <jas@extundo.com>
2125 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2127 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2129 2005-10-14 Simon Josefsson <jas@extundo.com>
2131 * arcfour.h, arcfour.c: New files.
2133 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2135 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2136 include <wchar.h>; no longer needed.
2138 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2139 and Ulrich Drepper <drepper@redhat.com>
2142 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2143 instead of inline stream orientation test and two separate
2144 function calls. Pay no attention to USE_IN_LIBIO.
2146 2005-10-14 Roland McGrath <roland@redhat.com>
2148 Import from libc. [BZ #1331]
2149 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2151 Reported by Matej Vela <vela@debian.org>.
2153 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2155 * mkdir-p.c (make_dir_parents): Don't report an error if an
2156 intermediate directory is in a read-only file system. Problem
2157 reported by Eric Blake.
2159 2005-10-13 Simon Josefsson <jas@extundo.com>
2161 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2162 Move memory allocation outside of loop.
2164 2005-10-12 Simon Josefsson <jas@extundo.com>
2166 * gc-pbkdf2-sha1.c: New file.
2168 * gc.h: Add gc_pbkdf2_sha1 prototype.
2170 2005-10-12 Simon Josefsson <jas@extundo.com>
2172 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2173 suggested by Bruno Haible <bruno@clisp.org>.
2175 2005-10-12 Simon Josefsson <jas@extundo.com>
2177 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2179 * gc-gnulib.c (gc_hmac_sha1): New function.
2181 2005-10-12 Simon Josefsson <jas@extundo.com>
2183 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2185 2005-10-12 Simon Josefsson <jas@extundo.com>
2187 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2188 GC_USE_HMAC_MD5, respectively.
2190 * gc-libgcrypt.c (gc_md5): Fix assert call.
2193 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2195 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2197 * gc-gnulib.c (gc_hash_buffer): Ditto.
2199 2005-10-11 Bruno Haible <bruno@clisp.org>
2201 * c-strcasestr.h: New file, from GNU gettext.
2202 * c-strcasestr.c: New file, from GNU gettext.
2204 2005-10-11 Bruno Haible <bruno@clisp.org>
2206 * c-strcase.h: New file, from GNU gettext.
2207 * c-strcasecmp.c: New file, from GNU gettext.
2208 * c-strncasecmp.c: New file, from GNU gettext.
2210 2005-10-11 Simon Josefsson <jas@extundo.com>
2212 * crc.h, crc.c: New files.
2214 * gc.h (gc_hash_buffer): Add doc.
2216 2005-10-08 Simon Josefsson <jas@extundo.com>
2218 * gc.h: Add gc_hash and gc_hash_buffer.
2220 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2222 * gc-libgcrypt.c (gc_hash_buffer): Add.
2224 2005-10-11 Bruno Haible <bruno@clisp.org>
2226 * strcasecmp.c: Include limits.h.
2227 (strcasecmp): Avoid integer overflow on exotic platforms.
2228 * strncasecmp.c: Include limits.h.
2229 (strncasecmp): Avoid integer overflow on exotic platforms.
2230 Reported by Paul Eggert.
2232 2005-10-06 Simon Josefsson <jas@extundo.com>
2234 * hmac-md5.c: New file.
2238 2005-10-06 Simon Josefsson <jas@extundo.com>
2240 * memxor.c (memxor): Avoid casts and warnings.
2242 2005-10-05 Derek Price <derek@ximbiot.com>
2244 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2246 2005-10-05 Simon Josefsson <jas@extundo.com>
2248 * memxor.c (memxor): Fix compiler error.
2250 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2251 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2253 * memxor.h, memxor.c: New files.
2255 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2256 we assume all systems have it, suggested by Jim Meyering
2257 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2258 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2259 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2262 2005-10-04 Bruno Haible <bruno@clisp.org>
2264 * verify.h (verify_true): Provide alternative definition for C++.
2266 2005-10-04 Simon Josefsson <jas@extundo.com>
2268 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2269 D. Baushke" <mdb@gnu.org>.
2271 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2273 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2274 (SSIZE_MAX): New macro, if not already defined.
2275 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2278 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2280 * exclude.c: Include verify.h.
2281 (verify): Remove. All callers changed to use verify.h's version.
2282 * strtoimax.c: Likewise.
2283 * utimecmp.c: Likewis.e
2285 Sync from coreutils.
2286 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2287 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2288 * .cvsignore: Add fts.h, search.h, t-fpending.
2289 * settime.c (settime): Fix { typo in previous patch. Also, don't
2290 bother returning ENOSYS if settimeofday or stime fails; just let
2291 them return whatever errno they want to return.
2292 * utimens.c: Include unistd.h, for dup2.
2293 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2294 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2296 2005-10-02 Jim Meyering <jim@meyering.net>
2298 Sync from coreutils.
2299 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2300 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2301 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2302 Remove AT_FDCWD test.
2303 Do not consume the fd unless successful.
2304 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2305 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2306 block, so that we don't even try to compile it if settimeofday is
2307 available. This works around a compilation failure on OSF1 V5.1,
2308 due to stime requiring a `long int*' while tv_sec is `int'.
2310 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2312 * getdelim.c (getdelim): Remove unused variables.
2314 2005-10-01 Simon Josefsson <jas@extundo.com>
2316 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2317 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2318 AI_* and EAI_* definitions. Protect function declarations.
2320 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2322 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2323 so that the code works even with ancient cpp. Portability problem
2324 with GCC 2.7.2.1 reported by Thomas M.Ott.
2326 2005-09-27 Jim Meyering <jim@meyering.net>
2328 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2330 * intprops.h (signed_type_or_expr__): Define.
2331 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2334 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2336 * verify.h (verify_expr): Remove, replacing with:
2337 (verify_true): New macro that returns true instead of void.
2338 (verify_type__): Remove.
2339 (verify): Use verify_true rather than verify_type__.
2341 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2343 * utimens.c (ENOSYS): Define if not already defined.
2344 (futimens): Support having a null PATH if the file descriptor
2347 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2349 (__attribute): Define to empty unless GCC 3.1 or later.
2350 This works around a core dump on OpenBSD 3.4, which has GCC
2351 2.95.3, which dumps core when given __attribute__(()). It also
2352 simplifies other tests, since we really don't want to bother with
2353 worrying about which ancient version of GCC supported what.
2354 Original problem reported by Yoann Vandoorselaere, with part of
2355 the fix suggested by Derek Price.
2357 2005-09-24 Jim Meyering <jim@meyering.net>
2359 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2360 so we can once again use a positive bitfield width of 1 -- now we
2361 don't have to explain why we were using a bitfield width of 2.
2363 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2365 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2366 Problem reported by Eric Blake.
2367 (getaddrinfo): Initialize se so that it's not garbage.
2368 Redo internal storage allocation so that it doesn't make unportable
2369 assumptions about alignment.
2372 * utimens.c (futimens): Use futimesat if available.
2373 Prefer it to futimes since it doesn't have the futimes bug.
2375 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2376 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2377 Instead, declare a function that returns a pointer to an array,
2378 and use verify_type__ to declare the size of the array.
2379 Problem and germ of a solution reported by Bruno Haible.
2380 (verify_type__): Use 2, not 1, for bitfield size, to avoid
2381 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
2383 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
2385 Sync from coreutils.
2387 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2389 * argmatch.h: Include verify.h
2390 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2391 (ARGMATCH_ASSERT): Remove; unused.
2392 * canonicalize.c: Assume STDC_HEADERS.
2393 * exclude.c: Include "strcase.h".
2394 * regex_internal.h [!defined _LIBC]: Likewise.
2395 * getusershell.c: Include stdio--.h rather than stdio.h
2397 (getusershell): Call fopen, not fopen_safer.
2398 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2399 Do not include unistd-safer.h.
2400 (save_cwd): Don't call fd_safer; no longer needed
2401 now that we include fcntl--.h.
2403 * getdate.y (relative_time): New type.
2404 (RELATIVE_TIME_0): New constant.
2405 (parser_control): Use relative_time instead of doing it ourselves.
2406 (%union): Add new relative_time rel member.
2407 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2409 (relunit, relunit_snumber): Now of type rel.
2410 (zone, rel, relunit, get_date): Adjust to above changes.
2412 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2413 Do not include unistd-safer.h.
2414 (getloadavg): Don't call fd_safer; no longer needed
2415 now that we include fcntl--.h.
2417 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2418 (make_dir_parents): Treat ENOSYS like EEXIST.
2420 Improve quality of diagnostics on restore_cwd failure.
2421 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
2422 (make_dir_parents): Last arg is now int * (for errno), not bool *.
2423 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2424 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2425 each time through the loop. Do not diagnose restore_cwd failure;
2426 that is the caller's job (and perhaps the caller does not care).
2428 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2429 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2430 If the file already exists but is not a directory, don't bother
2431 to try to make its parents.
2432 Close potential file descriptor leak if we can't chdir("/") (!).
2433 Don't always return true if chdir($PWD) fails; return true only
2434 if the requested action was done successfully (except for the
2436 Don't log final directory unless we actually made it.
2437 Refactor to avoid duplicate code to fix up permissions.
2438 Don't attempt to fix up parent permissions if chdir($PWD) fails.
2440 * strftime.c (my_strftime): Rewrite the previous change slightly,
2441 to make it a bit faster and (I hope) clearer.
2442 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2443 Fix bug in formats like %2N.
2445 * verify.h: New file.
2447 2005-09-22 Jim Meyering <jim@meyering.net>
2449 Sync from coreutils.
2451 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2453 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2454 the .tm_year member, since otherwise gcc-4.0 would now warn about
2455 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2457 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2458 order to avoid an unsuppressible warning from gcc on 64-bit systems.
2460 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2461 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2462 when run in a time zone for which daylight savings time is in effect
2463 for the starting date.
2465 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2466 stop us from restricting permissions of just-created absolute-named
2468 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2469 to restore initial working directory.
2470 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2471 to tell caller if/when we change the working directory and are
2472 unable to return to the initial one.
2473 * mkdir-p.h (make_dir_parents): Update prototype.
2474 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2475 `return false'. This fixes a bug introduced on 2004-07-30.
2477 * openat.c (fdopendir): Be sure to close the supplied
2478 file descriptor before returning. This makes our replacement
2479 implementation a little closer to Solaris's, where fdopendir
2480 ties the file descriptor to the returned DIR* pointer.
2481 * openat.c (unlinkat): New function.
2482 * openat.h (unlinkat): Add prototype.
2483 * openat-die.c (openat_save_fail): Rename from openat_save_die.
2484 (openat_restore_fail): Rename from openat_restore_die.
2485 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2487 Provide an alternative to exiting immediately upon save_cwd or
2488 restore_cwd failure. Now, an application can arrange e.g.,
2489 to perform a longjump in that case.
2490 * openat.c: Include dirname.h.
2491 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2492 (rpl_openat, fdopendir, fstatat): Call openat_save_die
2493 and openat_restore_die rather than calling error directly.
2494 Don't include "error.h" or "exitfail.h"; they're no longer needed.
2496 * openat-die.c (openat_save_die, openat_restore_die): New file.
2497 * openat.h (openat_save_die, openat_restore_die): Declare and define.
2499 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2500 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2501 int utc, int nanoseconds);
2503 date should not have to allocate a megabyte of virtual memory to
2504 handle a format argument like +%1048575T. When implemented with
2505 strftime, it must allocate such a buffer, use strftime to fill it
2506 in, print it, then free it.
2507 With fprintftime, it simply prints everything and exits.
2508 With no need for memory allocation, that's one fewer way to fail.
2509 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2510 optional field width, not before, so we accept %9:z, not %:9z.
2511 (my_strftime): Be sure to use L_('x') for literals.
2513 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2514 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2515 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2516 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2517 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2518 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2519 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2520 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2521 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2523 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2524 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2525 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2526 and don't include <sys/file.h>).
2528 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
2530 Sync from coreutils.
2532 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2533 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2534 [!LDAV_DONE]: Avoid unused variable warning.
2536 2005-09-21 Bruno Haible <bruno@clisp.org>
2538 * unicodeio.h (unicode_to_mb): New declaration.
2540 2005-09-20 Derek Price <derek@ximbiot.com>
2542 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2544 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2546 Use a consistent style for including <config.h>.
2547 * __fpending.c, acl.c, argmatch.c,
2548 argp-help.c, argp-parse.c,
2549 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2550 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2551 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2552 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2553 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2554 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2555 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2556 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2557 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2558 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2559 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2560 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2561 modechange.c, mountlist.c, open-safer.c, physmem.c,
2562 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2563 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2564 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2565 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2566 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2567 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2568 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2569 userspec.c, utimecmp.c, version-etc-fsf.c,
2570 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2571 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2572 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2573 Standardize inclusion of config.h.
2574 * __fpending.h, dirfd.h, getdate.h, human.h,
2575 inttostr.h: Removed inclusion of config.h from header files.
2576 * inttostr.c: Adjusted in-tree users.
2577 * timespec.h: Remove superfluous warning to include config.h.
2578 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2579 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2580 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2581 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2583 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
2585 * stat-time.h: New file.
2586 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2587 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
2589 (timespec_cmp): New function.
2590 * utimecmp.c: Include stat-time.h.
2591 (SYSCALL_RESOLUTION): Depend on whether various struct stat
2592 members exist, not on the obsolescent ST_MTIM_NSEC.
2593 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2595 2005-09-15 Derek Price <derek@ximbiot.com>
2596 Paul Eggert <eggert@cs.ucla.edu>
2598 * regcomp.c, regexec.c, regex_internal.c: Back out previous
2599 changes, consolidating in...
2600 * regex_internal.h: ...this file.
2602 2005-09-15 Derek Price <derek@ximbiot.com>
2604 * regex_internal.h: Blank `pure' for GNUC < 3.
2605 * regex_internal.c: Ditto, using this...
2606 (__GNUC_PREREQ): ...new macro.
2607 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2608 (__GNUC_PREREQ): ...this new macro.
2610 * strstr.h: Include string.h. Define strstr as a macro here.
2612 2005-09-13 Derek Price <derek@ximbiot.com>
2614 * canon-host.c (canon_host_r): Set *cherror on memory allocation
2616 Reported by Jim Meyering <jim@meyering.net>.
2618 2005-09-13 Jim Meyering <jim@meyering.net>
2620 * canon-host.c: Filter through gnu indent and reword comments slightly.
2621 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2623 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2625 * lib/base64.c: Typo.
2626 (base64_encode): Put b64str in initialized data section.
2628 2005-09-12 Derek Price <derek@ximbiot.com>
2630 Return usable errors from canon-host.
2631 * canon-host.h: New file.
2632 * canon-host.c (canon_host): Wrap...
2633 (canon_host_r): ...this new function, which now relies exclusively on
2635 (ch_strerror): New function.
2636 (last_cherror): New global.
2637 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2638 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
2640 (freeaddrinfo): Free ai->ai_canonname when set.
2642 2005-09-12 Derek Price <derek@ximbiot.com>
2643 Paul Eggert <eggert@cs.ucla.edu>
2645 * glob-libc.h: Renamed from glob_.h. The new version is
2646 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2647 protecting things that should be done only in gnulib contexts.
2648 * glob_.h: New file, containing only the glob things needed for
2650 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
2651 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2652 (glob, globfree, glob_pattern_p): Now defined simply in terms of
2653 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2654 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2655 and to respect the namespace rules better.
2657 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
2659 Merge glibc and coreutils changes into gnulib, plus a few
2661 * md5.c: Use #error rather than a string.
2662 (CYCLIC): New macro, from glibc source. Use it instead of rol.
2663 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2664 (__attribute__): Define to empty for non recent-GCC.
2665 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2666 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2667 Renamed from their non-__ counterparts, with new macros replacing
2668 them if not _LIBC. Add __THROW attribute.
2670 (struct md5_ctx): Align buffer if using GCC.
2671 * sha1.h (struct sha1_ctx): Likewise.
2672 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
2673 The old name was backwards.
2674 (NOTSWAP): Remove; not used.
2675 (rol): New macro, moved here from md5.h.
2676 (sha1_process_block): Remove a FIXME that doesn't make sense.
2678 2005-09-12 Derek Price <derek@ximbiot.com>
2680 * gai_strerror.c: Include config.h when available. Include
2681 getaddrinfo.h before other headers to test interface.
2682 Reported by Larry Jones <lawrence.jones@ugs.com>.
2684 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
2686 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2687 definitions, since that's the preferred style in glibc.
2688 Fix a minor spacing issue, and update copyright notice to match glibc's.
2690 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
2692 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2694 2005-09-06 Simon Josefsson <jas@extundo.com>
2696 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2697 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
2699 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
2701 Change bitset word type from unsigned int to unsigned long int,
2702 as this has better performance on typical 64-bit hosts.
2703 Port bitset code to hosts with unusual word sizes.
2704 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2705 (build_collating_symbol):
2706 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2707 argument is a bitset. This is merely a style issue, but it makes
2708 it clearer that an entire array is expected.
2709 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2710 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2711 Port to the case where bitset_word is not the same as unsigned int.
2712 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2713 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2715 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2716 (build_trtable, group_nodes_into_DFAstates):
2718 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2719 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2720 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2721 * regexec.c (group_nodes_into_DFAstates): Likewise.
2722 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2723 * regcomp.c (optimize_subexps, lower_subexp):
2724 Work even if bitset_word has holes in its bitwise representation.
2725 * regex_internal.h (BITSET_WORD_BITS): Likewise.
2726 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2728 * regex_internal.c (re_string_reconstruct):
2729 Don't assume UCHAR_MAX == 255.
2730 * regex_internal.h (bitset_set_all): Likewise.
2731 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2733 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
2734 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2736 (BITSET_WORD_MAX): New macro.
2737 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2738 (bitset_set_all, bitset_copy): Now inline functions, not macros.
2739 (bitset_empty, bitset_copy):
2740 Prefer sizeof (bitset) to multiplying it out ourselves.
2741 (bitset_not_merge): Remove; unused.
2742 (bitset_contain): Return bool, not unsigned int with one bit on.
2743 All callers changed.
2744 * regexec.c (build_trtable): Don't assume bitset has no stricter
2745 alignment than re_node_set; do this by defining a new internal
2746 type struct dests_alloc and using it to allocate memory.
2748 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
2750 Check for arithmetic overflow when calculating sizes, to prevent
2751 some buffer-overflow issues. These patches are conservative, in the
2752 sense that when I couldn't determine whether an overflow was possible,
2753 I inserted a run-time check.
2754 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2755 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2756 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2757 (re_xnrealloc, re_x2nrealloc): New inline functions.
2758 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2759 (build_equiv_class, build_charclass): Check for arithmetic overflow
2760 in size expression calculations.
2761 * lib/regex_internal.c (re_string_realloc_buffers):
2762 (build_wcs_upper_buffer, re_node_set_add_intersect):
2763 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2764 (re_dfa_add_node, register_state): Likewise.
2765 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2766 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2767 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2768 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2770 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
2772 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2773 to avoid a collision with bits/local_lim.h in glibc.
2774 All uses changed. Problem reported by Dmitry V. Levin in
2775 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2777 * regex_internal.c (build_wcs_upper_buffer): Fix portability
2778 bugs in int versus size_t comparisons.
2779 (re_string_context_at): Fix bug where the code assumed that
2782 Use bool where appropriate.
2783 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2784 All callers changed.
2785 (calc_eclosure_iter): Likewise, for ROOT arg.
2786 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2787 (build_charclass_op): Likewise, for NON_MATCH arg.
2788 * regex_internal.c (re_string_allocate, re_string_construct):
2789 (re_string_construct_common): Likewise, for ICASE arg.
2790 * regexec.c (re_search_2_stub, re_search_stub):
2791 Likewise, for RET_LEN arg.
2792 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2793 (set_regs): Likewise, for FL_BACKTRACK arg.
2794 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2795 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2796 (calc_eclosure_iter, parse_bracket_exp):
2797 Use bool for internal variables that are booleans.
2798 * regexec.c (re_search_internal, check_matching, proceed_next_node):
2799 (set_regs, build_sifted_states, sift_states_bkref):
2800 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2801 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2802 (find_collation_sequence_value):
2804 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2805 (re_node_set_compare):
2806 Return bool, not int. All callers changed.
2807 * regexec.c (check_halt_node_context, check_dst_limits):
2808 (build_trtable, check_node_accept): Likewise.
2809 * regex_internal.h: Include stdbool.h.
2811 Fix bugs uncovered when converting to bool.
2812 * regcomp.c (calc_eclosure_iter): Check for storage allocation
2813 failure instead of charging ahead blindly.
2814 * regex_internal.c (register_state): Likewise.
2815 * regexec.c (re_search_2_stub): Use simpler method than boolean
2816 for freeing internal storage.
2817 (group_nodes_into_DFA_states): Use unsigned int, not int, for
2818 bitset pieces used as boolean, to avoid undefined behavior
2819 on hosts that do int overflow checking.
2821 2005-08-31 Derek Price <derek@ximbiot.com>
2823 * getdelim.c (getdelim): Return EOF on EOF.
2824 Reported by Larry Jones <lawrence.jones@ugs.com>.
2826 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2828 * regex_internal.c (re_string_reconstruct): Don't assume buffer
2829 lengths fit in regoff_t; this isn't true if regoff_t is the same
2831 * regex.c (re_search_internal): 5th arg is LAST_START
2832 (= START + RANGE) instead of RANGE. This avoids overflow
2833 problems when regoff_t is the same width as size_t.
2834 All callers changed.
2835 (re_search_2_stub): Check for overflow when adding the
2836 sizes of the two strings.
2837 (re_search_stub): Check for overflow when adding START
2838 to RANGE; if it occurs, substitute the extreme value.
2840 2005-08-31 Jim Meyering <jim@meyering.net>
2842 * regcomp.c (search_duplicated_node): Make first pointer arg
2844 * regex_internal.c (create_ci_newstate, create_cd_newstate):
2845 (register_state): Likewise.
2846 * regexec.c (search_cur_bkref_entry, check_dst_limits):
2847 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2848 (group_nodes_into_DFAstates): Likewise.
2850 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2852 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2853 old glibc regex code mishandles strings longer than 2**31 bytes.
2854 This patch fixes this when the regex code is used in gnulib
2855 (i.e., outside glibc).
2857 This patch should not affect the use of the regex code inside
2858 glibc. No doubt this problem also needs to be handled for glibc
2859 as well, but the result will be an incompatible change to the
2860 glibc ABI, and the old ABI will have to be supported too. That
2861 can be the the subject for another patch.
2863 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2864 governing whether the rest of this patch is active. By default,
2865 the macro is disabled and the patch has no effect.
2866 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2867 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2868 (struct re_pattern_buffer, re_search, re_search_2, re_match):
2869 (re_match_2, re_set_registers): Use the new types.
2870 * regex_internal.h (Idx, re_hashval_t): New types.
2871 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2873 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2874 (re_string_context_at, bin_tree_t, re_dfastate_t):
2875 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2876 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2877 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2878 (re_string_char_size_at, re_string_wchar_at):
2879 (re_string_elem_size_at):
2880 Use the new types and macros to port to 64-bit hosts.
2881 Use unsigned types for internal values, so that the code
2882 mostly works even for arrays larger than SSIZE_MAX.
2883 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2884 (search_duplicated_node, calc_eclosure_iter, fetch_number):
2885 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2886 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2887 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2888 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2889 (calc_inveclosure, parse_dup_op, build_range_exp):
2890 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2891 (fetch_number, create_token_tree, mark_opt_subexp):
2893 * regex_internal.c (re_string_construct_common, create_ci_newstate):
2894 (create_cd_newstate, re_string_allocate, re_string_construct):
2895 (re_string_realloc_buffers, build_wcs_upper_buffer):
2896 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2897 (re_string_reconstruct, re_string_peek_byte_case):
2898 (re_string_fetch_byte_case, re_string_context_at):
2899 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2900 (re_node_set_init_copy, re_node_set_add_intersect):
2901 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2902 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2903 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2904 (re_acquire_state, re_acquire_state_context, register_state):
2906 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2907 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2908 (re_search_internal, re_search_2_stub, re_search_stub)
2909 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2910 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2911 (update_cur_sifted_state, check_dst_limits):
2912 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2913 (check_subexp_limits, sift_states_bkref, merge_state_array):
2914 (check_subexp_matching_top, get_subexp, get_subexp_sub):
2915 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2916 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2917 (expand_bkref_cache, check_node_accept_bytes):
2918 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2919 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2920 (acquire_init_state_context, check_halt_node_context):
2921 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2922 (sift_states_backward, clean_state_log_if_needed):
2923 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2924 (find_recover_state, transit_state_sb, transit_state_mb):
2925 (transit_state_bkref, build_trtable, match_ctx_clean):
2927 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2928 to work around an assumption that REG_MISSING is negative.
2930 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2931 (seek_collating_symbol_entry) [defined _LIBC]:
2932 (lookup_collation_sequence_value) [defined _LIBC]:
2933 (build_range_exp, build_collating_symbol) [defined _LIBC]:
2934 Use prototypes rather than old-style function definitions.
2935 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2936 (transit_state_sb) [0]:
2937 (find_collation_sequence_value) [defined _LIBC]: Likewise.
2939 * regexec.c (re_search_internal): Simplify update of rm_so and
2942 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2943 (optimize_subexps, lower_subexp):
2944 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2945 since the signed shift might overflow. Use 1u<<31 instead.
2946 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2947 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2950 * regcomp.c (optimize_subexps, lower_subexp):
2951 Use CHAR_BIT rather than 8, for clarity.
2952 * regexec.c (check_dst_limits_calc_pos_1):
2953 (check_subexp_matching_top): Likewise.
2954 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2955 have to worry about portability issues when shifting it left.
2956 Remove no-longer-needed test for table_size > 0.
2957 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2958 in a word, as the resulting behavior is undefined.
2959 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2960 in one case, a <= should have been an <, and in another case the
2961 whole test was missing.
2962 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
2963 the standard name CHAR_BIT.
2964 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2965 this is not true on one's complement and signed-magnitude hosts.
2967 * regex_internal.h (re_sub_match_top_t): Remove unused member
2969 (struct re_dfa_t): Remove unused member states_alloc.
2970 * regcomp.c (init_dfa): Don't initialize unused members.
2972 2005-08-31 Bruno Haible <bruno@clisp.org>
2974 * strstr.c: Include <stddef.h>, for NULL.
2975 * strcasestr.c: Likewise.
2976 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2978 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
2980 * iconvme.h: Add prototype for iconv_alloc.
2982 2005-08-29 Simon Josefsson <jas@extundo.com>
2984 * iconvme.c: Fix errno.
2986 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
2988 * iconvme.c: Split iconv_string into iconv_alloc.
2990 2005-08-27 Jim Meyering <jim@meyering.net>
2992 * fopen-safer.c: Merge minor changes from coreutils.
2993 * dup-safer.c: Likewise.
2994 * fd-safer.c: Likewise.
2996 Merge from coreutils.
2997 * stdio--.h: New file.
2998 * stdlib--.h: New file.
2999 * mkstemp-safer.c: New file.
3001 GNU tar needs these.
3002 * pipe-safer.c: New file.
3003 * creat-safer.c: New file.
3004 * fcntl--.h (creat): Define to creat_safer.
3005 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3006 * unistd--.h (pipe): Define to pipe_safer.
3007 * unistd-safer.h: Declare pipe_safer.
3009 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3011 * regex_internal.h: Remove all references to
3012 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3014 (bitset_not, bitset_merge, bitset_not_merge):
3015 (bitset_mask, re_string_allocate, re_string_construct):
3016 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3017 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3018 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3019 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3020 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3021 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3022 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3023 (re_acquire_state_context):
3024 Remove unnecessary forward decls.
3025 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3026 Put __attribute at function definition,
3027 now that the function decl has been removed.
3028 * lib/regex_internal.c (re_string_peek_byte_case):
3029 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3032 2005-08-26 Simon Josefsson <jas@extundo.com>
3034 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3035 Haible <bruno@clisp.org>.
3037 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3039 * regexec.c (set_regs): Don't alloca with an unbounded size.
3041 alloca modernization/simplification for regex.
3042 * regex.c: Remove portability cruft for alloca. This no longer
3043 needs to be at the start of the file, and can be moved into
3044 regex_internal.h and simplified.
3045 * regex_internal.h: Include <alloca.h>.
3046 (__libc_use_alloca) [!defined _LIBC]: New macro.
3047 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3048 now works outside glibc.
3050 2005-08-24 Simon Josefsson <jas@extundo.com>
3052 * getpass.c: Add WIN32 implementation. Conditionalize use of
3053 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3054 GLIBC specific code.
3056 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3058 Make regex safe for g++. This fixes one real bug (an "err"
3059 that should have been "*err"). g++ problem reported by
3061 * regex_internal.h (re_calloc): New macro, consistent with
3062 re_malloc etc. All callers of calloc changed to use re_calloc.
3063 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3064 not int. All callers changed.
3065 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3066 just use an array of size MB_LEN_MAX.
3067 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3068 (find_recover_state): Change "err" to "*err"; this fixes what
3069 appears to be a real bug.
3070 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3073 2005-08-25 Jim Meyering <jim@meyering.net>
3075 * open-safer.c: Include <config.h>.
3076 Otherwise, we'd lose LARGEFILE support in any file using
3079 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3081 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3082 * regex.h (regerror): Likewise.
3084 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3085 requires this. (The code never needed it.)
3087 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3088 All uses of recently-renamed identifiers changed to use the new,
3089 POSIX-compliant names. The code will build and run just fine
3090 without these changes, but it's better to eat our own dog food
3091 and use the standard-conforming names.
3093 * regex.h: Fix a multitude of POSIX name space violations.
3094 These changes have an effect only for programs that define
3095 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3096 do not change anything for programs compiled in the normal way.
3097 Also, there is no effect on the ABI.
3099 (_REGEX_SOURCE): New macro.
3100 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3101 defined and _GNU_SOURCE is not; this fixes a name space violation.
3103 Rename the following macros to obey POSIX requirements.
3104 The old names are still visible as macros if _REGEX_SOURCE is defined.
3105 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3106 RE_BACKSLASH_ESCAPE_IN_LISTS.
3107 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3108 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3109 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3110 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3111 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3112 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3113 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3114 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3115 (REG_INTERVALS): renamed from RE_INTERVALS.
3116 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3117 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3118 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3119 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3120 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3121 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3122 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3123 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3124 RE_UNMATCHED_RIGHT_PAREN_ORD.
3125 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3126 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3127 (REG_DEBUG): renamed from RE_DEBUG.
3128 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3129 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3130 unusual, since we can't clash with the POSIX REG_ICASE.
3131 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3132 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3133 (REG_NO_SUB): renamed from RE_NO_SUB.
3134 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3135 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3136 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3137 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3138 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3139 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3140 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3141 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3142 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3143 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3144 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3145 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3146 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3147 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3148 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3149 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3150 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3151 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3152 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3153 (REG_FIXED): Renamed from REGS_FIXED.
3154 (REG_NREGS): Renamed from RE_NREGS.
3156 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3157 of other REG_* macros, since POSIX says the user is allowed to
3158 #undef these macros selectively.
3160 (reg_errcode_t): Update comment stating what other tables need
3163 Rename the following enum values to obey POSIX requirements.
3164 The old names are still visible as macros.
3165 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3166 is not defined, since GNU is supposed to be a superset of POSIX as
3167 much as possible, and since we want reg_errcode_t to be a signed
3168 type for implementation consistency.
3169 (_REG_NOERROR): Renamed from REG_NOERROR.
3170 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3171 (_REG_BADPAT): Renamed from REG_BADPAT.
3172 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3173 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3174 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3175 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3176 (_REG_EBRACK): Renamed from REG_EBRACK.
3177 (_REG_EPAREN): Renamed from REG_EPAREN.
3178 (_REG_EBRACE): Renamed from REG_EBRACE.
3179 (_REG_BADBR): Renamed from REG_BADBR.
3180 (_REG_ERANGE): Renamed from REG_ERANGE.
3181 (_REG_ESPACE): Renamed from REG_ESPACE.
3182 (_REG_BADRPT): Renamed from REG_BADRPT.
3183 (_REG_EEND): Renamed from REG_EEND.
3184 (_REG_ESIZE): Renamed from REG_ESIZE.
3185 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3186 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3187 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3188 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3189 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3191 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3192 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3193 changed. But support the old name if the new one is not defined
3194 and if _REGEX_SOURCE.
3196 Change the following member names in struct re_pattern_buffer.
3197 The old names are still supported if !_REGEX_SOURCE.
3198 The new names are always supported, regardless of _REGEX_SOURCE.
3199 (re_buffer): Renamed from buffer.
3200 (re_allocated): Renamed from allocated.
3201 (re_used): Renamed from used.
3202 (re_syntax): Renamed from syntax.
3203 (re_fastmap): Renamed from fastmap.
3204 (re_translate): Renamed from translate.
3205 (re_can_be_null): Renamed from can_be_null.
3206 (re_regs_allocated): Renamed from regs_allocated.
3207 (re_fastmap_accurate): Renamed from fastmap_accurate.
3208 (re_no_sub): Renamed from no_sub.
3209 (re_not_bol): Renamed from not_bol.
3210 (re_not_eol): Renamed from not_eol.
3211 (re_newline_anchor): Renamed from newline_anchor.
3213 Change the following member names in struct re_registers.
3214 The old names are still supported if !_REGEX_SOURCE.
3215 The new names are always supported, regardless of _REGEX_SOURCE.
3216 (rm_num_regs): Renamed from num_regs.
3217 (rm_start): Renamed from start.
3218 (rm_end): Renamed from end.
3220 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3221 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3222 Prepend __ to parameter names.
3224 Undo yesterday's changes.
3226 2005-08-24 Jim Meyering <jim@meyering.net>
3228 Sync from coreutils.
3229 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3231 2005-08-21 Bruno Haible <bruno@clisp.org>
3233 * lock.h: Add multiple inclusion guard.
3234 * tls.h: Add multiple inclusion guard.
3236 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3238 * regex.h (REG_NOSYS)
3239 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3240 Define, since POSIX requires it as of 2001.
3241 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3242 New private symbol, used to keep the enum signed in all cases.
3243 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3244 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3246 * regex_internal.c (re_string_skip_chars, register_state):
3248 Remove forward decls; no longer needed now that we use prototypes.
3249 * regexec.c (acquire_init_state_context, check_halt_node_context):
3250 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3251 (clean_state_log_if_needed): Likewise.
3253 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3255 Fix problems reported by Sam Steingold in
3256 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3257 * regexec.c (sift_states_bkref): Fix portability bug: the code
3258 assumed that reg_errcode_t is a signed type, which is not
3259 necessarily true if _XOPEN_SOURCE is not defined.
3260 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3261 some compilers warn about it otherwise.
3263 2005-08-20 Jim Meyering <jim@meyering.net>
3265 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3266 of unused local, dfa.
3268 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3270 * regcomp.c (create_initial_state): Remove duplicate decl.
3271 (init_word_char, create_initial_state, duplicate_node_closure):
3272 (fetch_token, peek_token_bracket, build_range_exp):
3273 (build_collating_symbol): Remove forward decls; no longer needed
3274 now that we use prototypes.
3277 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3278 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3279 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3280 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3281 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3282 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3283 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3284 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3285 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3286 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3287 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3288 (build_charclass, build_charclass_op, fetch_number, create_tree):
3289 (create_token_tree, mark_opt_subexp, duplicate_tree):
3290 Use prototypes rather than old-style definitions.
3293 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3294 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3295 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3296 (re_string_reconstruct, re_string_peek_byte_case):
3297 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3298 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3299 (re_node_set_init_copy, re_node_set_add_intersect):
3300 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3301 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3302 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3303 (re_acquire_state, re_acquire_state_context, register_state):
3304 (create_ci_newstate, create_cd_newstate, free_state):
3306 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3307 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3308 (re_search_internal, prune_impossible_nodes):
3309 (acquire_init_state_context, check_matching, static):
3310 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3311 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3312 (update_regs, sift_states_backward, build_sifted_states):
3313 (clean_state_log_if_needed, merge_state_array):
3314 (update_cur_sifted_state, add_epsilon_src_nodes):
3315 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3316 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3317 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3318 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3319 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3320 (check_arrival, check_arrival_add_next_nodes):
3321 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3322 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3323 (check_node_accept_bytes, check_node_accept, extend_buffers):
3324 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3325 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3330 (re_string_allocate, re_string_construct, re_string_reconstruct):
3331 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3332 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3333 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3334 (re_string_context_at, re_string_peek_byte_case):
3335 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3336 is defined, since we now use prototypes always.
3338 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3339 C89 or better. All uses removed.
3341 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3343 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3344 [defined lint]: Suppress bogus uninitialized-variable warnings.
3346 * regcomp.c (duplicate_node): Return new index, not an error code,
3347 and let the caller return REG_ESPACE if out of space. This
3348 removes an uninitialied-variable warning with GCC 4.0.1, and also
3349 avoids taking the address of a local variable. All callers
3352 2005-08-19 Jim Meyering <jim@meyering.net>
3354 * regexec.c (proceed_next_node): Redo local variables to
3355 avoid GCC shadowing warnings.
3357 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3359 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3360 (re_node_set_insert_last, re_dfa_add_node):
3361 Rename local variables to avoid GCC shadowing warnings.
3363 2005-08-18 Bruno Haible <bruno@clisp.org>
3365 * strstr.c (strstr): Fix return value in multibyte case.
3366 * strcasestr.c (strcasestr): Likewise.
3368 2005-08-17 Jim Meyering <jim@meyering.net>
3370 Make the %s format (seconds since the epoch) work for a negative
3371 number and when used with a zero-padded field width, e.g. %015s.
3373 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3374 label so that it precedes the code to set `digits'. Otherwise,
3375 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
3376 print `00-22'. Now, it prints `-0022', as it should.
3378 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
3380 * regex.h: Remove useless space-before-tab. From coreutils.
3382 2005-08-17 Bruno Haible <bruno@clisp.org>
3384 * strcasestr.h: New file.
3385 * strcasestr.c: New file.
3387 2005-08-17 Bruno Haible <bruno@clisp.org>
3389 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3390 * strstr.c: Completely rewritten, with multibyte locale support.
3392 2005-08-17 Bruno Haible <bruno@clisp.org>
3394 * strcasecmp.c: Use mbuiter.h.
3396 2005-08-17 Bruno Haible <bruno@clisp.org>
3398 * mbuiter.h: New file.
3400 2005-08-16 Bruno Haible <bruno@clisp.org>
3402 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3404 (mbi_avail, mbi_advance): Let the iteration end before the terminating
3405 NUL byte, not after it.
3407 2005-08-16 Bruno Haible <bruno@clisp.org>
3409 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3410 the valid ones. Makes the comparison operations transitive:
3411 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3412 * strcasecmp.c (strcasecmp): Use mb_casecmp.
3414 2005-08-16 Bruno Haible <bruno@clisp.org>
3416 * strcase.h (strcasecmp): Add note in comments.
3417 * strncasecmp.c: Use code from strcasecmp.c.
3418 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3419 (strcasecmp): Work correctly in multibyte locales.
3421 2005-08-16 Bruno Haible <bruno@clisp.org>
3423 * strnlen1.h: New file.
3424 * strnlen1.c: New file.
3426 2005-08-16 Bruno Haible <bruno@clisp.org>
3428 * mbfile.h: New file.
3430 2005-08-16 Bruno Haible <bruno@clisp.org>
3432 * mbiter.h: New file.
3434 2005-08-16 Bruno Haible <bruno@clisp.org>
3436 * mbchar.h: New file.
3437 * mbchar.c: New file.
3439 2005-08-16 Bruno Haible <bruno@clisp.org>
3441 * tls.h: New file, from GNU gettext.
3442 * tls.c: New file, from GNU gettext.
3444 2005-08-15 Bruno Haible <bruno@clisp.org>
3446 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3449 2005-08-14 Jim Meyering <jim@meyering.net>
3451 Sync from coreutils.
3453 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3454 Use the hash-table-based cycle-detection code not just when
3455 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3456 Reported by James Youngman in
3457 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3458 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3459 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3460 This lets us compile with -DFTS_DEBUG, once again.
3461 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3462 * fts.c (fd_safer): Remove decl.
3463 Include fcntl--.h rather than unistd-safer.h
3464 (fts_safe_changedir): Don't call fd_safer; no longer needed
3465 now that we include fcntl--.h.
3467 2005-08-11 Simon Josefsson <jas@extundo.com>
3469 * readline.h, readline.c: New file.
3471 2005-08-11 Bruno Haible <bruno@clisp.org>
3473 * strnlen.h (strnlen): Change parameter name to match comment.
3475 2005-08-10 Simon Josefsson <jas@extundo.com>
3477 * strndup.c: Use strnlen.h.
3479 * strnlen.h: New file.
3481 2005-08-02 Simon Josefsson <jas@extundo.com>
3483 * getline.h, getline.c: Rewrite.
3485 * getdelim.h, getdelim.c: New files, ported from glibc.
3487 2005-07-31 Bruno Haible <bruno@clisp.org>
3489 * lock.h (gl_lock_initializer): New macro.
3490 (gl_lock_define_initialized): Use it.
3491 (gl_rwlock_initializer): New macro.
3492 (gl_rwlock_define_initialized): Use it.
3493 (gl_recursive_lock_initializer): New macro.
3494 (gl_recursive_lock_define_initialized): Use it.
3496 2005-07-26 Bruno Haible <bruno@clisp.org>
3498 * lock.h: Update from GNU gettext.
3499 * lock.c: Update from GNU gettext.
3501 2005-07-18 Bruno Haible <bruno@clisp.org>
3503 * lock.h (gl_once_t): New type.
3504 (gl_once_define, gl_once): New macros.
3505 * lock.c (fresh_once): New variable.
3506 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3509 2005-07-18 Simon Josefsson <jas@extundo.com>
3511 * check-version.c (check_version): Accept identical versions too.
3513 2005-07-18 Bruno Haible <bruno@clisp.org>
3515 * lock.h: New file, from GNU gettext.
3516 * lock.c: New file, from GNU gettext.
3518 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
3520 * quotearg.c: Add translator comment suggested by Bruno Haible,
3521 with a minor change.
3523 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3525 * version-etc-fsf.c (version_etc_copyright): Parameterize the
3526 copyright symbol and the year.
3527 * version-etc.c (COPYRIGHT_YEAR): New constant.
3528 (version_etc_va): Use parameterized copyright notice.
3529 Reword to conform to the current GNU coding standards.
3531 2005-07-11 Simon Josefsson <jas@extundo.com>
3533 * size_max.h: New file.
3535 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
3537 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3540 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
3541 and Paul Eggert <eggert@cs.ucla.edu>
3543 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3544 in wint_t, not wchar_t. Remove now-unnecessary cast.
3546 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3548 * regex.c, regex.h: Sync from libc.
3549 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3550 New files, synced from libc, except that regex_internal.h
3551 currently has a small porting fix.
3553 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
3555 Remove the dependency of the strftime module on the tzset module.
3556 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3557 Copy the input structure, to work around some of the bug with
3558 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
3559 Solaris releases, you should also use the tzset module, but we won't
3560 require it as a dependency any more since we don't want LGPLed code
3561 to depend on GPLed code.
3563 2005-07-02 Jim Meyering <jim@meyering.net>
3565 * backupfile.c (backup_args): Change a `0' to NULL.
3567 2005-07-01 Jim Meyering <jim@meyering.net>
3569 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3570 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3571 * save-cwd.c, tempname.c:
3572 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3573 and don't include <sys/file.h>).
3575 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
3577 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3578 declares only 'struct timespec;' (!).
3580 2005-06-29 Jim Meyering <jim@meyering.net>
3582 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3583 type name. Use the variable name instead.
3584 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3586 2005-06-28 Simon Josefsson <jas@extundo.com>
3588 * check-version.h, check-version.c: New files.
3590 2005-06-28 Simon Josefsson <jas@extundo.com>
3592 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
3593 collision with global variable. Better indentation. Don't
3594 increment buffer pointer beyond buffer end. Based on comments
3595 from Paul Eggert <eggert@cs.ucla.edu>.
3599 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
3601 * canon-host.c (canon-host): Append trailing "," to 0 in
3602 initializer of struct addrinfo, as an indication that we don't
3603 care how many members the structure has.
3605 2005-06-24 Derek Price <derek@ximbiot.com>
3606 and Bruno Haible <bruno@clisp.org>
3608 Remove stat module & update lstat.
3609 * stat.c: Remove this file...
3610 (slash_aware_lstat): ...moving this content and its support...
3611 * lstat.c (rpl_lstat): ...into here.
3612 * lstat.h: New file.
3614 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
3616 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
3617 (ranged_convert): Don't save conversion in a temporary struct.
3618 This causes a warning with GCC 4.0.0, and anyway in the typical
3619 case it's not worth the extra 100 bytes or so of code.
3620 (ranged_convert, __mktime_internal): When calling a function via a
3621 pointer P, use P () rather than (*P) (), as we now assume C89 or
3624 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
3626 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3627 "who -r" failed to give output. Problem reported by Tim Waugh.
3629 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3630 (xcalloc): Use it to avoid needless tests.
3631 Problem reported by Jim Meyering.
3633 2005-06-16 Jim Meyering <jim@meyering.net>
3635 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3636 when either N or S is zero.
3638 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3640 * argp.h (__option_is_short): Check upper limit of
3641 __key. Isprint() requires its argument to have the value
3642 of an unsigned char or EOF.
3644 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
3646 * fnmatch.c (fnmatch): If there is an encoding error in a
3647 multibyte string or pattern, fall back on unibyte matching.
3648 Problem reported by James Youngman.
3650 2005-06-08 Bruno Haible <bruno@clisp.org>
3652 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3655 2005-06-08 Bruno Haible <bruno@clisp.org>
3657 * csharpcomp.h: New file, from GNU gettext.
3658 * csharpcomp.c: New file, from GNU gettext.
3659 * csharpcomp.sh.in: New file, from GNU gettext.
3661 2005-06-07 Derek Price <derek@ximbiot.com>
3664 * glob_.h: Indent nested #ifdef.
3666 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
3668 Sync from coreutils.
3669 Use "file name" when talking about file names, instead of "filename"
3670 or "path", as per the GNU coding standards.
3671 * mkdir-p.c: Renamed from makepath.c.
3672 (make_dir_parents): Renamed from make_path. All callers changed.
3673 * mkdir-p.h: Likewise. All includers changed.
3674 * filenamecat.c: Renamed from path-concat.c.
3675 (file_name_concat): Renamed from path_concat. All callers changed.
3676 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3677 * filenamecat.h: Likewise. All includers changed.
3678 * acl.c: Don't use "path" or "filename" to mean "file name"
3679 in comments or local variable names.
3680 * basename.c: Likewise.
3681 * canonicalize.c, canonicalize.h: Likewise.
3682 * dirname.c, dirname.h: Likewise.
3683 * euidaccess.c: Likewise.
3684 * exclude.c: Likewise
3685 * fnmatch_.h, fnmatch_loop.c: Likewise.
3686 * fsusage.c, fsuage.h: Likewise.
3687 * fts.c, fts_.h: Likewise.
3688 * getcwd.c: Likewise.
3689 * getloadavg.c: Likewise.
3690 * mkstemp.c: Likewise.
3691 * mountlist.c, mountlist.h: Likewise.
3692 * openat.c, openat.h: Likewise.
3693 * readlink-stub.c: Likewise.
3694 * readutmp.c, readutmp.h: Likewise.
3695 * rename.c: Likewise.
3696 * rmdir.c: Likewise.
3698 * savedir.c: Likewise.
3699 * stripslash.c: Likewise.
3700 * tempname.c: Likewise.
3701 * xreadlink.c: Likewise.
3702 * exclude.c (excluded_file_name): Renamed from excluded_filename.
3704 * exclude.h: Likewise.
3706 * euidaccess.c (getuid, getgid, getuid, getegid)
3707 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3708 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3709 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3710 * pathmax.h: Include <limits.h> unconditionally, since other
3711 files have been getting away with it for years (MORE/BSD 4.3
3713 * userspec.c (getpwnam, getgrnam, getgrgid)
3714 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3716 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3717 Define to 256, not 255, as per modern POSIX.
3719 2005-06-01 Bruno Haible <bruno@clisp.org>
3721 * csharpexec.h: New file, from GNU gettext.
3722 * csharpexec.c: New file, from GNU gettext.
3723 * csharpexec.sh.in: New file, from GNU gettext.
3725 2005-05-31 Derek Price <derek@ximbiot.com>
3726 Paul Eggert <eggert@cs.ucla.edu>
3729 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3731 2005-05-29 Derek Price <derek@ximbiot.com>
3732 Paul Eggert <eggert@cs.ucla.edu>
3734 * glob_.h, glob.c: New files.
3736 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
3738 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3740 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3741 the configuration hassle isn't worth it.
3742 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3743 (LONGEST_MODIFIER, PRIuMAX): Remove.
3745 2005-05-27 Bruno Haible <bruno@clisp.org>
3747 * getlogin_r.h: Remove second include of <stddef.h>.
3749 2005-05-25 Bruno Haible <bruno@clisp.org>
3750 Derek Price <derek@ximbiot.com>
3752 * getlogin_r.h: Simplify API documentation.
3754 2005-05-25 Derek Price <derek@ximbiot.com>
3755 Paul Eggert <eggert@cs.ucla.edu>
3757 * getlogin_r.c, getlogin_r.h: New files.
3759 2005-05-22 Bruno Haible <bruno@clisp.org>
3761 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3762 Also include <sys/param.h> if it defines MIN, MAX.
3763 Based on a patch by Derek Price <derek@ximbiot.com>.
3765 2005-05-22 Bruno Haible <bruno@clisp.org>
3767 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3768 (INT64_MIN): Fix definition.
3769 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3771 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3772 NEED_SIGNED_INT_TYPES.
3774 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3775 HAVE_SYSTEM_INTTYPES.
3777 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
3779 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3780 so that unistd-safer.h (GPL'ed code) need not be included.
3782 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
3785 * fts.c: Don't include "cycle-check.h" or "hash.h".
3786 (setup_dir, free_dir): New functions.
3787 (enter_dir, leave_dir): Define trivial
3788 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
3789 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
3790 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3791 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3792 Move to fts-cycle.c.
3793 (fts_open): Use setup_dir.
3794 (fts_close): Use free_dir.
3795 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3796 This adds a label and some gotos, but the alternatives were messier.
3797 Check for memory allocation failure when entering a dir.
3798 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3799 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3800 (FTS): New member fts_cycle, that is a union that contains the
3801 old active_dir_ht and cycle_state. All uses changed to mention
3802 fts_cycle.ht and fts_cycle.state.
3803 * fts-cycle.c: New file, containing GPL'ed code migrated out of
3804 fts.c, with the following changes:
3805 (setup_dir, free_dir): New functions.
3806 (enter_dir): Now returns bool. Return true if successful, false
3807 if memory exhausted. All callers changed.
3808 Do not bother partly cleaning up on
3809 memory allocation failure; that is free_dir's job.
3810 However, free ad if hash_insert fails, to avoid memory leak.
3811 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3812 fts->fts_options to see which union member to use.
3814 2005-05-20 Jim Meyering <jim@meyering.net>
3816 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3817 Now a macro, to pacify GCC.
3819 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
3821 * chown.c (rpl_chown): Return -1 on failure.
3823 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
3825 * canonicalize.c: Include canonicalize.h first, to test interface.
3826 Include <stddef.h> unconditionally, since we assume C89 now.
3827 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3828 * fts.c: Include fts_.h first, to check interface.
3829 Do not include intprops.h; no longer needed.
3830 Include cycle-check.h and hash.h, since fts_.h no longer does.
3831 Remove unnecessary casts of closedir to void.
3832 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3833 decide whether to decrement nlinks.
3834 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3835 (FTS): Use struct hash_table * instead of Hash_table, so that
3836 we no longer need to include hash.h here.
3838 2005-05-17 Jim Meyering <jim@meyering.net>
3840 * fts.c, fts_.h: New files, from coreutils.
3842 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
3844 Sync from coreutils.
3845 * unlinkdir.c, unlinkdir.h: New files.
3846 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3847 regex.h, unlocked-io.h, xtime.h:
3848 White space changes only.
3849 * makepath.c (make_path): Port to hosts where leading "//" is special.
3850 * yesno.c: Include getline.h, not ctype.h.
3851 (yesno): Don't remove leading white space; POSIX doesn't allow it.
3852 Use getline to remove arbitrary restriction on response length.
3854 2005-05-13 Bruno Haible <bruno@clisp.org>
3856 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3857 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3858 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3859 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3860 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3861 Add support for 64-bit integers in the MSVC compiler.
3863 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
3865 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3866 Change the initial comment to refer to GPL, not LGPL.
3867 gnulib-tool will change it to LGPL as needed.
3869 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3870 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3871 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3872 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3873 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3874 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3875 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3876 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3877 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3878 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3879 concatpath.c, config.charset, copy-file.c, copy-file.h,
3880 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3881 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3882 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3883 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3884 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3885 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3886 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3887 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3888 full-read.c, full-read.h, full-write.c, full-write.h,
3889 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3890 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3891 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3892 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3893 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3894 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3895 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3896 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3897 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3898 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3899 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3900 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3901 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3902 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3903 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3904 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3905 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3906 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3907 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3908 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3909 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3910 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3911 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3912 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3913 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3914 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3915 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3916 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3917 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3918 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3919 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3920 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3921 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3922 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3923 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3924 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3925 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3926 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3927 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3928 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3929 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3930 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3931 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3932 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3933 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3934 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3935 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3936 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3937 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3938 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3939 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3940 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3941 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3942 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3943 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3944 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3945 Update FSF postal mail address.
3947 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3949 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3950 specified in ai_socktype. Fix invalid ai_protocol
3951 check. ai_protocol is usually set to 0 or depending on
3952 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
3953 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
3954 ai_socktype / ai_protocol in the returned addrinfo structure.
3956 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3957 Bruno Haible <bruno@clisp.org>
3959 * inet_ntop.h: New file.
3960 * inet_ntop.c: New file, from glibc with modifications.
3962 2005-05-08 Jim Meyering <jim@meyering.net>
3964 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3966 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
3968 Merge from coreutils. Among other things,
3969 add bulletproofing for cases where stdin, stdout, or stderr are closed.
3970 * fd-safer.c: New file.
3971 * fcntl-safer.h, open-safer.c: Remove.
3972 * chdir-long.c: Fix comment "fetish" -> "coreutils".
3973 * dup-safer.c: Include unistd-safer.h first.
3974 Don't include errno.h.
3975 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3976 * file-type.h: Don't assume invoker included sys/stat.h first.
3977 * file-type.c: Rely on file-type.h change.
3978 * getloadavg.c: Include unistd-safer.h.
3979 (getloadavg): Use safer open.
3980 * getusershell.c: Include "stdio-safer.h".
3981 (getusershell): Use safer fopen.
3982 * long-options.c (long_options): Use NULL rather than 0.
3983 * modechange.h (mode_free): Remove; all callers changed to invoke
3985 * modechange.c: Likewise.
3986 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3987 (MODE_DONE): New constant.
3988 (struct mode_change): Remove 'next' member.
3989 (make_node_op_equals): New function; like the old one of the
3990 same name, except it allocates an array.
3991 (mode_compile, mode_create_from_ref): Use it.
3992 (mode_compile): Allocate result as an array, not a linked list.
3993 Parse octal string ourself, so that we catch mistakes like "+0".
3994 (mode_adjust): Arg is an array, not a linked list.
3995 * modechange.c: Include stat-macros.h, xalloc.h.
3996 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3997 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3998 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3999 Remove. This is now stat-macros.h's job.
4000 (talloc): Remove. All callers replaced by xalloc, so that
4001 our invokers don't have to worry about reporting memory failures.
4002 (make_node_op_equals): Remove.
4003 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4005 (struct mode_change): Moved here from modechange.h.
4006 (mode_append_entry): Remove.
4007 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4008 apps to have incorrect behavior. Use simpler algorithm for head
4009 and tail. Don't futz with umask; that's now the job of mode_adjust.
4010 Detect more invalid usages rather than having somewhat-random behavior.
4011 Don't insert an "a=" action, as that leads to incorrect behavior.
4012 (mode_compile, mode_create_from_ref): Return NULL on error instead
4013 of an enum, since now there's only one way to have an error. All
4015 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4016 at the correct time. Simplify calculation of "+u" and its ilk.
4017 Don't mishandle "+X".
4018 (mode_free): Remove "register" and localize decls.
4019 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4020 (struct mode_change): Move to modechange.c; callers don't
4021 need to see this stuff.
4022 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4023 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4024 (mode_change, mode_adjust): Reflect the new signatures noted above.
4025 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4026 that might redefine system include files.
4027 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4028 (my_usleep): Use NULL rather than (void *) 0.
4029 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4030 Use siginterrupt to specify that system calls should be interrupted.
4031 (rpl_nanosleep): Move initialization of suspended closer to call of
4033 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4034 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4035 (desirable_utmp_entry): New function.
4036 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4037 using x2nrealloc, to simplify logic.
4038 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4039 size calculation. Do not assume utmp file is a regular file.
4040 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4041 (READ_UTMP_CHECK_PIDS): New constant.
4042 * save-cwd.c: Include unistd-safer.h.
4043 (save_cwd): Use fd_safer.
4044 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4045 [!_LIBC] Include "stat-macros.h" instead.
4046 * unistd-safer.h (fd_safer): New decl.
4048 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4050 * byteswap_.h: New file.
4052 2005-04-25 Albert Chin <china@thewrittenword.com>
4054 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4057 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4059 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4060 that "UTC +1 second" continues to work. Problem reported
4062 (relunit_snumber): New rule.
4065 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4067 * getdate.y (universal_time_zone_table): New constant.
4068 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4069 universal_time_zone_table.
4070 (lookup_zone): Prefer universal_time_zone_table to
4071 local_time_zone_table, so that "GMT" time stamps are allowed in
4072 London during the summer. Problem reported by Ian Abbott.
4074 2005-04-12 Jim Meyering <jim@meyering.net>
4076 * human.c (humblock): Set *options even when returning due to
4077 xstrtoumax conversion failure. Thanks to a used-uninitialized
4080 2005-04-09 Jim Meyering <jim@meyering.net>
4082 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4083 -Wuninitialized: initialize tm0.tm_year.
4085 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4087 * getdate.y (parser_control): rels_seen is now a boolean, not a
4088 count, since there's no maximum. All uses changed.
4089 Add member dsts_seen.
4090 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4092 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4093 Use pc_rels_seen to decide whther a date is absolute.
4095 * getdate.y (number): Don't overwrite year.
4096 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4099 2005-04-02 Simon Josefsson <jas@extundo.com>
4101 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4102 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4104 2005-03-27 Jim Meyering <jim@meyering.net>
4106 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4108 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4110 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4111 "one's complement" -> "ones' complement" in comment, as per Knuth.
4112 "value of type" -> "type or expression" in comment.
4113 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4115 2005-03-26 Jim Meyering <jim@meyering.net>
4118 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4119 Correct typos: s/or/of/.
4121 2005-03-23 Jim Meyering <jim@meyering.net>
4123 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4125 2005-03-21 Jim Meyering <jim@meyering.net>
4127 Changes imported from coreutils.
4129 * cycle-check.c: Don't include xalloc.h.
4131 * path-concat.c: Don't include assert.h.
4132 (path_concat): Remove assertion that would have triggered
4133 for ABASE starting with more than one slash.
4134 Reported by Andreas Schwab.
4136 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4137 properly when ABASE is an absolute file name.
4138 Correct the description of this function.
4140 Add an assertion and a test driver.
4141 This fixes a bug introduced on 2004-07-02.
4142 Andreas Schwab reported the resulting failure of cp --parents:
4143 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4145 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4147 * strftime.c (my_strftime): If the underlying strftime returns 0
4148 (which shouldn't happen), generate nothing instead of returning 0
4149 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4151 2005-03-16 Bruno Haible <bruno@clisp.org>
4153 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4155 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4157 * strftime.c (my_strftime): Prepend space to format so that we can
4158 reliably distinguish strftime failure from empty output on POSIX
4161 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4163 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4164 (iconv_string): Don't guess a size-zero buffer, as that might cause
4165 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4166 result would be 'too large', where 'too large' is (heuristically)
4167 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4168 overflow concerns. This will prevent some unwanted malloc failures
4169 when the inputs are very large.
4171 2005-03-15 Bruno Haible <bruno@clisp.org>
4173 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4176 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4179 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4181 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4183 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4184 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4186 * strtol.c: Likewise.
4188 2005-03-14 Simon Josefsson <jas@extundo.com>
4190 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4193 2005-03-14 Jim Meyering <jim@meyering.net>
4195 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4196 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4197 to be nonzero so that we (and caller) can detect the difference
4198 between a valid zero-length expansion and an error return, even
4199 when the underlying strftime fails before writing anything into
4202 2005-03-10 Jim Meyering <jim@meyering.net>
4204 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4205 so that this module works on systems without fchdir.
4207 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4209 Factor int-properties macros into a single file, except for
4210 glibc-related files.
4211 * intprops.h: New file.
4212 * getloadavg.c: Include it instead of limits.h.
4213 (INT_STRLEN_BOUND): Remove.
4214 * human.c: Include intprops.h.
4215 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4216 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4217 * inttostr.h: Include intprops.h instead of limits.h.
4218 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4219 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4220 for consistency with intprops.h.
4221 (time_t_is_integer, twos_complement_arithmetic): Use them.
4222 * sig2str.h: Include <signal.h>, intprops.h.
4223 (INT_STRLEN_BOUND): Remove.
4224 * strftime.c (TYPE_SIGNED): Remove.
4225 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4226 * strtol.c: Adjust comments to match intprops.h.
4227 * userspec.c: Include intprops.h.
4228 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4229 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4230 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4231 instead of rolling our own expressions.
4232 * xstrtol.c: Include xstrtol.h first, to test interface.
4234 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4236 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4237 the right thing even if adding 1900 would overflow. Similarly
4238 for tm_mon + 1 and tm_yday + 1.
4239 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4240 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4241 (DO_SIGNED_NUMBER): New macro.
4242 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4244 2005-03-07 Bruno Haible <bruno@clisp.org>
4246 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4248 2005-03-03 Derek R. Price <derek@ximbiot.com>
4249 Bruno Haible <bruno@clisp.org>
4251 * pagealign_alloc.h: New file.
4252 * pagealign_alloc.c: New file.
4254 2005-01-28 Bruno Haible <bruno@clisp.org>
4256 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4259 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4261 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4262 The workaround isn't strictly needed for POSIX conformance, and
4263 it's too much of a pain to configure and maintain. We'll ask
4264 people to fix their kernels instead.
4265 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4266 (NANOSLEEP_BUG_WORKAROUND): Remove.
4267 (xnanosleep): Remove the workaround.
4269 2005-02-12 Bruno Haible <bruno@clisp.org>
4271 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4273 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4275 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4276 * timespec.h (gettime): Return void, since it always
4277 succeeds now. All uses changed.
4278 * gettime.c (gettime) Likewise.
4279 [HAVE_NANOTIME]: Prefer nanotime.
4280 Assume gettimeofday succeeds, as POSIX requires.
4281 Assime time () succeeds, since other code already does.
4282 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4283 (timespec_subtract): Remove.
4284 (NANOSLEEP_BUG_WORKAROUND): New constant.
4285 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4286 things considerably. Use it only on GNU/Linux hosts, since the
4287 workaround shouldn't be needed elsewhere.
4289 2005-02-24 Bruno Haible <bruno@clisp.org>
4291 * gettext.h: Update from GNU gettext 0.14.2.
4293 2005-02-24 Bruno Haible <bruno@clisp.org>
4295 * localcharset.c: Update from GNU gettext 0.14.2.
4296 * config.charset: Update from GNU gettext 0.14.2.
4298 2005-02-22 Simon Josefsson <jas@extundo.com>
4300 * iconvme.h, iconvme.c: New files, from libc.
4302 2005-02-20 Neil Conway <neilc@samurai.com>
4304 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4305 returned by OSX/Darwin if the specified buffer is not large
4306 enough for the hostname.
4308 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4310 * memrchr.h: New file.
4311 * chdir-long.c: Include it.
4312 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4313 Don't bother including stddef.h.
4315 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4317 * argp-help.c (__argp_help): Create a fake struct argp_state and
4318 pass it to _help, otherwise the latter coredumps trying to
4319 dereference state.root_argp.
4321 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4323 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4325 Include <sys/types.h>, for dev_t.
4326 (ME_DUMMY, ME_REMOTE): Move from here....
4327 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4328 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4330 Include mountlist.h first, to test the interface.
4332 2005-01-29 Bruno Haible <bruno@clisp.org>
4334 * progname.c (program_name): Initialize.
4335 Needed when linking statically on MacOS X.
4337 2005-01-28 Bruno Haible <bruno@clisp.org>
4339 * javacomp.sh.in: New file, from GNU gettext.
4340 * javacomp.h: New file, from GNU gettext.
4341 * javacomp.c: New file, from GNU gettext.
4343 2005-01-26 Bruno Haible <bruno@clisp.org>
4345 * javaexec.sh.in: New file, from GNU gettext.
4346 * javaexec.h: New file, from GNU gettext.
4347 * javaexec.c: New file, from GNU gettext.
4349 2005-01-26 Simon Josefsson <jas@extundo.com>
4351 * gai_strerror.c: Use GPL in header.
4353 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4355 * argp-help.c (hol_entry_help): Avoid using non-constant
4356 initializers for struct pentry_state.
4357 (__argp_error): Check return value of __asprintf
4358 (__argp_failure): Translate error message
4360 * argp-parse.c: Removed braces around the expansion of N_()
4362 2005-01-21 Jim Meyering <jim@meyering.net>
4364 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4365 same value as for Solaris 9.
4367 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4368 component length. This included changing the parameter to be
4369 of type `char *' rather than `char const *'.
4370 * chdir-long.h (chdir_long): Update prototype.
4372 * openat.c (fdopendir, fstatat): New functions.
4373 * openat.h: Include headers required for use of DIR and struct stat.
4374 [AT_SYMLINK_NOFOLLOW]: Define.
4375 (fdopendir, fstatat): Add prototypes.
4377 2005-01-21 Bruno Haible <bruno@clisp.org>
4379 * classpath.h: New file, from GNU gettext.
4380 * classpath.c: New file, from GNU gettext.
4382 2005-01-20 Simon Josefsson <jas@extundo.com>
4384 * version-etc-fsf.c: New file, with version_etc_copyright.
4385 * version-etc.c: Remove version_etc_copyright.
4386 * version-etc.h (version_etc_copyright): Use [] instead of * in
4387 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4389 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
4391 * save-cwd.c (save_cwd): Remove code to support the case
4392 where fchdir is missing or flaky.
4394 2005-01-20 Simon Josefsson <jas@extundo.com>
4396 * base64.h (isbase64): Add.
4398 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4399 using a unsigned prototype, don't inline.
4400 (base64_decode): Use it.
4402 2005-01-19 Bruno Haible <bruno@clisp.org>
4404 * sh-quote.h: New file, from GNU gettext.
4405 * sh-quote.c: New file, from GNU gettext.
4407 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
4409 Merge changes from coreutils, as described below in several
4410 changelogs dated today.
4412 * save-cwd.c: Include "save-cwd.h" before other include files.
4413 (O_DIRECTORY): Remove; not needed here, since "." must be
4414 a directory. All uses removed.
4415 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
4416 universal on Suns, and we also need to test for IRIX.
4417 Revamp code to use 'if' rather than '#if'.
4418 Avoid unnecessary comparison of cwd->desc to 0.
4420 * utimens.c (futimens): Robustify the previous patch, by checking
4421 for known valid error numbers rather than observed invalid ones.
4423 2005-01-18 Jim Meyering <jim@meyering.net>
4425 * version-etc.c (version_etc_copyright): Update copyright date.
4427 * utimens.c (futimens): Account for the fact that futimes
4428 can also fail with errno == ENOSYS or errno == ENOENT.
4429 Patch from Dmitry V. Levin.
4431 Change the name of the robust chdir function from chdir to chdir_long.
4432 * save-cwd.c: Include chdir-long.h rather than chdir.h.
4433 (restore_cwd): Use chdir_long, not chdir.
4434 * chdir-long.c: Renamed from chdir.c.
4435 * chdir-long.h: Renamed from chdir.h.
4436 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4439 2005-01-18 Bob Proulx <bob@proulx.com>
4441 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4442 offsetof() macro construct to avoid compile failure with native HP-UX
4443 11.0 ANSI C compiler.
4445 2005-01-06 Bruno Haible <bruno@clisp.org>
4447 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4448 because stpncpy.m4 takes care of it.
4450 2004-01-24 Bruno Haible <bruno@clisp.org>
4452 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4454 2003-10-09 Bruno Haible <bruno@clisp.org>
4456 * progreloc.c: Include xalloc.h instead of xmalloc.h.
4458 2005-01-06 Bruno Haible <bruno@clisp.org>
4460 * fwriteerror.h (fwriteerror): Change specification to include fclose.
4461 * fwriteerror.c: Include <stdbool.h>.
4462 (fwriteerror): At the end, close the file stream. Record whether
4463 stdout was already closed.
4465 2004-05-27 Bruno Haible <bruno@clisp.org>
4467 * execute.c (environ): Declare if needed.
4468 * pipe.c (environ): Likewise.
4469 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4471 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
4473 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4474 definitions to be after all include files, to avoid collisions.
4475 Problem reported by Bob Proulx.
4477 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
4479 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4480 not needed. This removes a dependency on the gettext module.
4481 [defined _LIBC]: Do not include <libintl.h>; not needed.
4483 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
4485 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4488 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
4490 * argp-parse.c: Include <stddef.h>.
4491 (alignof, alignto): New macros.
4492 (parser_init): Don't assume that void * is aligned sufficiently
4495 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4496 need to extend the stack.
4497 (YYINITDEPTH): New macro, so that the initial stack isn't overly
4500 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4502 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4504 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4506 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4507 Remove now-obsolete comment about AIX.
4508 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4509 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4510 (YYMAXDEPTH): New macro.
4512 2004-12-18 Bruno Haible <bruno@clisp.org>
4514 * fatal-signal.c (fatal_signals): Make non-const.
4515 (init_fatal_signals): New function.
4516 (uninstall_handlers, install_handlers): Ignore signals that were set to
4518 (at_fatal_signal): Call init_fatal_signals.
4519 (init_fatal_signal_set): Likewise. Ignore signals that were set to
4521 Reported by Paul Eggert.
4523 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4525 * getdate.y (textint): New member "negative".
4526 (time_zone_hhmm): New function.
4527 Expect 14 shift-reduce conflicts, not 13.
4528 (o_colon_minutes): New rule.
4529 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4530 (yylex): Set the "negative" member of signed numbers.
4532 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
4534 Changes imported from coreutils.
4535 * hard-locale.c: Assume <locale.h> exists.
4537 (GLIBC_VERSION): New macro.
4538 (hard_locale): Assume setlocale exists.
4539 Rewrite to avoid #ifdef.
4540 Use strdup rather than malloc + strcpy.
4541 * human.c: Assume <locale.h> exists.
4542 (human_readable): Assume localeconv exists.
4544 2004-12-01 Jakub Jelinek <jakub@redhat.com>
4546 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4547 convert T2, not T. (Imported from libc.)
4549 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
4551 * getcwd.c (is_ENAMETOOLONG): New macro.
4552 (__getcwd.c): Don't restore errno; glibc doesn't.
4553 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4554 first, falling back to our code only if its results look suspicious.
4555 Ensure that the resulting buffer is only as large as necessary.
4557 * readutmp.c: Include readutmp.h first.
4558 Include <errno.h>, since readutmp.h no longer does that.
4559 * readutmp.h: Don't include <errno.h>,
4560 <sys/param.h>, <time.h>; not needed to establish interface.
4561 (errno): Remove decl.
4562 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4563 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4564 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4566 2004-11-28 Simon Josefsson <jas@extundo.com>
4568 * base64.h, base64.c: New file.
4570 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
4572 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4574 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
4576 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4577 HP's ANSI C compiler.
4578 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4579 Declaring int functions causes warnings on some modern systems and
4580 shouldn't be needed to compile on ancient ones.
4581 * same.c (MIN) [defined MIN]: Don't define, since it's already
4584 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4585 with the following changes.
4586 (__set_errno): Parenthesize properly.
4587 Include <stdbool.h>.
4588 (MIN, MAX, MATCHING_INO): New macros.
4589 (__getcwd): Define with prototype, not K&R form.
4590 Use heuristics to allocate default buffer on stack if possible.
4591 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4592 behavior, and to avoid the PATH_MAX limit when computing
4594 Use MATCHING_INO to compare inode number to file.
4595 Check for arithmetic overflow in size calculations.
4596 Fix bug in reallocation of dot array that caused getcwd to fail
4597 on directories nested deeper than 75.
4598 Be more careful about saving errno on error.
4599 Do not use realloc; use only free+malloc, as this is a bit
4600 more flexible and avoids a needless copy operation.
4601 Do not inspect st_dev and st_ino for symbolic links; POSIX
4602 doesn't specify the latter.
4603 Check for closedir errors.
4604 Avoid needless casts.
4605 Use "#ifdef weak_alias" around weak_alias, to be like other
4607 The following changes to getcwd.c have effect only when used in
4608 gnulib; they have no effect inside glibc proper.
4609 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4610 as alloca isn't used.
4611 (alloca, __alloca): Likewise.
4612 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4613 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4614 unconditionally, as gnulib assumes C89 or better.
4615 Do not include <sys/param.h>.
4616 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4617 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4619 (NULL) [!defined NULL]: Remove; we assume C89 or better.
4620 Include <dirent.h> in a way that is compatible with modern Autoconf.
4621 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4622 New macros, if not already defined.
4623 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4624 Use "_LIBC", not "defined _LIBC", for consistency.
4625 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4627 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4628 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
4629 * xgetcwd.c: David MacKenzie's old code was removed, so give
4630 credit only to Jim Meyering and adjust the copyright dates.
4631 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4632 <stdlib.h>, <unistd.h>, "pathmax.h".
4633 Instead, include "xgetcwd.h" (first) and "getcwd.h".
4634 (INITIAL_BUFFER_SIZE): Remove.
4635 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4637 2004-11-23 Jim Meyering <jim@meyering.net>
4639 * getopt_.h: Remove trailing blanks.
4641 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
4643 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4644 (futimens): New function, which uses futimes if available.
4645 (futimens, utimens): Support timespec==NULL, with same semantics
4646 as utime and utimens.
4647 * utimens.h (futimens): New decl.
4649 2004-11-23 Jim Meyering <jim@meyering.net>
4651 * __fpending.c: Add comment.
4653 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4655 * getopt_.h: Re-addition of __getopt_argv_const caused
4656 redefinition warnings. To avoid them, include the defines
4657 in `#if !defined __need_getopt ... #endif'. The only place
4658 where __getopt_argv_const is used is in definitions
4659 of getopt_long and getopt_long_only below, which are as well
4660 protected by `#ifndef __need_getopt'.
4661 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4662 __need_getopt after including <stdio.h> and <unistd.h> These
4663 headers might have defined it.
4665 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
4667 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4669 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4670 optopt): Use them instead of invoking ## directly; otherwise, the
4671 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4673 2004-11-19 Bruno Haible <bruno@clisp.org>
4675 * strtok_r.c: Move comments from here...
4676 * strtok_r.h: ... to here.
4678 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
4680 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4681 might fail. Problem reported by Yoann Vandoorselaere.
4682 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4683 that mishandle size_t overflow.
4685 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
4687 * canon-host.c: Include "strdup.h".
4688 (canon_host): Use getaddrinfo if available, so that IPv6 works.
4689 Use strdup instead of malloc/strcpy to duplicate strings.
4691 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4692 (human_space_before_unit): New constant.
4693 * human.c (human_readable): Support it.
4695 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4696 (xgetcwd): Set errno correctly when failing.
4697 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4698 the failure is actually due to a PATH_MAX problem.
4700 Further getopt changes to make it more likely that glibc will
4701 buy the changes back.
4702 * getopt.c (POSIXLY_CORRECT): New constant.
4703 (getopt): Use it, so to preserve glibc semantic
4704 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4705 when compiling for libc.
4706 * getopt_.h (__getopt_argv_const): Bring it back.
4707 (getopt_long, getopt_long_only): Use it.
4709 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4710 New arg POSIXLY_CORRECT. All callers changed.
4711 (getopt): Argv is now char * const *, as per standard.
4712 (_getopt_internal_r, _getopt_internal): Argv is now char **,
4713 not char *__getopt_argv_const *.
4714 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4715 _getopt_long_only_r): Likewise.
4716 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4717 * getopt_int.h (_getopt_internal, _getopt_internal_r,
4718 _getopt_long_r, _getopt_long_only_r): Likewise.
4719 * getopt_.h (__getopt_argv_const): Remove.
4720 (getopt): Argv is now char * const *, as per standard.
4722 * getdate.y (tORDINAL): New token.
4723 (day, relunit): Allow it for relative times.
4724 (relative_time_table): Use tORDINAL for ordinals.
4726 2004-11-15 Jim Meyering <jim@meyering.net>
4728 * closeout.c: Include "__fpending.h" once again.
4729 Include <stdbool.h>.
4730 (close_stdout): Don't fail just because stdout was closed initially,
4731 since some programs don't write to stdout in the normal course of
4732 operation (other than --version and --help), and we don't want this
4733 function to make e.g. `touch file >&-' fail.
4734 But do fail if it was closed and someone has tried to write to it.
4735 E.g., `printf foo >&-' must fail.
4737 2004-11-11 Simon Josefsson <jas@extundo.com>
4739 * strtok_r.h, strtok_r.c: New file.
4741 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
4743 * getopt_.h (__getopt_argv_const): New macro, to be used so that
4744 we can stop lying to compilers about the constness of argv when we
4745 are compiled outside glibc.
4746 (getopt, getopt_long, getopt_long_only): Use it.
4747 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4749 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4750 _getopt_long_only_r): Likewise.
4751 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4752 _getopt_long_only_r): Likewise.
4754 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4755 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4756 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4757 the other external symbols.
4758 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4759 declaration, since the above renaming now works around collisions.
4761 2004-11-11 Jim Meyering <jim@meyering.net>
4763 * linebreak.c: Remove trailing blanks.
4764 * alloca_.h: Likewise.
4765 * acosl.c: Likewise.
4766 * euidaccess.c: Likewise.
4767 * allocsa.h: Likewise.
4769 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
4771 * mktime.c (SHR): New macro, which is a portable
4772 substitute for >> that should work even on Crays.
4773 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4774 Problem reported by Mark D. Baushke in
4775 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4776 * getdate.y (SHR): Likewise.
4778 * strftime.c (SHR): Likewise.
4780 * quotearg.c (struct quoting_options): Use unsigned int for
4781 quote_these_too, so that right shifts are well defined. All uses
4784 2004-11-10 Simon Josefsson <jas@extundo.com>
4786 * getaddrinfo.h, getaddrinfo.c: New files.
4788 2004-11-10 Jim Meyering <jim@meyering.net>
4790 Ensure that no close failure goes unreported.
4791 * closeout.c (close_stdout): Always close stdout. I.e., don't
4792 return early when it seems there's nothing to flush.
4793 Don't include __fpending.h.
4795 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
4797 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4799 2004-11-05 Bruno Haible <bruno@clisp.org>
4801 * readlink.c: Include stddef.h, needed for size_t on Woe32.
4802 Reported by Mark D. Baushke <mdb@cvshome.org>.
4804 2004-11-04 Bruno Haible <bruno@clisp.org>
4806 2004-09-11 Bruno Haible <bruno@clisp.org>
4807 * allocsa.valgrind: New file.
4808 2004-02-06 Bruno Haible <bruno@clisp.org>
4809 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4810 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4811 Reported by Christopher Seip <chris.seip@hp.com>.
4813 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
4815 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4816 with errno == ERANGE if the buffer is too small.
4817 Problem reported by Mark D. Baushke.
4819 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
4821 * xreadlink.c (MAXSIZE): New macro.
4822 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
4823 size does not exceed MAXSIZE. Avoid cast.
4824 As suggested by Mark D. Baushke in
4825 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4826 if readlink fails with buffer size just under MAXSIZE, try again
4829 2004-11-02 Derek R. Price <derek@ximbiot.com>
4830 and Paul Eggert <eggert@cs.ucla.edu>
4832 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4833 (get_date): Overparenthesize to avoid GCC warning.
4835 2004-11-02 Bruno Haible <bruno@clisp.org>
4837 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4838 function returns void.
4840 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
4842 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4843 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4846 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
4848 * getdate.y: Add support for TZ="foo" within a date string.
4849 Fix some bugs near time_t boundaries. Reject dates with
4850 out-of-range components, e.g., "Sept 31".
4851 Include <stdlib.h>, "setenv.h", "xalloc.h".
4852 (ISDIGIT_LOCALE): Remove; unused.
4853 Note that the TZ and time functions used here are not reentrant.
4854 (mktime_ok, get_tz): New functions.
4855 (TZBUFSIZE): New constant.
4856 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
4857 This requires that we sometimes generate our own TZ="XXX..." setting.
4859 2004-10-27 Derek R. Price <derek@ximbiot.com>
4861 * mktime.c (not_equal_tm): Remove redundant check.
4863 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
4865 * getdate.y: Use Bison 1.875 features, and some minor
4866 code cleanups. This change does not affect semantics.
4867 Don't include <stdlib.h>; no longer needed.
4868 Don't include unlocked-io.h; only the "#if TEST" code uses
4869 stdio, and performance isn't crucial there.
4870 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4871 Bison 1.875 features as described below.
4872 All uses of "PC." replaced by "pc->".
4873 (YYSTYPE): Add a forward declaration.
4874 (yylex, yyerror): Use full prototypes in forward decls.
4875 Use "%pure-parser" rather than obsolescent "%pure_parser".
4876 Use %parse-param and %lex-param instead of obsolescent
4877 YYPARSE_PARAM and YYLEX_PARAM.
4878 (meridian_table, month_and_day_table, time_units_table,
4879 relative_time_table, time_zone_table, military_table,
4880 lookup_zone, lookup_word, get_date):
4881 Use NULL instead of 0 where appropriate.
4882 (to_hour): Avoid abort (), to avoid a dependency on
4884 (yyerror, yylex): Now accepts parser_control * arg.
4885 (main) [TEST]: Use '\0' rather than 0 for char.
4887 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
4889 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4890 It's now the caller's responsibility to handle the case where
4891 !HAVE_GETPAGESIZE && !defined getpagesize.
4893 * mktime.c (leapyear): Arg is long int, not int.
4895 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
4897 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4899 2004-10-12 Simon Josefsson <jas@extundo.com>
4901 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4902 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4905 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
4907 * vsnprintf.h: New file.
4908 * vsnprintf.c: New file.
4910 2004-10-07 Bruno Haible <bruno@clisp.org>
4912 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4913 into the provided buffer.
4915 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
4917 * diacrit.c, diacrit.h: Add GPL notice.
4919 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4920 * atanl.c (atanl): Keep the code as similar to glibc as possible.
4921 * logl.c (logl): Keep the code as similar to glibc as possible.
4922 This avoids a potential constant-folding bug.
4924 2004-10-05 Bruno Haible <bruno@clisp.org>
4926 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4928 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4930 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
4931 * xmalloc.c (xmemdup): Likewise.
4932 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4933 XFREE): Remove these long-obsolescent macros.
4934 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4935 * xstrdup.c: Remove.
4937 * regex.c (re_comp): Cast gettext return value to char *,
4938 Problem reported by Martin Neitzel via Mark D. Baushke.
4940 2004-10-04 Simon Josefsson <jas@extundo.com>
4942 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4943 '#ifdef USE_UNLOCKED_IO'.
4945 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4947 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4948 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4949 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4950 regex.c, sha1.c, version-etc.c, yesno.c:
4951 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4952 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4953 the includer's responsibility.
4955 Sync from coreutils.
4957 * modechange.c (mode_compile): Don't decrement a pointer that
4958 points to the start of a string, as the C Standard says the
4959 resulting behavior is undefined.
4961 * backupfile.h (enum backuptype): Rename none -> no_backups,
4962 simple -> simple_backups, numbered_existing ->
4963 numbered_existing_backups, numbered -> numbered_backups
4964 to avoid shadowing problems. All uses changed.
4965 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4966 * backupfile.c (check_extension, numbered_backup):
4967 Rename locals to avoid shadowing 'basename'.
4968 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4971 * .cppi-disable: Add getopt_.h, getopt_int.h.
4972 * .cvsignore: Add getopt.h.
4974 2004-10-04 Simon Josefsson <jas@extundo.com>
4976 * memmem.h: New file.
4977 * memmem.c: New file, taken from glibc.
4979 2004-10-02 Jim Meyering <jim@meyering.net>
4981 * dirfd.h, getpagesize.h: Add copyright notice.
4983 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
4985 * snprintf.c: Remove comments as to why each header is needed.
4987 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
4989 * strsep.h: New file.
4990 * strsep.c: New file.
4992 2004-10-01 Simon Josefsson <jas@extundo.com>
4994 * snprintf.c (snprintf): Handle size==0.
4996 2004-10-01 Simon Josefsson <jas@extundo.com>
4997 Bruno Haible <bruno@clisp.org>
4999 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5000 (snprintf): Declare 'args'.
5002 2004-09-30 Simon Josefsson <jas@extundo.com>
5004 * snprintf.h, snprintf.c: New files.
5006 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5008 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5009 (hol_entry_help): Never translate an empty string.
5010 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5011 * argp.h (OPTION_NO_TRANS): New option.
5013 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5015 * xvasprintf.c: Include xalloc.h.
5016 (xvasprintf): Use xalloc_die, not xmalloc_die.
5018 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5020 * dummy.c: Change copyright notice to FSF, and license to GPL.
5022 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5024 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5025 Problem reported by Bruno Haible in:
5026 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5028 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5030 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5031 in case some system header has #define'd it. Problem reported by
5032 Soeren D. Schulze in
5033 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5035 2004-09-08 Bruno Haible <bruno@clisp.org>
5037 * stdint_.h: New file, taken from GNU clisp.
5039 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5041 * xvasprintf.h: New file.
5042 * xvasprintf.c: New file.
5043 * xasprintf.c: New file.
5045 2004-09-08 Bruno Haible <bruno@clisp.org>
5047 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5049 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5051 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5053 Import from coreutils.
5054 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5055 strings on unbounded length. alloca's performance benefits aren't
5056 that important here.
5058 (parse_with_separator): New function, with most of the internals
5059 of the old parse_user_spec. Allow user to omit both user and group,
5060 for compatibility with FreeBSD.
5061 Clone only the user name, not the entire spec.
5062 Do not set *uid, *gid unless entirely successful.
5063 Avoid memory leak in some failing cases.
5064 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5065 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5066 (parse_user_spec): Rewrite to use parse_with_separator.
5068 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5070 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5071 its complicated substitute.
5072 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5073 and program_invocation_name.
5074 (__argp_basename) [!_LIBC]: Remove; the only use was
5075 replaced by its body.
5076 (__argp_short_program_name): Change condition from
5077 !defined __argp_short_program_name to
5078 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5079 to match argp-namefrob.h.
5080 (__argp_failure): Don't assume strerror_r returns char *.
5081 * argp-parse.c (N_): Define unconditionally.
5082 (argp_default_options): Fill out initializers with 0 to avoid
5085 2004-08-12 Simon Josefsson <jas@extundo.com>
5087 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5088 * getopt_.h: Renamed from getopt.h.
5090 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5092 Merge from coreutils.
5094 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5095 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5096 for Reliant Unix 5.43.
5098 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5099 (union fooround): Use uintmax_t, not long int.
5100 The rest is a merge from libc:
5101 [defined _LIBC]: Include <shlib-compat.h>.
5102 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5104 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5106 * strverscmp.c: Convert to UTF-8.
5108 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5110 * obstack.h (obstack_empty_p):
5111 Don't assume that chunk->contents is suitably aligned.
5112 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5113 Likewise. Problem reported by Benno in
5114 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5116 * chown.c (rpl_chown): Work even if the file is writeable but not
5117 readable. This could be improved further but it'd take some work.
5119 2004-08-08 Simon Josefsson <jas@extundo.com>
5121 * xgethostname.c: Don't include error.h (not used).
5124 * getpass.c: Include getpass.h first.
5126 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5128 * xalloc-die.c: New files.
5129 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5131 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5132 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5133 (_, N_, xalloc_die): Move to xalloc-die.c.
5134 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5135 so that we needn't mess with xalloc_msg_memory_exhausted.
5137 * sha1.h: Renamed from sha.h.
5138 (SHA1_H): Renamed from _SHA_H.
5139 (sha1_ctx): Renamed from sha_ctx.
5140 (sha1_init_ctx): Renamed from sha_init_ctx.
5141 (sha1_process_block): Renamed from sha_process_block.
5142 (sha1_process_bytes): Renamed from sha_process_bytes.
5143 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5144 (sha1_read_ctx): Renamed from sha_read_ctx.
5145 (sha1_stream): Renamed from sha_stream.
5146 (sha1_buffer): Renamed from sha_buffer.
5147 * sha1.c: Likewise; renamed from sha.c.
5148 Do not include <sys/types.h>.
5149 Include <stddef.h> rather than <stdlib.h>.
5151 2004-08-08 Bruno Haible <bruno@clisp.org>
5153 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5154 FILESYSTEM_PREFIX_LEN.
5155 * progreloc.c: Likewise.
5156 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5158 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5161 * argp-help.c (make_hol, hol_append): Don't assume that
5162 SIZE_MAX is a valid preprocessor constant.
5163 (__argp_basename): Change from "#ifndef _LIBC"
5164 to "#ifndef __argp_short_program_name", so that
5165 we don't compile these functions for tar.
5167 More merges from coreutils.
5168 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5169 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5171 * addext.c: Remove; no longer needed.
5172 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5173 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5174 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5175 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5176 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5177 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5178 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5179 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5180 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5181 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5182 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5183 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5184 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5185 Import changes from coreutils.
5187 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5189 Merge from coreutils.
5191 * .gdb-history: Remove; this doesn't belong here.
5193 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5194 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5195 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5197 * dirname.h: Include <stdbool.h>.
5198 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5199 for consistency with POSIX terminology. All uses changed.
5200 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5201 (strip_trailing_slashes): Use bool for booleans.
5202 * stripslash.c (strip_trailing_slashes): Likewise.
5204 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5205 sometimes returns a positive errno value even when it succeeds.
5206 (print_errno_message) [!LIBC]: Fall back on strerror if
5209 * path-concat.c (mempcpy): Don't define if a system header defines it.
5210 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5211 (longest_relative_suffix): New function.
5212 (path_concat): Use it. Assume first argument is not NULL.
5213 Port to DOS. Omit redundant separators.
5214 Report an error instead of returning NULL.
5215 Use mempcpy instead of memcpy.
5216 (xpath_concat): Remove: not declared or used.
5218 * same.h: Include <stdbool.h>
5219 (same_name): Return bool, not int.
5220 * same.c (same_name): Likewise.
5221 (errno): Don't declare; we assume C89 or better now.
5223 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5224 if not already defined.
5226 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5227 * dup-safer.c (errno): Likewise.
5229 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5231 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5234 2004-08-03 Simon Josefsson <jas@extundo.com>
5236 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5237 * progname.h: Don't include stdbool.h.
5239 2004-08-02 Simon Josefsson <jas@extundo.com>
5241 * getsubopt.h: New file, with comments from Bruno Haible.
5242 * getsubopt.c: New file, from glibc, but slightly modified based on
5243 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5245 2004-08-01 Simon Josefsson <jas@extundo.com>
5247 * xgetdomainname.c: Include stdlib.h, for free().
5249 2004-07-16 Simon Josefsson <jas@extundo.com>
5251 * dummy.c: New file.
5253 2004-07-16 Bruno Haible <bruno@clisp.org>
5255 * backupfile.h: Add extern "C" for C++.
5256 * closeout.h: Likewise.
5257 * copy-file.h: Likewise.
5258 * findprog.h: Likewise.
5259 * full-write.h: Likewise.
5260 * pathname.h: Likewise.
5261 * progname.h: Likewise.
5262 * stpcpy.h: Likewise.
5263 * stpncpy.h: Likewise.
5264 * strcase.h: Likewise.
5265 * strstr.h: Likewise.
5266 * xalloc.h: Likewise.
5268 * mbswidth.h: Add extern "C" for C++.
5269 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5271 2004-07-09 Simon Josefsson <jas@extundo.com>
5273 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5274 failed without this.)
5276 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5278 * fchown-stub.c: New file.
5280 2004-06-24 Jim Meyering <jim@meyering.net>
5282 * obstack.h (obstack_base): Cast to (void *), per documentation.
5284 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5286 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5288 2004-06-01 Jim Meyering <jim@meyering.net>
5290 * calloc.c: New file.
5292 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5294 * getdate.y (yylex): Allow space between sign and number.
5295 Problem reported by Dan Jacobson.
5297 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5298 and Jim Meyering <jim@meyering.net>
5300 Merge from coreutils CVS.
5302 * stat-macros.h: New file, with contents from file-type.h
5303 and coreutils' system.h.
5304 * file-type.c: Include "stat-macros.h".
5305 * file-type.h (file_type): Move all macro definitions to new file,
5308 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5309 Wrap old code with this conditional.
5310 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5311 function that does not dereference symlinks.
5312 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5314 * xreadlink.c: Include xreadlink.h first, to catch .h file
5315 dependency problems.
5316 (xreadlink): Accept new arg SIZE, for efficiency.
5317 All decls and uses changed.
5318 * xreadlink.h: Include <stddef.h>, for size_t.
5320 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5321 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5323 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5325 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5327 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5328 macros to be defined.
5329 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5330 the allocator returns NULL because the requested size is zero.
5332 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5334 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5335 var. Add comment explaining why libc still defines it. This
5336 merges the following patch from glibc:
5337 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5339 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5341 * obstack.c (_obstack): Remove unused variable. It hasn't been
5342 present in glibc since revision 1.1 of this file.
5343 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5344 obstack_alignment_mask, obstack_alloc, obstack_base,
5345 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5346 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5347 obstack_grow0, obstack_init, obstack_int_grow,
5348 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5349 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5350 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5351 nonexistent functions.
5353 2004-05-17 Derek R. Price <derek@ximbiot.com>
5354 Paul Eggert <eggert@cs.ucla.edu>
5356 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5358 2004-05-14 Bruno Haible <bruno@clisp.org>
5360 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5361 that consists of a '.' followed by an empty digit string.
5362 Patch by Tor Lillqvist <tml@iki.fi>.
5364 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5366 Port obstack to the AS/400, where pointers are 16 bytes wide and
5367 you cannot cast an integer to a valid pointer. This patch is
5368 currently waiting to be integrated into glibc; see
5369 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5371 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5372 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5373 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5374 (struct obstack): temp member is now a union of a pointer and
5375 an integer, instead of an integer. All integer uses changed.
5376 This does not affect the physical layout of struct obstack,
5377 except on hosts (like the AS/400) where the size or alignment of
5378 void * is greater than that of ptrdiff_t.
5379 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5380 __STDC__)]: Store temporary in pointer member of union, not
5382 * obstack.c: Include <stddef.h>, for offsetof.
5383 (struct fooalign): Remove; it doesn't need a name.
5384 (union fooround): Change double to long double, and add void *.
5385 (DEFAULT_ALIGNMENT): Use offsetof to compute.
5386 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5387 not a macro. Hence the values are always int; so remove all
5388 casts-to-int in uses.
5390 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
5391 Derek Price <derek@ximbiot.com>
5393 * alloca.c: Include <alloca.h>, to get our interface.
5394 * alloca_.h: Use __alloca on AIX, so that we don't have to
5395 include <alloca.h> first. Use C89 prototype for alloca; this
5396 requires including <stddef.h> for size_t. Use extern "C" if C++.
5397 Use #elif for simplicity, since we can assume C89 now.
5398 Don't try to source the system alloca.h since it will not be found
5399 and to prevent recursively including its replacement.
5400 * fnmatch.c: Include <alloca.h> instead of opencoding.
5401 * regex.c: Likewise.
5403 2004-05-16 Derek Price <derek@ximbiot.com>
5404 Paul Eggert <eggert@cs.ucla.edu>
5406 getline cleanup. This changes the getndelim2 API: both order of
5407 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5410 * getline.c: Don't include stddef.h or stdio.h, since our
5411 interface does that.
5412 (getline): Always use getdelim, so that we don't have two
5413 copies of this code.
5414 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5416 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5417 (GETNDELIM2_MAXIMUM): New macro.
5418 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
5419 instead of the old practice of delim2==0. All callers changed.
5420 Return -1 on overflow, instead of returning junk.
5421 Do not set *linesize unless allocation succeeds.
5422 * getndelim2.h: Do not include stddef.h; no longer needed, now
5423 that we include sys/types.h.
5424 * getnline.h: Likewise.
5425 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5426 (getndelim2): Reorder arguments.
5427 * getnline.c (getnline, getndelim):
5428 Don't discard the NMAX argument.
5429 (getnline): Invoke getndelim, to avoid code duplication.
5430 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5431 of (size_t) -1 by callers of the getnline family.
5433 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
5435 * nanosleep.c (suspended): Change its type from int to
5436 sig_atomic_t volatile.
5437 (first_call): Make it private to rpl_nanosleep, and have it
5438 be zero initially as that's a bit faster.
5439 (my_usleep): Round up fractional times instead of truncating them,
5440 as this is the usual meaning for 'sleep'.
5442 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5444 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5445 (ENOSYS): Define if not defined.
5446 (settime): Fall back on stime if it exists and settimeofday fails.
5447 But don't bother with fallbacks if a method fails with errno == EPERM.
5449 2004-05-11 Jim Meyering <jim@meyering.net>
5451 Prior to this change, the save_cwd caller required read access to the
5452 current directory on most systems (ones with the fchdir function).
5454 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5455 fails, try write-only, and finally, resort to using xgetcwd.
5457 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5459 * obstack.c, obstack.h: Import changes from libc.
5461 2004-04-28 Bruno Haible <bruno@clisp.org>
5463 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5464 implicitly appends .exe to executables.
5465 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5466 accepts Windows pathnames.
5467 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5468 Cygwin like Windows, since it now accepts Windows pathnames.
5469 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5470 Cygwin like Windows, since it now accepts Windows pathnames.
5471 Reported by Derek Robert Price <derek@ximbiot.com>.
5473 2004-04-20 Jim Meyering <jim@meyering.net>
5475 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5477 2004-04-20 Jim Meyering <jim@meyering.net>
5478 Bruno Haible <bruno@clisp.org>
5480 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5481 memory when realloc fails.
5483 2004-04-18 Jim Meyering <jim@meyering.net>
5485 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5486 don't leak memory and do call END_UTMP_ENT.
5488 2004-04-11 Paul Eggert <eggert@twinsun.com>
5490 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5491 (CHAR_BIT): Remove, since we assume C89.
5492 Include <stdint.h> if available, as per current Autoconf CVS advice.
5494 2004-03-30 Paul Eggert <eggert@twinsun.com>
5496 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5497 not bool, to be more consistent with Unix conventions.
5498 Suggested by Bruno Haible.
5500 Merge from coreutils.
5502 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5505 * getdate.h: Include stdbool.h, and timespec.h instead of
5506 the usual <time.h> dance.
5507 (get_date): Change signature to support fractional time stamps.
5508 All callers changed.
5509 * getdate.y: Include "getdate.h" first, as we can now
5510 assume C89 and don't need to worry about 'const'.
5511 Similarly, include "unlocked-io.h" near start, not in middle.
5513 (textint.value): Use long int rather than int.
5514 (textint.digits): Use size_t rather than int.
5515 (BILLION, LOG10_BILLION): New constants.
5516 (parser_control): New member rel_ns. Members day_ordinal,
5517 time_zone, month, day, hour, minutes, rel_year, rel_month,
5518 rel_day, rel_hour, rel_minutes, rel_seconds
5519 are now long int, not int. Member seconds is now struct timespec,
5520 not int. New member timespec_seen. Members dates_seen, days_seen,
5521 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5523 (%union.intval): Now long int, not int.
5524 New member timespec.
5525 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5526 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5527 (spec): Now is a timespec or an item list.
5528 (timespec, items): New nonterminals.
5529 (time, rel, relunit, number, get_date):
5530 Add support for fractional seconds.
5531 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5532 (gmtime, localtime, mktime): Remove decls; not needed with C89.
5533 (to_hour): First arg is now long int, not int.
5534 (to_year): Returns long int, not int.
5535 Don't treat year -70 like 70.
5536 (tm_diff): Returns long int, not int.
5537 (lookup_word): Use bool instead of int when appropriate.
5538 (yylex): Use size_t for count, not int.
5539 Detect overflow when parsing large integer constants.
5540 Add support for fractions.
5541 (get_date): Make pointers 'const' if possible.
5542 Use more-portable code to detect integer overflow.
5543 (main) [TEST]: Adjust to above changes. Test for localtime failure.
5544 Don't use ctime; it's not reliable if the year has >4 digits.
5546 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5547 This is for compatibility with BSD.
5549 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5550 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5551 From coreutils' system.h.
5553 * userspec.c: Don't include "posixver.h".
5554 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5555 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5556 compatible extension. Simplify code by removing a boolean int
5557 that was always nonzero if a string was nonnull.
5559 2004-03-30 Jim Meyering <jim@meyering.net>
5561 Merge from coreutils.
5563 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5565 * readtokens.c (readtoken): Don't leak 64 bytes when reading
5566 an empty input stream.
5568 * readtokens.c: Include <stdbool.h>.
5569 (readtoken): Use `size_t' rather than int/long.
5570 All callers adjusted.
5571 Use `bool' rather than `int' where appropriate.
5572 Use memset rather than an explicit loop.
5573 Use x2nrealloc rather than xrealloc.
5574 Allow the use of `\0' as a delimiter.
5575 (readtokens): Likewise.
5576 * readtokens.h (readtoken, readtokens): Update prototypes.
5578 2004-03-30 Bruno Haible <bruno@clisp.org>
5580 * getloadavg.c (getloadavg): Don't assume setlocale returns
5583 2004-03-29 Paul Eggert <eggert@twinsun.com>
5585 Merge changes to getloadavg.c from coreutils and Emacs.
5587 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5588 Define to an expression, not to the empty string.
5589 Include cloexec.h and xalloc.h.
5590 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5591 Use set_cloexec_flag rather than rolling our own.
5592 * cloexec.c, cloexec.h: New files.
5594 2004-03-18 Paul Eggert <eggert@twinsun.com>
5596 * getopt.h: Sync with libc CVS.
5598 2004-03-18 Paul Eggert <eggert@twinsun.com>
5599 Bruno Haible <bruno@clisp.org>
5601 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5602 not on all platforms that have <wchar.h>.
5603 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5605 2004-03-09 Paul Eggert <eggert@twinsun.com>
5607 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5609 * getopt_int.h: New file, also synced from libc.
5611 2004-03-07 Paul Eggert <eggert@twinsun.com>
5613 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
5614 '#if' expressions. Unlike the code it replaces, it does not
5615 depend on (defined _SC_PAGESIZE). However, it does depend on
5616 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5617 first reported by Jason Andrade in
5618 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5620 2004-01-18 Simon Josefsson <jas@extundo.com>
5622 * strdup.h: New file.
5623 * strdup.c: Include it.
5624 * path-concat.c: Include strdup.h. Drop strdup declaration.
5625 * userspec.c: Include strdup.h. Drop strdup declaration.
5627 2004-02-06 Karl Berry <karl@gnu.org>
5629 * config.charset: update from gettext 0.14.1.
5631 2004-02-05 Paul Eggert <eggert@twinsun.com>
5633 Add comments and code, prompted by suggestions from Bruno Haible
5635 * quotearg.h (quotearg_alloc): New decl. Improve the comments
5636 describing the enum quoting_style values.
5637 * quotearg.c (quotearg_alloc): New function.
5638 (quotearg_buffer_restyled): Treat lone { and } as special.
5639 Treat = as special. Work around bug with older shells
5640 that "see" a '\' that is really the 2nd byte of a multibyte char.
5641 Quote empty string with shell_quoting_style.
5643 2004-02-03 Bruno Haible <bruno@clisp.org>
5645 * pipe.h: New file, from GNU gettext.
5646 * pipe.c: New file, from GNU gettext.
5648 2004-01-27 Bruno Haible <bruno@clisp.org>
5650 * execute.h: New file, from GNU gettext.
5651 * execute.c: New file, from GNU gettext.
5652 * w32spawn.h: New file, from GNU gettext.
5654 2004-01-23 Paul Eggert <eggert@twinsun.com>
5656 Exit-status fix from coreutils.
5658 Use exit_failure consistently in place of EXIT_FAILURE,
5659 so that program exit statuses are consistent on failure.
5661 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5662 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5663 * argmatch.h: Comment fix to match the above.
5664 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5665 Now a macro referring to exit_failure, instead of a separate
5666 variable. Include "exitfail.h" to get it.
5667 * xstrtol.h: Include "exitfail.h".
5668 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5670 * long-options.c (parse_long_options): Use prototype
5671 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
5674 2004-01-21 Jim Meyering <jim@meyering.net>
5676 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5677 so as not to conflict with a different-sized __mktime_internal
5678 function in GNU libc.
5679 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5680 Problem building statically-linked `ls' reported by Michael Brunnbauer.
5682 2004-01-18 Paul Eggert <eggert@twinsun.com>
5684 Merge from diffutils.
5686 * file-type.c (file_type): Add typed memory objects.
5687 * file-type.h (S_TYPEISTMO): New macro.
5689 * c-stack.h (c_stack_action): Remove argv argument.
5690 * c-stack.c (c_stack_action): Likewise. All uses changed.
5691 (die): Don't calculate message unless segv_action returns.
5692 (get_stack_location, min_address_from_argv, max_address_from_argv,
5693 volatile stack_base, volatile_stack_size): Remove.
5694 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5695 that every segmentation violation is a stack overflow. (Ouch!)
5696 See Debian bug 136249 (still outstanding) for more info about why
5697 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5699 2003-11-30 Bruno Haible <bruno@clisp.org>
5701 Safer stack allocation.
5702 * setenv.c: Include allocsa.h.
5703 (alloca): Remove fallback definition.
5704 (freea): Remove macro.
5705 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5708 2003-10-17 Bruno Haible <bruno@clisp.org>
5710 * binary-io.h: Avoid warnings on Cygwin.
5712 2003-12-28 Bruno Haible <bruno@clisp.org>
5714 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5715 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5717 2003-11-28 Bruno Haible <bruno@clisp.org>
5719 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5721 2003-11-27 Bruno Haible <bruno@clisp.org>
5723 * wait-process.c: On Windows, include windows.h. Needed on mingw.
5725 2003-11-17 Bruno Haible <bruno@clisp.org>
5727 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5729 2003-11-24 Bruno Haible <bruno@clisp.org>
5731 * xallocsa.h: New file, from GNU gettext.
5732 * xallocsa.c: New file, from GNU gettext.
5734 2003-11-24 Bruno Haible <bruno@clisp.org>
5736 * allocsa.h: New file, from GNU gettext.
5737 * allocsa.c: New file, from GNU gettext.
5739 2003-11-24 Bruno Haible <bruno@clisp.org>
5741 * eealloc.h: New file.
5743 2004-01-15 Jim Meyering <jim@meyering.net>
5745 Merge from coreutils.
5747 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
5748 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
5749 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5751 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5752 optional configure-time default.
5754 * version-etc.c (version_etc_copyright): Update copyright date.
5756 * xreadlink.c (xreadlink): Correct outdated comment.
5758 2004-01-15 Paul Eggert <eggert@twinsun.com>
5760 Merge from coreutils.
5762 * posixver.c: Include posixver.h.
5764 * same.c: Include <stdbool.h>, <limits.h>.
5765 (_POSIX_NAME_MAX): Define if not defined.
5767 (same_name): If file names are silently truncated, report
5768 that the file names are the same if they are the same after
5769 the silent truncation.
5771 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5772 conversion function.
5773 * xstrtod.c (xstrtod): Likewise. All callers changed to
5774 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
5777 2004-01-14 Paul Eggert <eggert@twinsun.com>
5779 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5780 with like-named macro in fnmatch.c.
5781 (EXT): Use an internal constant instead.
5783 Merge fnmatch patches from glibc.
5784 * fnmatch.c (mbsinit): Remove define.
5785 Add libc_hidden_ver (__fnmatch, fnmatch).
5786 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5787 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5789 2003-12-14 Karl Berry <karl@gnu.org>
5791 * config.charset: update from gettext-runtime.
5793 2003-12-03 Paul Eggert <eggert@twinsun.com>
5795 * getgroups.c (getgroups): xmalloc takes one argument, not two.
5796 Bug reported by Alfred M. Szmidt.
5798 2003-11-29 Karl Berry <karl@gnu.org>
5800 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5802 2003-11-23 Paul Eggert <eggert@twinsun.com>
5803 Bruno Haible <bruno@clisp.org>
5805 * printf-parse.h: Don't include sys/types.h.
5806 (ARG_NONE): New macro.
5807 (char_directive): Change type of *arg_index fields to size_t.
5808 * printf-parse.c: Don't include sys/types.h.
5809 (SSIZE_MAX): Remove macro.
5810 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5811 Remove unnecessary overflow check.
5812 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5815 2003-11-24 Paul Eggert <eggert@twinsun.com>
5817 * alloca.c: Remove dependency on xalloc module.
5818 (xalloc_die): Remove.
5819 (memory_full) [!defined emacs]: New macro.
5820 [!defined emacs]: Don't include xalloc.h.
5821 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5822 address arithmetic overflows. Change datatypes a bit to avoid
5825 2003-11-22 Jim Meyering <jim@meyering.net>
5827 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5829 2003-11-17 Bruno Haible <bruno@clisp.org>
5831 * vasnprintf.c (alloca): Remove fallback definition.
5832 (freea): Remove definition.
5833 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5834 Reported by Paul Eggert.
5836 2003-11-17 Jim Meyering <jim@meyering.net>
5838 On systems without utime and without a utimes function capable of
5839 dealing with a NULL struct utimbuf* argument, this utime replacement
5840 could -- in unusual circumstances -- leak a file descriptor.
5841 * utime.c: Include <unistd.h> and <errno.h>.
5842 (utime_null): Be sure to close `fd' and to preserve errno.
5843 Reported by Geoff Collyer via Arnold Robbins.
5845 2003-11-16 Paul Eggert <eggert@twinsun.com>
5846 Bruno Haible <bruno@clisp.org>
5848 Protect against address arithmetic overflow.
5849 * printf-args.h: Include stddef.h.
5850 (arguments): Change type of field 'count' to size_t.
5851 * printf-args.c (printf_fetchargs): Use size_t instead of
5852 'unsigned int' where appropriate.
5853 * printf-parse.h: Include sys/types.h.
5854 (char_directive): Change type of *arg_index fields to ssize_t.
5855 (char_directives): Change type of fields 'count', max_*_length to
5857 * printf-parse.c: Include sys/types.h and xsize.h.
5858 (SSIZE_MAX): Define fallback value.
5859 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5860 instead of 'int' where appropriate. Check a_allocated, d_allocated
5861 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5862 * vasnprintf.c: Include xsize.h.
5863 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5864 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5865 overflow. Avoid wraparound when converting a width or precision from
5868 2003-11-16 Bruno Haible <bruno@clisp.org>
5870 Update from GNU gettext.
5871 * printf-parse.c: Generalize to it can be compiled for wide strings.
5872 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5873 * vasnprintf.c: Generalize to it can be compiled for wide strings.
5874 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5875 SNPRINTF): New macros.
5876 Don't include <alloca.h> if the file is used inside libintl.
5877 (local_wcslen): New function, for Solaris 2.5.1.
5878 (VASNPRINTF): Use it instead of wcslen.
5880 2003-11-16 Bruno Haible <bruno@clisp.org>
5882 * xsize.h (xmax): New function.
5883 (xsum, xsum3, xsum4): Declare as "pure" functions.
5885 2003-11-12 Paul Eggert <eggert@twinsun.com>
5887 * xalloc.h: Do not include <limits.h> or <stdint.h>.
5888 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5889 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
5890 heuristic is just as accurate as far as we know, and it removes a
5891 dependency on size_max.m4 and ptrdiff_max.m4.
5893 2003-11-12 Paul Eggert <eggert@twinsun.com>
5895 * xstrtol.c (__xstrtol): Remove "break" immediately after
5896 "return", to pacify some unknown compiler. Problem reported
5899 2003-11-11 Bruno Haible <bruno@clisp.org>
5901 * xsize.h (SIZE_MAX): Remove fallback definition.
5902 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5905 2003-11-10 Paul Eggert <eggert@twinsun.com>
5907 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5908 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5909 rejected some allocations of exactly SIZE_MAX - 2 bytes.
5911 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5912 not (size_t) -1, since it's defined here.
5914 2003-11-06 Paul Eggert <eggert@twinsun.com>
5916 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5917 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5918 Reject sizes of exactly SIZE_MAX bytes.
5919 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5920 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5922 2003-11-05 Bruno Haible <bruno@clisp.org>
5924 * xsize.h: Include limits.h, to avoid a possible collision with
5925 SIZE_MAX defined in <limits.h> on Solaris.
5927 2003-11-04 Bruno Haible <bruno@clisp.org>
5929 * xsize.h: New file.
5930 * linebreak.c: Include xsize.h.
5931 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5932 argument for overflow.
5933 Suggested by Paul Eggert.
5935 2003-10-31 Bruno Haible <bruno@clisp.org>
5937 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5938 to avoid (extremely rare) race condition.
5939 Suggested by Paul Eggert.
5941 2003-11-03 Jim Meyering <jim@meyering.net>
5943 * userspec.c: Include "userspec.h".
5944 * userspec.h: New file.
5946 2003-10-31 Paul Eggert <eggert@twinsun.com>
5948 * mountlist.h (struct mount_entry.me_type_malloced): New member.
5949 * mountlist.c (SIZE_MAX): Define if not defined already.
5950 (read_filesystem_list): Set and use me_type_malloced.
5951 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5952 whatever the type happens to be), for brevity and consistency.
5953 Check for size calculation overflow on Alphas running OSF/1.
5955 2003-10-31 Jim Meyering <jim@meyering.net>
5957 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5959 * linebuffer.c: Include <string.h> for declaration of memset.
5961 2003-10-30 Paul Eggert <eggert@twinsun.com>
5962 Bruno Haible <bruno@clisp.org>
5964 * vasprintf.c: Include <limits.h>, <stdlib.h>.
5965 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5967 2003-10-29 Paul Eggert <eggert@twinsun.com>
5969 * xalloc.h (xalloc_oversized): Now a macro, not a function,
5970 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
5972 * quotearg.c (quotearg_n_options): Use it.
5973 * group-member.c: Include <stdbool.h>.
5974 (free_group_info): Arg is now const *; don't free arg.
5975 (get_group_info): Now returns bool and accepts struct group_info *,
5976 rather than returning a malloc'ed struct group_info *.
5977 All uses changed. Check for overflow in internal size calculation.
5979 * getusershell.c (readname): Simplify the code by using x2nrealloc
5980 rather than xmalloc/xrealloc.
5981 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5982 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
5983 conformance bug: the old code used a pointer after freeing the
5984 storage that it addressed.
5985 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5986 rather than doing it by hand.
5987 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5988 the buffer preserved. Use free and xmalloc instead.
5989 * quotearg.c (quotearg_n_options): Likewise.
5990 Use a simpler test for size overflow. Don't use xalloc_oversized
5991 because unsigned int might be wider than size_t (!); this suggests
5992 that we should switch from unsigned int to size_t for slot numbers.
5994 2003-10-27 Bruno Haible <bruno@clisp.org>
5996 * stdbool_.h: Better support for BeOS.
5998 2003-10-27 Paul Eggert <eggert@twinsun.com>
6000 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6001 to allocate the returned structure. Do not allocate a subarray,
6002 as x2nrealloc will do that.
6003 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6004 instead of xnrealloc.
6005 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6007 2003-10-26 Paul Eggert <eggert@twinsun.com>
6009 * xalloc.h (xalloc_oversized): New static inline function, for
6010 callers that want to do their own size-overflow checking. Include
6011 <stdbool.h>, since xalloc_oversized returns bool.
6012 * xalloc.c (array_size_overflow): Remove. All callers changed
6013 to use xalloc_oversized.
6015 Add two functions x2realloc, x2nrealloc, for programs that grow
6016 arrays dynamically by doubling their sizes.
6017 * xalloc.h (x2realloc, x2nrealloc): New decls.
6018 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6021 Port to C99 semantics for 'inline' of external functions.
6022 Bug reported by Bruno Haible.
6023 * xmalloc.c (xnmalloc_inline): New static inline function,
6024 with the old contents of xnmalloc.
6025 (xnmalloc, xmalloc): Use it.
6026 (xnrealloc_inline): New static inline function,
6027 with the old contents of xnrealloc.
6028 (xnrealloc, xrealloc): Use it.
6030 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6032 2003-10-25 Paul Eggert <eggert@twinsun.com>
6034 Fix several address-calculation bugs in the hash modules,
6035 plus some minor code cleanup.
6037 * hash.h: Include <stdbool.h>, for bool.
6038 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6039 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6040 hash_get_n_entries, hash_get_max_bucket_length,
6041 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6042 hash_rehash): Use size_t rather than unsigned.
6043 * hash.c (struct hash_table, hash_get_n_buckets,
6044 hash_get_n_buckets_used, hash_get_n_entries,
6045 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6046 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6047 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6049 (SIZE_MAX): Define if not defined.
6050 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6051 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6053 Use const * when possible.
6054 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6055 (check_tuning): Fix bug: if tuning parameters were very close to
6056 0 or 1, rounding errors could have caused subscript violations.
6057 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6058 (hash_initialize): Add 'fail:' label
6059 to free table and return NULL, and use it to simplify code.
6060 Use calloc rather than clearing the storage ourself.
6061 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6062 buffer size calculations.
6063 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6064 Include <stddef.h>, for size_t.
6065 * hash-pjw.c (hash_pjw): Likewise.
6066 Switch to method described by Bruno Haible.
6067 Include <limits.h>, for CHAR_BIT.
6068 (SIZE_BITS): New macro.
6070 2003-10-21 Paul Eggert <eggert@twinsun.com>
6072 * getndelim2.c (getndelim2): When size calculation overflows,
6073 ceiling the allocation at NMAX bytes rather than silently
6074 discarding input bytes before NMAX is reached. This makes
6075 a difference only if NMAX exceeds SIZE_MAX / 2.
6077 * obstack.c: Merge from glibc.
6078 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6079 Add libc_hidden_def (_obstack_newchunk).
6080 (_obstack_free) [! defined _LIBC]: Remove.
6081 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6082 a clone of the function body.
6083 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6084 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6086 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6087 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6090 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6091 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6092 Don't use lvalue casts, as GCC plans to remove support for them
6093 in GCC 3.5. Reported by Joseph S. Myers. This bug
6094 was also present in the non-GCC version, indicating that this
6095 code had always been buggy and had never been widely used.
6096 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6097 Use the fast variant of each macro, rather than copying the
6098 definiens of the fast variant; that way, we'll be more likely to
6099 catch future bugs in the fast variants.
6101 2003-10-20 Bruno Haible <bruno@clisp.org>
6103 * wait-process.h: New file, from GNU gettext.
6104 * wait-process.c: New file, from GNU gettext.
6106 2003-10-19 Jim Meyering <jim@meyering.net>
6108 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6110 2003-10-16 Paul Eggert <eggert@twinsun.com>
6112 * getgroups.c: Include <errno.h>, <stdlib.h>.
6113 (getgroups): First arg is int, not size_t.
6114 Don't let 'free' mangle errno.
6116 2003-10-16 Jim Meyering <jim@meyering.net>
6118 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6120 2003-10-15 Paul Eggert <eggert@twinsun.com>
6122 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6124 (new_exclude, add_exclude_file): Initial size no longer needs to
6126 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6127 our own address arithmetic overflow checking.
6129 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6130 (fnmatch): Do not alloca more than 2000 wide characters;
6131 instead, use malloc for large buffers.
6132 Check for address arithmetic overflow, and return -1
6133 with errno set to ENOMEM in that case.
6134 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6135 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6136 instead, return -1. Check for address arithmetic overflow.
6138 2003-10-14 Paul Eggert <eggert@twinsun.com>
6140 Handle invalid suffixes and overflow independently, so that
6141 callers can treat them independently as needed. Fix some bugs in
6142 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6143 suffix for a human-readable blocksize. The major caller-visible
6144 change is the addition of a new
6145 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6146 that both overflow and suffix chars were found.
6148 * human.c (humblock): Don't check separately for invalid suffix
6149 char; that is xstrtoumax's job (now that its bug is fixed).
6150 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6151 INTMAX_MAX]: New macros.
6152 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6153 TYPE_MAXIMUM): New macros.
6154 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6155 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6156 if overflow occurs, as it's what __strtol does and it's more useful
6158 (__xstrtol): If __strtol reports some error other than ERANGE,
6159 reflect it to the caller as LONGINT_INVALID. If it reports
6160 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6161 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6162 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6164 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6165 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6166 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6167 [defined UINTMAX_MAX]: New macros.
6169 2003-10-14 Bruno Haible <bruno@clisp.org>
6171 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6172 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6173 Also use volatile where needed.
6175 2003-10-12 Paul Eggert <eggert@twinsun.com>
6177 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6178 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6179 and define in terms of the other primitives.
6180 * xmalloc.c: Include stdbool.h; do not include exit.h.
6181 (SIZE_MAX): Define if not already defined.
6182 (array_size_overflow): New function.
6183 (xalloc_die): Abort instead of exiting if 'error' returns.
6184 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6185 (xmalloc, xrealloc): Use them.
6186 (xcalloc): Check for address arithmetic overflow.
6187 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6188 a bit faster than strcpy.
6190 2003-10-08 Paul Eggert <eggert@twinsun.com>
6192 Merge getpass from libc, plus a few fixes.
6194 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6195 Include <stdbool.h>.
6196 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6197 __fsetlocking to empty.
6198 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6199 do include <bits/libc-lock.h>.
6200 Do not include <fcntl.h>; not needed.
6201 [_LIBC]: Include <wchar.h>.
6202 (NOTCANCEL_MODE): New macro.
6203 (flockfile, funlockfile) [_LIBC]: New macros.
6204 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6205 [!_LIBC]: New macros.
6206 (call_fclose): New function.
6207 (getpass): Use it. Save tty stream separately; this simplifies the
6208 code and makes it more reliable if stdin happens to equal stdout.
6209 Invoke __fsetlocking on tty.
6210 Handle thread cancellation if needed.
6211 Namespace cleanup (use __tcgetattr, __getline).
6212 Use bool for Booleans.
6213 [USE_IN_LIBIO]: Handle wide streams.
6214 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6215 stream might go where.
6217 * unlocked-io.h: Include <stdio.h>, so that the caller
6218 doesn't have to include <stdio.h> before us.
6219 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6220 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6221 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6222 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6223 if not declared, so that we can use getpass.c code from libc without
6225 (flockfile, ftrylockfile, funlockfile): New macros.
6227 2003-10-06 Bruno Haible <bruno@clisp.org>
6229 * version-etc-2.h: Remove file.
6230 * version-etc-2.c: Remove file.
6232 2003-09-25 Jim Meyering <jim@meyering.net>
6233 Bruno Haible <bruno@clisp.org>
6235 This lets translators provide better translations for the
6236 "Written by ..." part of --version output.
6237 * version-etc.h: Include stdarg.h.
6238 (version_etc_copyright): Declare as readonly.
6239 (version_etc): Make this function variadic with a NULL-terminated list
6240 of author name strings.
6241 (version_etc_va): New declaration.
6242 * version-etc.c: Include stdarg.h, stdlib.h.
6243 (version_etc_copyright): Declare as readonly.
6244 (version_etc_va): New function. Provide a different translatable string
6245 for each possible number of authors < 10. Abbreviate when there are 10
6247 (version_etc): Make this function variadic. Call version_etc_va.
6248 Suggestion from Gary V. Vaughan.
6250 * long-options.h (parse_long_options): Change prototype: the authors
6251 string is moved to the end and becomes variadic.
6252 * long-options.c: Include stdarg.h.
6253 (parse_long_options): Make this function variadic, too.
6254 Call version_etc_va, not version_etc.
6256 2003-10-06 Bruno Haible <bruno@clisp.org>
6258 * fatal-signal.h: New file, from GNU gettext.
6259 * fatal-signal.c: New file, from GNU gettext.
6261 2003-10-04 Karl Berry <karl@gnu.org>
6263 * argp*: update from libc.
6265 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6267 * getpass.c (getpass): Use a no-op fseek when switching from input to
6268 output mode on the same stream.
6270 2003-09-29 Paul Eggert <eggert@twinsun.com>
6272 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6273 Fix arg typo in previous patch.
6275 2003-09-28 Jim Meyering <jim@meyering.net>
6277 * error.c: Correct cpp indentation.
6279 2003-09-27 Paul Eggert <eggert@twinsun.com>
6281 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6282 Omit the special code that used __typeof__, since we worry that
6283 it could be more trouble than it's worth. See:
6284 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6285 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6289 2003-09-26 Jim Meyering <jim@meyering.net>
6291 * error.c (error_tail): Move some declarations
6292 into inner scope where the local variables are used.
6294 2003-09-26 Bruno Haible <bruno@clisp.org>
6296 * stpncpy.h (gnu_stpncpy): New declaration.
6297 (stpncpy): Define as alias for gnu_stpncpy.
6298 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6300 2003-09-26 Paul Eggert <eggert@twinsun.com>
6302 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6303 (error_tail): Do not loop, reallocating temporary buffer, since
6304 the output cannot contain more wide characters than the input
6305 contains bytes, the size must be big enough already. This avoids
6306 one potential size overflow calculation. Check for size overflow
6307 when calculating temporary buffer size. Free temporary buffer
6308 when done, if it was allocated with malloc; this plugs a memory
6309 leak. Remove casts from void * to pointers, that are no longer
6310 needed now that we're assuming C89 or better.
6312 Merge error changes from glibc.
6314 * error.c, error.h: Update copyright notice header to match glibc.
6315 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6316 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6317 Disable cancellation while printing error.
6318 * error.h: Prepend __ to parameter names.
6320 2003-09-25 Karl Berry <karl@gnu.org>
6322 * argp-fmtstream.c, argp-help.c: update from libc.
6324 2003-09-25 Bruno Haible <bruno@clisp.org>
6326 * version-etc-2.h: New file, from version-etc.h with modifications.
6327 * version-etc-2.c: New file, from version-etc.c with modifications.
6329 2003-09-25 Simon Josefsson <jas@extundo.com>
6331 * xgetdomainname.h: New file.
6332 * xgetdomainname.c: New file.
6334 2003-09-25 Simon Josefsson <jas@extundo.com>
6335 Bruno Haible <bruno@clisp.org>
6337 * getdomainname.h: New file.
6338 * getdomainname.c: New file.
6340 2003-09-24 Paul Eggert <eggert@twinsun.com>
6342 * linebuffer.c (freebuffer): Don't free the argument, just
6343 the buffer associated with the argument. Bug reported by
6346 2003-09-19 Karl Berry <karl@gnu.org>
6348 * argp.h: update from libc.
6350 2003-09-16 Paul Eggert <eggert@twinsun.com>
6352 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6353 input error, instead of returning NULL the next time we are called
6354 (and therefore losing track of errno).
6356 2003-09-15 Paul Eggert <eggert@twinsun.com>
6358 * getndelim2.c (getndelim2): Don't trash errno when a read
6359 fails, so that the caller gets the proper errno.
6361 * readutmp.c (read_utmp): Likewise.
6362 Check for fstat error. Close stream and free storage
6365 2003-09-14 Bruno Haible <bruno@clisp.org>
6367 * fwriteerror.h: New file.
6368 * fwriteerror.c: New file.
6370 2003-09-14 Jim Meyering <jim@meyering.net>
6372 * getloadavg.c: Correct cpp indentation.
6373 * strdup.c: Likewise.
6374 * vasnprintf.c: Likewise.
6376 2003-09-12 Paul Eggert <eggert@twinsun.com>
6378 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6379 * obstack.c [!defined _LIBC]: Likewise.
6380 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6381 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6382 * exitfail.c: Don't include stdlib.h; no longer needed.
6384 More changes to assume C89 or better.
6386 * error.c (error_tail): Assume vprintf.
6388 * argmatch.c (getenv): Remove decl.
6389 * progreloc.c (get_full_program_name): Define via prototype.
6390 * setenv.c (clearenv): Likewise.
6391 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6393 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6394 (malloc, memcpy): Remove decls.
6395 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6396 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6397 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6398 (memcpy): Remove macro.
6399 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6400 (__P): Remove. All uses removed.
6401 (PTR): Remove. All uses changed to void *.
6402 (CHAR_BIT, NULL): Remove.
6403 (spaces, zeros, memset_space, memset_zero)
6404 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6406 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6407 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6408 Define with prototype.
6409 Remove now-unnecessary prototype decl.
6410 (extra_args_spec): Assume ANSI C. All uses changed.
6411 (extra_args_spec_iso): Remove.
6412 (my_strftime, emacs_strftimeu): Define via prototype.
6413 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6415 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6416 * strtoimax.c: Include <stdlib.h> unconditionally.
6417 (strtoul, strtol): Remove decls.
6418 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6420 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6421 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
6422 (LOCALE_PARAM_PROTO): New macro.
6423 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6424 (INTERNAL (strtol), strtol): Define with a prototype.
6425 (PARAMS): Remove. All uses removed.
6426 * tempname.c: Include <string.h> unconditionally.
6427 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6428 * xgethostname.c (main): Define with a prototype.
6429 * xmalloc.c: Include "xalloc.h" first, to check interface.
6430 Include <stdlib.h> unconditionally.
6431 (calloc, malloc, realloc, free): Remove decls.
6432 * xstrtod.c: Include "xstrtod.h" first, to check interface.
6433 Include <stdlib.h> unconditionally. Sort include file names.
6435 (xstrtod): Define with a prototype.
6436 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6437 (strtol, strtoul): Remove decls.
6439 2003-09-11 Paul Eggert <eggert@twinsun.com>
6441 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6442 Include <stdlib.h>, <string.h> unconditionally.
6443 Remove now-unnecessary cast to char *.
6444 * strnlen.c: Include <string.h> unconditionally.
6445 * yesno.c (yesno): Define with a prototype.
6447 2003-09-10 Bruno Haible <bruno@clisp.org>
6449 * strcspn.c: Include <string.h> unconditionally.
6450 * strpbrk.c: Include <string.h> unconditionally.
6451 * strstr.c: Include <string.h> unconditionally.
6452 * unicodeio.c: Include <string.h> unconditionally.
6453 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6454 * unsetenv.c: Likewise.
6455 * xreadlink.c: Include <stdlib.h> unconditionally.
6456 * yesno.c: Include <stdlib.h> unconditionally.
6457 (rpmatch): Add prototype.
6459 2003-09-10 Jim Meyering <jim@meyering.net>
6461 * error.c: Correct indentation of cpp directives.
6463 2003-09-09 Paul Eggert <eggert@twinsun.com>
6467 * acosl.c (main): Use a prototype.
6468 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6471 * getloadavg.c (getloadavg, main): Define via prototypes.
6473 * getopt.h (struct option.name): Assume C89, and use 'const'.
6474 (getopt, etopt_long, getopt_long_only, _getopt_internal)
6475 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6477 * getopt.c (const): Remove macro.
6478 Include <string.h> unconditionally.
6479 (my_index): Remove; all uses changed to strchr.
6480 (strlen): Remove decl.
6481 (exchange): Remove forward decl; no longer needed.
6482 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6483 Define with prototype.
6484 * getopt1.c (const): Remove macro.
6485 (getopt_long, getopt_long_only, main): Define with prototype.
6487 * getugroups.c: Include <string.h> unconditionally.
6489 * getusershell.c: Include <stdlib.h> unconditionally.
6490 (getusershell, setusershell, endusershell, readname, main):
6491 Define with prototypes.
6493 * group-member.c: Include group-member.h first.
6494 Include <stdlib.h> unconditionally.
6496 * hard-locale.c: Include hard-locale.h first.
6497 Include <stdlib.h>, <string.h> unconditionally.
6499 * hash.c (free, malloc): Remove decls.
6500 Include <stdlib.h> unconditionally.
6502 * human.c: Include <stdlib.h>, <string.h> unconditionally.
6503 (getenv): Do not declare.
6505 * idcache.c: Include <string.h> unconditionally.
6507 * long-options.c: Include long-options.h first, to test interface.
6508 Include <stdlib.h> unconditionally.
6510 * makepath.c: Include makepath.h first, to test interface.
6511 Include <stdlib.h> and <string.h> unconditionally.
6513 * linebuffer.c: Include <stdlib.h>.
6514 (free): Remove decl.
6516 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6517 rpl_malloc returns void *, not char *.
6518 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
6520 * md5.h: Include <limits.h> unconditionally.
6521 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6522 (__P): Remove; all uses removed.
6523 * md5.c: Include "md5.h" first.
6524 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6525 md5_buffer, md5_process_bytes, md5_process_block):
6526 Define with prototypes.
6527 * sha.h (__P): Remove all uses. (It wasn't defined??)
6528 * sha.c: Include "sha.h" first.
6529 Include <stdlib.h>, <string.h> unconditionally.
6531 * memchr.c (__ptr_t): Remove; all uses changed to void *.
6532 * memcmp.c (__ptr_t): Likewise.
6533 * memrchr.c (__ptr_t): Likewise.
6534 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6535 Include <string.h> unconditionally.
6536 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6537 * memchr.c: Include <stdlib.h> unconditionally.
6538 * memchr.c (LONG_MAX): Remove.
6539 * memrchr.c (LONG_MAX): Likewise.
6540 * memchr.c (__memchr): Define via a prototype.
6541 * memrchr.c (__memrchr): Likewise.
6542 * memcmp.c (__P): Remove, and remove all uses.
6543 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6544 Remove forward decls; no longer needed.
6545 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6546 Use types required by C89 in prototype.
6548 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6549 * savedir.c: Likewise.
6550 * mkdir.c (free): Remove decl.
6551 * rmdir.c (rmdir): Define with a prototype.
6552 * savedir.c: Include savedir.h first, to test interface.
6554 * mktime.c (STDC_HEADERS): Remove.
6555 Include <stdlib.h>, <string.h> unconditionally.
6557 * modechange.c: Include <stdlib.h> unconditionally.
6558 (malloc): Remove decl.
6560 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6561 (free): Remove decl.
6563 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6564 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6565 (This type really should be intptr_t, but that's a C99ism.)
6566 (_obstack_memcpy): Remove: all uses changed to memcpy.
6567 Include <string.h> unconditionally.
6568 (struct obstack): Assume __STDC__ for types of members
6569 chunkfun, freefun, extra_arg.
6570 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6571 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6572 obstack_begin, obstack_specify_allocation,
6573 obstack_specify_allocation_with_arg, obstack_chunkfun,
6574 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6575 Remove unprototyped decls and the macros that use them.
6576 * obstack.c (POINTER): Remove. All uses changed to void *.
6577 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6578 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6579 (defined __STDC__ && __STDC__)]:
6580 Remove nonprototyped code.
6581 Include <stdlib.h> unconditionally.
6582 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6583 _obstack_allocated_p, _obstack_free, obstack_free,
6584 _obstack_memory_used, print_and_abort):
6585 Define using prototypes.
6586 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6587 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6588 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6589 obstack_next_free, obstack_object_size, obstack_room) [0]:
6590 Remove unused, unprototyped code.
6592 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6594 * physmem.c (physmem_total, physmem_available, main): Define
6597 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6598 (main): Define with a prototype.
6600 * posixver.c (getenv): Remove decl.
6602 * putenv.c (malloc): Returns void *, not char *.
6603 Include <string.h> unconditionally.
6604 (strchr, memcpy, NULL): Do not define.
6606 * readtokens.c: Include readtokens.h first, to test interface.
6607 Include <stdlib.h>, <string.h> unconditionally.
6608 (init_tokenbuffer): Define with a prototype.
6610 * regex.c (PARAMS): Remove. All uses removed.
6611 All uses of _RE_ARGS removed, too.
6612 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6614 (bzero): Assume memset exists.
6615 (memcmp, memcpy, NULL): Remove.
6616 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6617 char, or assignments to local vars of type signed char.
6618 (init_syntax_once, PREFIX(extract_number_and_incr),
6619 PREFIX(print_partial_compiled_pattern),
6620 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6621 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6622 PREFIX(regex_grow_registers), PREFIX(regex_compile),
6623 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6624 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6625 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6626 wcs_compile_range, byte_compile_range, truncate_wchar,
6627 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6628 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6629 count_mbs_length, wcs_re_match_2_internal,
6630 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6631 PREFIX(alt_match_null_string_p),
6632 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6633 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6634 regfree, PREFIX(extract_number)): Define with prototype. Remove
6635 now-unnecessary declaration, if any.
6636 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6638 Remove now-unnecessary casts among pointer types.
6639 * regex.h (_RE_ARGS): Remove. All uses removed.
6641 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6642 (free): Remove decl.
6644 * rpmatch.c: Include <stdlib.h> unconditionally.
6646 * same.c: Include <stdlib.h>, <string.h> unconditionally.
6647 (free): Remove decl.
6649 * save-cwd.c: Include <stdlib.h> unconditionally.
6650 * xgetcwd.c: Likewise.
6652 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6653 (free): Remove decl.
6655 * strchrnul.c (strchrnul): Define with a prototype.
6656 Fix bug: c_in was not converted to char before searching.
6658 The following changes are not K&R related:
6660 * group-member.h: Include <sys/types.h>, so that this file is
6662 * makepath.h: Likewise.
6664 * getusershell.c (readname, default_index, line_size, readname):
6665 Use size_t, not int, for sizes.
6666 (readname): If the size overflows, report an error instead of
6669 2003-09-09 Derek Robert Price <derek@ximbiot.com>
6671 * getndelim2.c: Assume stdlib.h per the C89 spec.
6673 2003-09-08 Paul Eggert <eggert@twinsun.com>
6675 Assume C89 or better; remove K&R cruft.
6676 A few of these changes were first proposed by Derek Robert Price
6677 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6679 * addext.c: Include <string.h> unconditionally.
6680 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6681 Don't declare getenv or malloc.
6683 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6684 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6686 (find_stack_direction, alloca): Use prototypes.
6688 * atexit.c (atexit): Define using a prototype.
6690 * basename.c, dirname.c, stripslash.c:
6691 Include <string.h> unconditionally.
6693 * bcopy.c: Include <stddef.h>.
6694 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6696 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6698 * error.h (error, error_at_line, error_print_progname)
6699 [! (defined (__STDC__) && __STDC__)]: Remove decls.
6700 * error.c: Include error.h first, to check interface.
6701 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6702 (VA_START): Remove; all uses changeed to va_start.
6703 (exit, strerror): Remove decls.
6704 (error_print_progname): Prototype uncondionally.
6705 Don't include <errno.h>; no longer needed.
6706 (private_strerror): Remove.
6707 (error_tail): Always define.
6708 (error, error_at_line): Assume C89 or better; always use prototypes.
6709 * fatal.c: Include "fatal.h" first, to test interface.
6710 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6711 (VA_START): Remove; all uses changed to va_start.
6712 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6714 (exit): Remove decl.
6715 (fatal): Prototype unconditionally. Assume va_start works.
6716 Abort at end, to pacify gcc.
6718 * euidaccess.c (main): Define with a prototype.
6720 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6722 * exitfail.c: Include <stdlib.h> unconditionally.
6724 * fnmatch_.h (__P): Remove. All uses changed to assume
6726 * fnmatch.c: Include fnmatch.h first, to test interface.
6727 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6728 (getenv): Remove decl.
6729 (fnmatch): Define using a prototype.
6730 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6731 (FCT): Define using a prototype.
6733 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6735 * gethostname.c: Include <stddef.h>.
6736 (gethostname): Define with prototype. Length is size_t, not int.
6738 2003-09-08 Paul Eggert <eggert@twinsun.com>
6740 * getversion.c: Remove; was migrated to backupfile.c in 1997.
6741 getversion.c should have been removed then, but was accidentally
6744 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6745 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6747 2003-09-07 Paul Eggert <eggert@twinsun.com>
6749 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6750 copy_tm_result. Bug reported by Simon Josefsson in
6751 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6753 2003-09-06 Paul Eggert <eggert@twinsun.com>
6755 * time_r.c, time_r.h: New files.
6757 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6759 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
6760 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6762 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6764 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6765 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6768 * timegm.c: Switch to glibc implementation, with the following changes:
6769 [defined HAVE_CONFIG_H]: Include <config.h>.
6770 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6771 (__mktime_internal) [!defined _LIBC]: New decl.
6772 (__gmtime_r) [!defined _LIBC]: New macro and function.
6773 (timegm): Use a prototype, since gnulib assumes C89.
6774 Do not bother declaring tmp to be const, as it's not really usefu.
6775 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6776 (timegm): Declare only if HAVE_DECL_TIMEGM.
6778 2003-09-03 Paul Eggert <eggert@twinsun.com>
6780 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6781 Bug reported by Lute Kamstra in
6782 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6784 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6785 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
6786 course with correspondingly smaller numbers for tomorrow and
6787 yesterday. From Tadayoshi Funaba. Originally installed into
6788 sh-utils on 1999-08-07, but the patch got lost (I guess during the
6791 2003-08-31 Simon Josefsson <jas@extundo.com>
6793 * timegm.h: New file.
6794 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
6796 2003-08-31 Karl Berry <karl@gnu.org>
6798 * argp.h: update from libc.
6800 2003-08-28 Bruno Haible <bruno@clisp.org>
6802 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6803 warning on QNX, which defines O_BINARY to 000000.
6805 2003-08-24 Bruno Haible <bruno@clisp.org>
6807 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6808 MSVC7 <stdio.h> is included later.
6810 2003-08-20 Bruno Haible <bruno@clisp.org>
6812 * progname.h: New file, from GNU gettext.
6813 * progname.c: New file, from GNU gettext.
6814 * progreloc.c: New file, from GNU gettext.
6816 2003-08-19 Bruno Haible <bruno@clisp.org>
6818 * xstrdup.c: Assume <string.h> exists.
6820 2003-08-18 Jim Meyering <jim@meyering.net>
6822 * setenv.h: Indent nested cpp directive.
6823 * vasnprintf.c: Remove trailing blanks.
6825 2003-08-17 Simon Josefsson <jas@extundo.com>
6826 Bruno Haible <bruno@clisp.org>
6828 * xstrndup.h: New file.
6829 * xstrndup.c: New file.
6831 2003-08-17 Bruno Haible <bruno@clisp.org>
6833 * strndup.h: New file.
6835 2003-08-16 Paul Eggert <eggert@twinsun.com>
6837 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6838 space, undoing this 2003-08-12 change:
6839 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6841 2003-08-16 Jim Meyering <jim@meyering.net>
6843 Merge from coreutils.
6844 * xstrtoimax.c: #else #if -> #elif.
6845 * xstrtoumax.c: Likewise.
6847 2003-08-15 Paul Eggert <eggert@twinsun.com>
6849 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6850 rather than tab, after '#' in shell-script copyright notices.
6851 Suggested by Bruno Haible.
6853 2003-08-15 Jim Meyering <jim@meyering.net>
6854 and Paul Eggert <eggert@twinsun.com>
6856 Merge from coreutils.
6857 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6858 member but strut utmpx does not. Needed for AIX 4.3.3.
6859 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6861 2003-08-15 Jim Meyering <jim@meyering.net>
6863 Merge from coreutils.
6864 * xgethostname.c: Include <stdlib.h>.
6865 (xghostname): Don't exit for anything other than memory-related
6866 failure; just return NULL.
6867 * userspec.c: Include "posixver.h".
6868 (parse_user_spec): Accept `.' as a separator only
6869 in pre-POSIX-200112 mode.
6870 * strtoimax.c: Use #elif rather than #else #if.
6871 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6872 Remove function, now that we can rely on a working tzset function.
6873 [!_LIBC]: Ensure that the required autoconf test has been run.
6874 [!defined _NL_CURRENT && HAVE_STRFTIME]:
6875 Use underlying_strftime for %r.
6876 * sha.c: Merge in some clean-up and optimization changes from glibc.
6877 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6878 Ensure that it is a multiple of 64.
6879 Rearrange loop exit tests so as to avoid performing an
6880 additional fread after encountering an error or EOF.
6881 * realloc.c: Update copyright date.
6883 2003-08-14 Jim Meyering <jim@meyering.net>
6885 Merge from coreutils.
6886 * obstack.h: Whitespace changes.
6887 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6888 and xcalloc return values.
6889 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6890 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
6891 hang on OSF/1 5.1 for DIR on both local and remote file systems.
6892 Reported by (and fix confirmed by) Nelson H. F. Beebe.
6893 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6895 Use mntctl's return value to drive the entry-processing loop, since
6896 we can't rely on the value of the vmt_length member in the last
6897 entry. On some systems doing so could result in exhausting
6898 virtual memory. Based in part on a patch from Mike Jetzer.
6900 2003-08-14 Jim Meyering <jim@meyering.net>
6901 and Paul Eggert <eggert@twinsun.com>
6903 Merges from coreutils, plus other fixes.
6904 * physmem.c: Merge in portability changes from gcc/libiberty
6905 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
6906 for credits and details. Thanks to Kaveh Ghazi for helping
6907 to keep these files in sync.
6908 (ARRAY_SIZE): Define it.
6909 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6910 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6911 (memcasecmp): Don't assume size_t fits in unsigned int.
6912 Remove casts and duplicate code.
6913 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6914 (memcpy): Remove definition.
6915 Merge in some clean-up and optimization changes from glibc.
6916 [BLOCKSIZE]: Move definition to top of file.
6917 Ensure that it is a multiple of 64.
6918 Rearrange loop exit tests so as to avoid performing an
6919 additional fread after encountering an error or EOF.
6920 * md5.h (md5_uintptr): Define.
6921 * makepath.c (CLEANUP_CWD): Report an error if we failed to
6922 return to the initial working directory. Preserve errno
6924 * idcache.c: Include "xalloc.h".
6925 (xmalloc, xrealloc): Remove decls.
6926 (getuser): Remove casts no longer required in C89.
6927 * human.c: Include stdio.h, for sprintf.
6928 * group-member.c: Include "xalloc.h".
6929 (xmalloc, xrealloc): Remove decls.
6930 (get_group_info): Remove casts no longer required in C89.
6931 * getusershell.c (readname): Remove casts no longer required in C89.
6932 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6933 * getline.c: Whitespace fix, from coreutils.
6935 2003-08-13 Paul Eggert <eggert@twinsun.com>
6937 * exclude.c: Include <ctype.h>
6938 (IN_CTYPE_DOMAIN): New macro.
6940 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6943 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6944 Undo previous (whitespace-only) change.
6946 2003-08-12 Paul Eggert <eggert@twinsun.com>
6948 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6949 Normalize leading white space and remove trailing white space.
6950 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6951 notice, as per ../config/srclist-update.
6953 Merge from coreutils.
6954 * euidaccess.h: New file.
6955 * euidaccess.c: Include it.
6956 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6957 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
6958 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6960 2003-08-11 Bruno Haible <bruno@clisp.org>
6962 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6963 (vasnprintf): Use it instead of wcslen.
6965 2003-08-11 Bruno Haible <bruno@clisp.org>
6967 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6968 value to ensure that _Bool promotes to int. Use #define for _Bool when
6969 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6971 2003-08-10 Karl Berry <karl@gnu.org>
6973 * regex.h: update from libc (whitespace fix).
6975 2003-08-09 Paul Eggert <eggert@twinsun.com>
6977 Merge some files from coreutils. These changes were
6978 originally made by Jim Meyering.
6979 * acl.c: Include <sys/types.h> before <sys/stat.h>;
6980 many older Unixes require this.
6981 * alloca.c (alloca): Remove cast to argument of free;
6982 no longer needed in C89.
6983 * alloca_.h, regex.h: Fix white space to match
6984 what GNU indent does.
6986 2003-08-05 Paul Eggert <eggert@twinsun.com>
6988 * bumpalloc.h: Remove.
6990 2003-08-04 Paul Eggert <eggert@twinsun.com>
6992 * getloadavg.c: Change copyright notice and spacing to conform to
6995 Merge from coreutils.
6996 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6998 * getdate.y (date): Also accept dates like May-23-2003; suggestion
6999 from Karl Berry, implemented by Jim Meyering.
7000 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7001 from Dmitry V. Levin.
7002 Remove anachronistic cast of xrealloc.
7003 * fnmatch_.h (__const): Remove. Use 'const'.
7004 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7005 type. Otherwise, it wouldn't compile with at least /bin/cc on
7006 ymp-cray-unicos9.0.2.X.
7007 Combine two mostly-identical uses of alloca into one.
7008 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7010 2003-08-04 Dave Love <d.love@dl.ac.uk>
7014 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7015 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7016 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7017 obsolete NLIST_NAME_UNION.
7018 [__GNU__]: Undef BSD and FSCALE.
7019 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7021 2003-08-03 Paul Eggert <eggert@twinsun.com>
7023 * stdbool_.h (_Bool): Make it signed char, instead of
7024 an enum type, so that it's guaranteed to promote to int. See:
7025 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7027 2003-07-31 Paul Eggert <eggert@twinsun.com>
7029 * strerror.c: Include config.h, limits.h. Declare sprintf.
7030 (strerror): Don't assume that a printable int fits in 14 bytes.
7032 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7033 Bruno Haible <bruno@clisp.org>
7035 * getline.h (getline, getdelim): Change return type to ssize_t.
7036 * getline.c (getline, getdelim): Likewise.
7037 Remove _GNU_SOURCE define; now it's defined in config.h through
7040 2003-07-22 Paul Eggert <eggert@twinsun.com>
7042 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7043 over-parenthesization in macros.
7045 Sync with coreutils.
7047 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7050 Use `exit_failure' for xalloc and xmemcoll instead of their own
7051 private exit-failure variables.
7052 * xalloc.h (xalloc_exit_failure): Remove.
7053 * xmalloc.c: Likewise. Include exitfail.h.
7054 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7055 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7056 * xmemcoll.c: Likewise. Include exitfail.h.
7057 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7059 2003-07-18 Paul Eggert <eggert@twinsun.com>
7061 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7062 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7063 to test that it can stand by itself. Include "exitfail.h".
7064 Clients should set exit_failure instead.
7065 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7067 2003-07-18 Andreas Schwab <schwab@suse.de>
7069 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7071 2003-07-18 Bruno Haible <bruno@clisp.org>
7073 * getndelim2.h: New file.
7074 * getndelim2.c: Make into a module of its own. Include config.h,
7076 (getndelim2): Make non-static. Change return type to ssize_t.
7077 * getline.h: Change argument names.
7078 * getline.c: Include getndelim2.h instead of getndelim2.c.
7079 * getnline.c: Include getndelim2.h.
7081 2003-07-17 Bruno Haible <bruno@clisp.org>
7083 * Makefile.am: Remove file.
7084 * Makefile.in: Remove file.
7086 2003-07-17 Bruno Haible <bruno@clisp.org>
7088 * getnline.h: New file.
7089 * getnline.c: New file.
7090 * getndelim2.c: New file, extracted from getline.c.
7091 (getndelim2): Renamed from getdelim2, with added nmax argument.
7092 * getline.c: Include getndelim2.c.
7093 (getdelim2): Moved out to getndelim2.c.
7094 (getline, getdelim): Update.
7096 2003-07-15 <karl@gnu.org>
7098 * vasnprintf.c: update from gettext.
7100 2003-07-15 Jim Meyering <jim@meyering.net>
7102 * makepath.c (make_path): Enclose diagnostic in _(...).
7104 2003-07-14 Paul Eggert <eggert@twinsun.com>
7106 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7107 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7108 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7109 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7110 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7111 updated automatically by ../config/srclist-update. This changes
7112 their license from LPGL to GPL.
7114 2003-07-14 Jim Meyering <jim@meyering.net>
7116 Don't emit diagnostics. Let callers do that.
7117 * save-cwd.c: Don't include "error.h".
7118 (save_cwd): Don't call error. Ensure that errno is valid
7119 when returning nonzero.
7121 * save-cwd.h (restore_cwd): Update prototype.
7122 * save-cwd.c (restore_cwd): Remove two parameters.
7123 Simplify. Don't call error upon failure. Let callers do that.
7124 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7125 when auditing is enabled. But don't bother updating the #if.
7127 2003-07-14 Simon Josefsson <jas@extundo.com>
7129 * mempcpy.h: New file.
7130 * mempcpy.c: New file.
7132 2003-07-14 Paul Eggert <eggert@twinsun.com>
7134 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7135 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7136 unicodeio.c, unicodeio.h, unlocked-io.h:
7137 Switch from LGPL to GPL.
7139 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7141 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7142 it breaks C++ compilation.
7143 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7145 2003-07-10 Jim Meyering <jim@meyering.net>
7147 * vasnprintf.c: Remove trailing blanks.
7148 Make cpp indentation consistent.
7150 2003-07-09 Paul Eggert <eggert@twinsun.com>
7152 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7153 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7154 Switch from LGPL to GPL.
7156 2003-07-07 Paul Eggert <eggert@twinsun.com>
7158 * mktime.c: Fix some boundary cases and remove need for floating point.
7160 Issue a compile-time diagnostic if time_t is floating point, or if
7161 two's complement arithmetic is not in effect, or if arithmetic
7162 right shift does not propagate the sign. These assumptions were
7163 all in the original code but they weren't checked.
7165 (TIME_T_MIDPOINT, verify): New macros.
7166 (__isleap): Remove; it has integer overflow problems.
7167 (leapyear): New function, without those problems.
7168 (ydhms_tm_diff): Remove; splitting into two parts.
7169 (ydhms_diff): New function, containing the arithmetic part of
7170 the old ydhms_tm_diff function. Issue a compile-time
7171 diagnostic if we are not using C99 integer division.
7172 Avoid casts when possible.
7173 (guess_time_tm): New function, containing the checking part of
7174 the old ydhms_tm_diff function. Return the new value, rather than
7175 the difference between it and the old. Accept a new argument T
7176 so that *T specifies the old value. Check for overflow in the result.
7178 (__mktime_internal): Use a time_t offset, not a long int offset.
7179 This undoes the 2003-06-04 change, which is no longer needed now
7180 that we have better overflow checking.
7181 (localtime_offset): Likewise.
7183 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7184 and long are 64-bit but int is only 32-bit.
7185 (ydhms_diff): Use long int to store year1 and yday1.
7186 Issue a compile-time diagnostic if long int is not wide enough.
7188 (__mktime_internal): Use long int to store adjusted year and yday.
7189 Use plain C rather than preprocessor commands, if that doesn't
7191 Check for overflow (and try to repair) after each probe
7192 rather than checking only at the very end. This avoids some bugs
7193 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7194 does not equal GMT offset at maximum time).
7195 Use integer to check for overflow rather than floating point; this
7196 is more portable to non-IEEE hosts, and is a tad faster.
7197 When we detect that we are oscillating between two values,
7198 don't check whether tm_isdst has the requested value, since
7199 we already know the answer. When tm_isdst has the wrong value,
7200 use a different heuristic to find the right one, based on the
7201 extreme values actually observed in practice in tz2003a,
7202 rather than the (overly optimistic) "previous 3 calendar quarters".
7204 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7205 "T const" to accommodate glibc style.
7206 (check_result): Use less-confusing report format. "long" -> "long int.
7208 Don't loop if the iteration overflows time_t.
7209 Allow a negative step in the iteration.
7211 2003-07-01 Paul Eggert <eggert@twinsun.com>
7213 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7214 having it depend on HAVE_SYS_TYPES_H.
7216 2003-06-25 Bruno Haible <bruno@clisp.org>
7218 * readlink.c: New file.
7220 2003-06-20 Bruno Haible <bruno@clisp.org>
7222 Assume C89, so PARAMS isn't needed.
7223 * unicodeio.h (PARAMS): Remove.
7224 * unicodeio.c: Don't use PARAMS.
7226 2003-06-18 Jim Meyering <jim@meyering.net>
7228 Merge changes from coreutils.
7229 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7230 Remove explicit declarations of xmalloc and realloc.
7232 (read_utmp): Remove anachronistic cast of xmalloc.
7234 2003-06-17 Paul Eggert <eggert@twinsun.com>
7236 Assume C89, so PARAMS isn't needed.
7237 * backupfile.h (PARAMS): Remove. All uses removed.
7238 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7239 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7240 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7241 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7242 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7243 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7244 xstrtol.h: Likewise.
7245 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7246 same.h, strverscmp.h: Do not include config.h; no longer needed.
7247 Anyway, config.h should always be included before any other file.
7249 2003-06-11 Simon Josefsson <jas@extundo.com>
7251 * sysexit_.h: New file.
7253 2003-05-20 Derek Price <derek@ximbiot.com>
7255 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7257 2003-06-10 Simon Josefsson <jas@extundo.com>
7259 * strchrnul.h: New file.
7260 * strchrnul.c: New file.
7262 2003-06-10 Simon Josefsson <jas@extundo.com>
7264 * argp.h: New file, from glibc.
7265 * argp-ba.c: New file, from glibc.
7266 * argp-eexst.c: New file, from glibc.
7267 * argp-fmtstream.c: New file, from glibc.
7268 * argp-fmtstream.h: New file, from glibc.
7269 * argp-fs-xinl.c: New file, from glibc.
7270 * argp-help.c: New file, from glibc.
7271 * argp-namefrob.h: New file, from glibc.
7272 * argp-parse.c: New file, from glibc.
7273 * argp-pv.c: New file, from glibc.
7274 * argp-pvh.c: New file, from glibc.
7275 * argp-xinl.c: New file, from glibc.
7277 2003-06-07 Jim Meyering <jim@meyering.net>
7279 * readtokens.h: Put `Free Software Foundation, Inc.'
7280 in place of my name in the copyright comment.
7281 Remove definition and uses of __P.
7284 * stat.c: Don't declare xmalloc explicitly.
7285 Instead, include "xalloc.h".
7286 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7287 xrealloc, and xcalloc return values.
7288 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7290 * xgetcwd.h: Remove definition/uses of PARAMS.
7292 2003-06-06 Jim Meyering <jim@meyering.net>
7294 * stdbool_.h: Renamed from stdbool.h.in.
7296 2003-06-06 Jim Meyering <jim@meyering.net>
7298 Merge from coreutils.
7299 * same.c: (same_name): Declare *_basename locals to be `const'.
7300 Consolidate declarations and initializations of *_base* locals.
7302 Merge from coreutils.
7303 This avoids a core dump on systems without GNU putenv,
7304 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7305 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7306 (unsetenv): New static function, from GNU libc.
7307 (rpl_putenv): Use it.
7309 * modechange.c: Remove trailing blanks.
7311 Merge from coreutils.
7312 * fsusage.c: Remove declaration of statfs.
7313 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7315 * posixtm.c: Include <stdbool.h> unconditionally.
7317 2003-06-05 Paul Eggert <eggert@twinsun.com>
7319 * mktime.c (__mktime_internal): When resolving a tm_isdst
7320 mismatch, look in future quarters as well as past. This fixes a
7321 bug when processing fall-backwards gaps immediately after a long
7322 period of daylight-saving time.
7324 * mktime.c: Assume freestanding C89 or better.
7325 (HAVE_LIMITS_H): Remove. Assume it's 1.
7326 (__P): Remove; not used.
7327 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7328 (mktime, not_equal_tm, print_tm, check_result,
7329 main): Use prototypes. Use const * where appropriate.
7330 (main): Fix typo in testing code that uncovered by above changes.
7331 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7333 2003-06-04 Paul Eggert <eggert@twinsun.com>
7335 * mktime.c: Fix Debian bug 177940
7336 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7337 (localtime_offset): Now long int, not time_t, because we want it
7338 to be guaranteed to be signed. All uses changed.
7339 (__mktime_internal): If overflow would occur when adding offset,
7342 Merge 'human' changes from coreutils. Rewrite to support
7343 locale-specific notations like thousands separators.
7344 * human.c: Simplify authorship notice.
7345 Include human.h immediately after config.h.
7346 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7347 <limits.h>: Do not include, since human.h does.
7348 (SIZE_MAX, UINTMAX_MAX): New macros.
7349 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7350 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7351 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7352 (power_letter): Renamed from suffixes.
7353 (generate_suffix_backwards): Remove.
7354 (adjust_value): Now takes int style (because of human.h changes)
7355 and long double value (for greater precision on some platforms).
7356 (group_number): New function.
7357 (human_readable): Use it. Use integer options, not enum.
7358 Put the options before the sizes in the arg list.
7359 Support all the new options.
7360 The old human_readable function has been removed;
7361 use inttostr.h instead.
7362 (human_readable, default_block_size, humblock):
7363 Use uintmax_t, not int, for block sizes.
7364 (human_readable_inexact, block_size_types): Remove.
7365 (block_size_opts): New constant.
7366 (human_options): Renamed from human_block_size, with new signature
7367 that allows block sizes up to UINTMAX_MAX. All callers changed.
7368 * human.h: Add copyright and authorship notice.
7369 Include <limits.h> and <stdbool.h> unconditionally.
7370 (PARAMS): Remove. All uses removed.
7371 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7372 (enum human_inexact_style): Remove tag; now a nameless enum.
7373 (human_floor, human_ceiling, human_round_to_even): Now have
7374 values 2, 0, 1 rather than -1, 1, 0.
7375 (human_group_digits, human_suppress_point_zero, human_autoscale,
7376 human_base_1024, human_SI, human_B): New constants.
7377 (human_readable_inexact, human_block_size): Remove.
7378 (human_readable): Size args are now uintmax_t, not int.
7379 (human_options): New decl.
7381 * exclude.c: (new_exclude, add_exclude): Remove casts that are
7382 unnecessary now that we assume C89 or better. This change
7383 imported from coreutils.
7385 * mktime.c (__mktime_internal): Do not reject negative timestamps
7386 arbitrarily. This is the same patch as 2003-05-28, but it got lost
7387 in the 2003-05-30 sync from glibc.
7389 .h files should stand alone, but we shouldn't include <sys/types.h>
7390 if we can get away with just <stddef.h>.
7392 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7393 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7394 rather than <sys/types.h>, as we merely need size_t.
7395 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7397 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7398 Include <stdio.h>, to get FILE.
7399 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7400 memcasecmp.h has included <stddef.h> and all we need is size_t.
7401 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7402 our interface, instead of including <sys/types.h>
7404 2003-06-02 Paul Eggert <eggert@twinsun.com>
7407 Fix some minor time-related bugs with POSIX time arguments.
7408 Some valid time stamps were being rejected (notably -1, and
7409 time stamps before 1900 on 64-bit hosts). And some invalid
7410 time stamps were being accepted, e.g. September 31.
7412 * posixtm.h (posixtime): Return bool instead of time_t, so
7413 that we can return (time_t) -1 successfully.
7414 * posixtm.c: Likewise.
7415 [HAVE_STDBOOL_H]: Include <stdbool.h>.
7416 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7417 (t): Remove static var.
7418 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7419 of static var. All uses changed.
7420 (year): Do not reject years before 1900; they can occur with
7422 (posix_time_parse): Do not check for out-of-range components;
7423 that is now the caller's responsibility, since our checks were
7424 only approximations.
7425 (posixtime): Use mktime to check for out-of-range components,
7426 since it knows them exactly.
7427 If mktime returns (time_t) -1, check whether an error actually occurred
7428 by invoking localtime on -1.
7429 (main) [TEST_POSIXTIME]: Check for input data errors, and report
7430 posixtime failures better.
7431 Improve the test data (in comments only).
7433 2003-05-30 <karl@gnu.org>
7435 * mktime.c: update from libc.
7437 2003-05-30 Bruno Haible <bruno@clisp.org>
7439 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7440 * localcharset.h: Likewise.
7441 * localcharset.c: Likewise.
7443 2003-05-28 Paul Eggert <eggert@twinsun.com>
7445 Assume the headers required for C89 freestanding compilers.
7446 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7447 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7448 without checking for HAVE_LIMITS_H.
7449 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7450 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7452 * fatal.c: Include <stdarg.h> without checking for __STDC__.
7453 * exclude.c: Include <stdbool.h> unconditionally.
7454 * tempname.c: Include <stddef.h> unconditionally.
7455 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7456 * modechange.c, rpmatch.c (NULL): Don't define, since
7457 <stddef.h> does that.
7458 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7459 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7460 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7461 * xstrtol.c: Likewise.
7462 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7463 * savedir.c: Include <stddef.h> instead of defining NULL.
7465 * addext.c (addext): Use assignment rather than cast, to avoid
7466 warnings on some platforms.
7468 * mktime.c (__mktime_internal): Do not reject negative timestamps
7471 2003-05-10 Bruno Haible <bruno@clisp.org>
7473 * linebreak.c (iconv_string_length): Don't return -1 just because the
7474 string is longer than 4 KB.
7476 2003-05-12 Jim Meyering <jim@meyering.net>
7478 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7479 the space-padded-by-default conversion specifiers, %e, %k, %l.
7481 2003-05-03 Bruno Haible <bruno@clisp.org>
7483 Upgrade to Unicode-4.0.
7484 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7485 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7486 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7487 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7488 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7489 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7490 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7491 Change width of U+E0100..U+E01EF from 1 to 0.
7493 2003-04-25 Bruno Haible <bruno@clisp.org>
7495 * copy-file.c: Include <stddef.h>, for size_t.
7497 2003-04-25 Jim Meyering <jim@meyering.net>
7499 * copy-file.c (copy_file_preserving): Declare buf_size to be
7500 of type size_t, not int.
7502 2003-04-11 Jim Meyering <jim@meyering.net>
7504 Merge changes from Coreutils.
7506 2003-03-22 Jim Meyering <jim@meyering.net>
7508 * strftime.c (widen): Cast alloca return value to proper type.
7510 2003-01-19 Ulrich Drepper <drepper@redhat.com>
7513 * strftime.c (my_strftime): Handle very large width
7514 specifications for numeric values correctly. Improve checks for
7517 2003-01-19 Jim Meyering <jim@meyering.net>
7519 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7520 (nl_get_alt_digit) [! defined my_strftime]: Define.
7521 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7522 _nl_get_alt_digit and _nl_get_walt_digit.
7524 * strftime.c (my_strftime): Merge in locale-related changes from libc.
7525 These changes have no effect outside of _LIBC.
7527 2003-04-10 Bruno Haible <bruno@clisp.org>
7529 * findprog.h: New file, from GNU gettext.
7530 * findprog.c: New file, from GNU gettext.
7532 2003-04-05 Jim Meyering <jim@meyering.net>
7534 Merge changes from Coreutils.
7536 * exclude.h (PARAMS): Remove definition and uses.
7537 * exclude.c: Remove uses of `PARAMS'.
7539 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7540 Add test-cases for DOS filenames. Declare program_name.
7541 (main): Set up program_name. Patch by Rich Dawe.
7543 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7545 Use mntctl's return value to drive the entry-processing loop, since
7546 we can't rely on the value of the vmt_length member in the last
7547 entry. On some systems doing so could result in exhausting
7548 virtual memory. Based in part on a patch from Mike Jetzer.
7550 2003-04-04 Bruno Haible <bruno@clisp.org>
7552 * linebreak.h: New file, from GNU gettext.
7553 * linebreak.c: New file, from GNU gettext with slight modifications.
7554 * lbrkprop.h: New file, from GNU gettext.
7556 2003-04-03 Bruno Haible <bruno@clisp.org>
7558 * utf8-ucs4.h: New file, from GNU gettext.
7559 * utf16-ucs4.h: New file, from GNU gettext.
7560 * ucs4-utf8.h: New file, from GNU gettext.
7561 * ucs4-utf16.h: New file, from GNU gettext.
7563 2003-04-02 Bruno Haible <bruno@clisp.org>
7565 * binary-io.h: New file, from GNU gettext.
7567 2003-04-01 Bruno Haible <bruno@clisp.org>
7569 * pathname.h: New file, from GNU gettext.
7570 * concatpath.c: New file, from GNU gettext.
7572 2003-03-30 Bruno Haible <bruno@clisp.org>
7574 * copy-file.c (copy_file_preserving): Don't set owner if the function
7575 chown() doesn't exist.
7577 2003-03-28 Bruno Haible <bruno@clisp.org>
7579 * copy-file.h: New file, from GNU gettext.
7580 * copy-file.c: New file, from GNU gettext.
7582 2003-03-18 Jim Meyering <jim@meyering.net>
7584 * quote.c (quote_n): Fix typo in comment.
7586 2003-03-14 Jim Meyering <jim@meyering.net>
7588 Merge changes from Coreutils.
7589 * obstack.h (obstack_object_size): Declare temporary, __o,
7590 to be const, in order to avoid warnings.
7591 (obstack_room): Likewise.
7592 (obstack_empty_p): Likewise.
7594 2003-03-13 Paul Eggert <eggert@twinsun.com>
7596 Merge changes from Bison.
7597 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7598 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7599 when compiling Bison 1.875's `bitset bset = obstack_alloc
7600 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7601 * hash.c: Include <stdbool.h> unconditionally.
7603 2003-03-09 Paul Eggert <eggert@twinsun.com>
7605 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7606 Reported by Bruce Becker; see:
7607 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7609 2003-03-03 Paul Eggert <eggert@twinsun.com>
7610 Bruno Haible <bruno@clisp.org>
7612 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7613 Reported by John Hughes, see
7614 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7616 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
7618 * poll_.h: New file.
7621 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
7623 * mathl.h: New file.
7624 * acosl.c: New file.
7625 * asinl.c: New file.
7626 * atanl.c: New file.
7627 * ceill.c: New file.
7630 * floorl.c: New file.
7631 * frexpl.c: New file.
7632 * ldexpl.c: New file.
7634 * sincosl.c: New file.
7636 * sqrtl.c: New file.
7638 * trigl.c: New file.
7639 * trigl.h: New file.
7641 2003-02-17 Bruno Haible <bruno@clisp.org>
7643 * mkdtemp.h: New file, from GNU gettext.
7644 * mkdtemp.c: New file, from GNU gettext.
7646 2003-01-31 Bruno Haible <bruno@clisp.org>
7648 * rename.c: #undef rename before defining rpl_rename.
7649 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7651 2003-01-30 Bruno Haible <bruno@clisp.org>
7653 * printf-args.h: New file, from GNU gettext.
7654 * printf-args.c: New file, from GNU gettext.
7655 * printf-parse.h: New file, from GNU gettext.
7656 * printf-parse.c: New file, from GNU gettext.
7657 * vasnprintf.h: New file, from GNU gettext.
7658 * vasnprintf.c: New file, from GNU gettext.
7659 * asnprintf.c: New file, from GNU gettext.
7660 * vasprintf.h: New file, from GNU gettext with modifications.
7661 * vasprintf.c: New file, from GNU gettext.
7662 * asprintf.c: New file, from GNU gettext.
7664 2003-01-29 Bruno Haible <bruno@clisp.org>
7666 * stpncpy.h: New file, from GNU gettext with modifications.
7667 * stpncpy.c: New file, from GNU gettext with modifications.
7669 2003-01-28 Bruno Haible <bruno@clisp.org>
7671 * c-ctype.h: New file, from GNU gettext, with changes suggested by
7673 * c-ctype.c: New file, from GNU gettext, with changes suggested by
7676 2003-01-27 Bruno Haible <bruno@clisp.org>
7678 * xsetenv.h: New file, from GNU gettext.
7679 * xsetenv.c: New file, from GNU gettext.
7681 2003-01-23 Bruno Haible <bruno@clisp.org>
7683 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7685 2003-01-22 Bruno Haible <bruno@clisp.org>
7687 * exit.h: New file, from GNU gettext.
7689 2003-01-11 Bruno Haible <bruno@clisp.org>
7691 * stpcpy.h (stpcpy): Use ANSI C function declarations.
7692 * strcase.h (strcasecmp, strncasecmp): Likewise.
7694 2003-01-14 Jim Meyering <jim@meyering.net>
7696 * same.c (same_name): Tweak a comment.
7698 2003-01-11 Bruno Haible <bruno@clisp.org>
7700 * same.c (same_name): Reorder tests so as to avoid calling stat()
7701 when a string comparison is sufficient.
7703 2003-01-11 Bruno Haible <bruno@clisp.org>
7705 * readtokens.c (readtoken): Cast character to 'unsigned char', not
7708 2003-01-11 Bruno Haible <bruno@clisp.org>
7710 * hash-pjw.c: Add comment about low quality of this function.
7712 2003-01-12 Paul Eggert <eggert@twinsun.com>
7714 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7715 to avoid collisions with libcurses and libreadline.
7717 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7718 * getstr.h, getstr.c: Remove.
7719 * getline.c: Include "getline.h", to check interface.
7720 Move body of old getstr.c here: this defines MIN_CHUNK and
7721 declares getdelim2, which is renamed from getstr.
7722 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7724 * linebuffer.c (readlinebuffer): Renamed from readline.
7726 * linebuffer.h: Likewise.
7727 (readline): Remove backward-compatibility macro.
7729 2003-01-12 Jim Meyering <jim@meyering.net>
7731 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
7733 2003-01-10 Bruno Haible <bruno@clisp.org>
7735 * alloca_.h: New file.
7736 * getdate.y: Unconditionally include alloca.h.
7737 * makepath.c: Likewise.
7738 * setenv.c: Likewise.
7739 * userspec.c: Likewise.
7741 2003-01-09 Bruno Haible <bruno@clisp.org>
7743 * stdbool.h.in: New file.
7745 2003-01-08 Bruno Haible <bruno@clisp.org>
7747 * safe-read.c: Include specification header first, to ensure its
7749 * full-write.c: Likewise.
7751 2003-01-08 Jim Meyering <jim@meyering.net>
7753 * full-write.c: Undefine and define-away `const' after inclusion
7754 of errno.h, not before. Suggestion from Bruno Haible.
7756 2003-01-07 Jim Meyering <jim@meyering.net>
7758 * full-write.c: Rework so that it may serve to define full_read, too.
7759 * full-read.c: Simply #define FULL_READ and include full-write.c.
7761 2003-01-06 Jim Meyering <jim@meyering.net>
7763 * version-etc.c: Update year in translatable copyright string.
7765 2002-12-25 Bruno Haible <bruno@clisp.org>
7767 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7768 * xstrtol.h: Likewise.
7769 * xstrtoimax.c: Likewise.
7770 * xstrtoumax.c: Likewise.
7771 * human.h: Likewise.
7773 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7774 on systems that have <inttypes.h> but not <stdint.h>.
7776 2002-12-31 Paul Eggert <eggert@twinsun.com>
7778 * memcoll.c (memcoll): Fall back on a simple algorithm using
7779 memcmp if strcoll doesn't work.
7781 2002-12-23 Bruno Haible <bruno@clisp.org>
7783 * localcharset.h: New file.
7784 * localcharset.c: Include it.
7785 * unicodeio.c: Likewise.
7787 2002-12-22 Bruno Haible <bruno@clisp.org>
7789 * utime.c (utime_null): No need to call ftruncate if the file was
7792 2002-12-23 Bruno Haible <bruno@clisp.org>
7794 * memcoll.c (STRCOLL): New macro.
7797 2002-12-22 Bruno Haible <bruno@clisp.org>
7799 * getstr.h (getstr): Define, to avoid clash with libcurses.
7800 * linebuffer.h (readline): Define, to avoid clash with libreadline.
7802 2002-12-22 Bruno Haible <bruno@clisp.org>
7804 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7806 2002-12-23 Bruno Haible <bruno@clisp.org>
7808 * getline.h: Include <stddef.h>, for size_t.
7810 * unicodeio.h: Include <stddef.h>, for size_t.
7811 * unicodeio.c: Don't include <stddef.h>.
7813 2002-12-17 Bruno Haible <bruno@clisp.org>
7815 * canon-host.c (strdup): Remove unused declaration.
7817 * fsusage.c: Include full_read.h.
7818 (get_fs_usage): Use full_read instead of safe_read.
7820 * utime.c (utime_null): Use SAFE_READ_ERROR.
7822 2002-12-11 Bruno Haible <bruno@clisp.org>
7824 * setenv.h: Rewritten to cope with systems that have setenv() but not
7826 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7829 2002-12-11 Bruno Haible <bruno@clisp.org>
7831 * setenv.c (alloca): Fall back to malloc.
7833 (setenv): Use freea() to free memory allocated with alloca().
7835 2002-11-13 Bruno Haible <bruno@clisp.org>
7837 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7838 function declarations.
7839 * unsetenv.c (unsetenv): Likewise.
7841 2002-03-04 Bruno Haible <bruno@clisp.org>
7843 Portability to AIX 4.3.3.
7844 * unsetenv.c: New file, extracted from setenv.c.
7845 * setenv.c: Move the unsetenv() function to unsetenv.c.
7847 2001-12-20 Bruno Haible <bruno@clisp.org>
7849 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7850 use malloc instead. For SunOS 4.
7852 2001-12-11 Bruno Haible <bruno@clisp.org>
7854 * setenv.c: Declare alloca.
7855 (compar_fn_t): New typedef.
7856 (KNOWN_VALUE, STORE_VALUE): Use it.
7858 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7861 2002-12-10 Paul Eggert <eggert@twinsun.com>
7863 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7864 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7865 Choose values that are less likely to collide with system fnmatch
7867 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7868 defined (e.g., a pure POSIX system).
7869 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7870 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7872 2002-12-06 Jim Meyering <jim@meyering.net>
7874 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7876 Merge in changes from libc's misc/error.c, in preparation
7877 for the merge of gnulib's changes back into libc.
7879 * error.c (_): Define only if not already defined.
7880 Move definition to follow all #include directives.
7881 Include unlocked-io.h only if !_LIBC.
7882 [_LIBC]: Include <libio/libioP.h>.
7883 [USE_IN_LIBIO]: Include <libio/iolibio.h>
7884 (fflush): Tweak definition to use INTUSE.
7887 2002-12-05 Paul Eggert <eggert@twinsun.com>
7889 * alloca.c [defined emacs]: Include "lisp.h".
7890 (xalloc_die) [defined emacs]: New macro.
7891 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7892 [! defined emacs]: Include <xalloc.h>.
7893 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7894 (pointer): Typedef to POINTER_TYPE *.
7895 (malloc): Remove decl; we now always use xmalloc.
7896 (alloca): Use old-style definition, since Emacs needs this.
7897 Check for arithmetic overflow when computing combined size.
7899 2002-12-04 Paul Eggert <eggert@twinsun.com>
7901 Do not generate unlocked-io.h automatically, since it's easier to
7902 maintain it by hand.
7904 * unlocked-io.h: New file, from GNU diffutils,
7905 but with proper copyright notice and attribution.
7907 * Makefile.am: Add copyright notice.
7908 (libfetish_a_SOURCES): Add unlocked-io.h.
7909 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7910 (DISTCLEANFILES, io_functions): Remove macros.
7911 (EXTRA_DIST): Remove gen_uio.
7912 (unlocked-io.h): Remove rule.
7914 2002-12-04 Jim Meyering <jim@meyering.net>
7916 Reflect the fact that stat.c and lstat.c are no longer generated.
7917 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7918 (DISTCLEANFILES): Likewise.
7919 (EXTRA_DIST): Likewise.
7920 (all_local): Don't depend on stat.c or lstat.c.
7921 (stat.c, lstat.c): Remove rules.
7922 (EXTRA_DIST): Remove xstat.in.
7924 * xstat.in: Remove file. Contents moved into stat.c.
7925 * stat.c: New file. Contents mostly from xstat.in.
7926 * stat.c: Rework so that it may serve to define rpl_lstat, too.
7927 * lstat.c: New file. Simply #define LSTAT and include stat.c.
7929 * safe-read.c: Rework so that it may serve to define safe_write, too.
7930 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7932 2002-12-03 Jim Meyering <jim@meyering.net>
7934 * safe-read.c, safe-write.c: Change variable names and comments, but
7935 not semantics, to minimize the differences between these two files.
7936 (safe_read): Change comment to mention SAFE_READ_ERROR.
7938 * safe-read.c (IS_EINTR): Define.
7939 (safe_read): Use IS_EINTR in place of in-function cpp directives.
7941 2002-12-02 Bruno Haible <bruno@clisp.org>
7943 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7944 Define, taken from safe-read.c.
7945 (INT_MAX): Provide fallback.
7946 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7947 * safe-write.h (SAFE_WRITE_ERROR): Define.
7949 * safe-read.c (EINTR): Remove definition.
7950 (safe_read): Don't use EINTR if it is absent.
7952 2002-12-02 Jim Meyering <jim@meyering.net>
7954 * safe-read.c (EINTR): Define.
7955 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7956 (INT_MAX): Provide fallback.
7957 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7959 * safe-read.h (SAFE_READ_ERROR): Define.
7961 2002-12-01 Jim Meyering <jim@meyering.net>
7963 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7964 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7966 2002-11-27 Paul Eggert <eggert@twinsun.com>
7968 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7969 hash_rehash): Replace `if (limit <= value) abort ();' with
7970 `if (! (value < limit)) abort ();', for readability.
7972 2002-11-26 <karl@gnu.org>
7974 * strdup.c: copy from libc again, with jim's ok.
7975 * .cppi-disable: re-add strdup.c
7977 2002-11-25 <karl@gnu.org>
7979 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7980 instead of "strtol.c".
7982 2002-11-25 Jim Meyering <jim@meyering.net>
7984 * mktime.c: Sync from libc, now that it has the latest fix.
7986 2002-11-24 <karl@gnu.org>
7988 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7989 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7991 2002-11-24 Jim Meyering <jim@meyering.net>
7993 Update from coreutils:
7995 * mktime.c: Merge in changes from libc.
7997 Avoid a link-time failure on some Linux systems.
7998 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7999 (__mon_yday): Declare with the STATIC attribute.
8000 (__mktime_internal): Likewise.
8001 Based on a report from Greg Schafer.
8003 2002-11-23 Jim Meyering <jim@meyering.net>
8005 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8006 Use `unsigned', not `int', as type of index.
8008 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8010 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8012 2002-11-22 Paul Eggert <eggert@twinsun.com>
8014 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8015 hint that one should use `if (! x) abort ();' rather than `assert
8016 (x);', and anyway it's one less thing to worry about configuring.
8017 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8018 hash_rehash, hash_insert): Use abort rather than assert.
8020 2002-11-22 Paul Eggert <eggert@twinsun.com>
8022 * quotearg.h: Allow multiple inclusion by surrounding with
8023 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8024 so that we can be included first.
8025 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8026 * quotearg.c: Include quotearg.h immediately after config.h.
8027 No need to include stddef.h or sys/types.h any more.
8028 Surround local include files with "", not "<>".
8029 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8030 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8031 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8032 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8033 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8034 (ISPRINT): Remove; no longer needed now that we assume C89.
8036 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8039 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8040 quotearg_char): Use SIZE_MAX rather than
8041 (size_t) -1 when we are talking about "infinity".
8043 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8045 2002-11-22 Bruno Haible <bruno@clisp.org>
8047 * safe-read.h: Assume C89. Add comments.
8048 (safe_read): Change return type to size_t.
8049 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8050 counts > SSIZE_MAX correctly.
8051 * safe-write.h: New file.
8052 * safe-write.c: New file.
8053 * full-read.h: New file.
8054 * full-read.c: New file.
8055 * full-write.h: Assume C89. Add comments.
8056 * full-write.c: Include safe-write.h.
8057 (full_write): Rewritten to use safe_write.
8058 Suggested by Jim Meyering and Paul Eggert.
8060 2002-11-21 Bruno Haible <bruno@clisp.org>
8062 Remove case insensitive option matching.
8063 * argmatch.h (argcasematch): Remove declaration.
8064 (ARGCASEMATCH): Remove macro.
8065 (__xargmatch_internal): Remove case_sensitive argument.
8066 (XARGMATCH): Update.
8067 (XARGCASEMATCH): Remove macro.
8068 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8069 case_sensitive argument.
8070 (argcasematch): Remove function.
8071 (__xargmatch_internal): Remove case_sensitive argument.
8072 (main): Use XARGMATCH instead of XARGCASEMATCH.
8074 * xmalloc.c: Change compile-time error message. Add comment about
8075 required autoconf version.
8077 2002-11-21 Jim Meyering <jim@meyering.net>
8079 * strdup.c (strdup): Tweak comment and initial #if/#include.
8081 Merge in changes from the coreutils.
8083 2002-09-25 Paul Eggert <eggert@twinsun.com>
8084 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8085 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8086 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8087 int. Work more efficiently if X is the same width as uintmax_t.
8088 Do not compare X to -1, to avoid bogus compiler warning.
8089 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8090 Don't assume that f_frsize and f_bsize are the same type.
8092 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8095 * makepath.c (make_path): Restore umask *before* creating the final
8097 (make_path): Minor reformatting.
8099 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8100 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8102 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8103 ones. At least on GNU/Linux systems, `auto' means something else.
8106 2002-11-20 Paul Eggert <eggert@twinsun.com>
8108 Merge argmatch cleanups from Bison. Assume C89.
8110 * argmatch.c: Include config.h here, not in argmatch.h.
8111 Include stdlib.h, for EXIT_FAILURE.
8112 Always include <string.h>, since we assume C89.
8113 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8114 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8115 Include <stddef.h> instead, since it's all we need for size_t.
8116 (PARAMS): Remove. All uses removed.
8117 (ARRAY_CARDINALITY): Do not bother to #undef.
8118 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8119 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8120 Remove unnecessary parentheses.
8121 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8122 Insert necessary parentheses.
8123 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8124 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8126 2002-11-19 Bruno Haible <bruno@clisp.org>
8128 * mbswidth.c: Include mbswidth.h right at the beginning.
8129 * mbswidth.h: Include <stddef.h>, for size_t.
8131 * mbswidth.h (PARAMS): Remove macro.
8132 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8133 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8135 * gcd.h (PARAMS): Remove macro.
8136 (gcd): Use ANSI C function declarations.
8137 * gcd.c (gcd): Likewise.
8139 2002-11-15 Bruno Haible <bruno@clisp.org>
8141 * strcspn.c: Include <stddef.h>.
8142 (strcspn): Use ANSI C function declaration. Change return type to
8144 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8145 (strpbrk): Use NULL.
8146 * strpbrk.h (PARAMS): Remove macro.
8147 (strpbrk): Use ANSI C function declaration.
8148 * strstr.c: Don't include <sys/types.h>.
8149 * strstr.h (PARAMS): Remove macro.
8150 (strstr): Use ANSI C function declarations.
8152 2002-11-06 Bruno Haible <bruno@clisp.org>
8154 * gcd.h (gcd): Change argument type to 'unsigned long'.
8155 * gcd.c (gcd): Likewise.
8157 2002-11-05 Bruno Haible <bruno@clisp.org>
8159 * gcd.h: New file, from gettext-0.11.5.
8160 * gcd.c: New file, from gettext-0.11.5.
8162 2002-11-05 Bruno Haible <bruno@clisp.org>
8164 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8165 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8166 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8167 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8169 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8170 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8172 * closeout.c: Include gettext.h instead of <libintl.h>.
8173 * human.c: Include gettext.h instead of <libintl.h>.
8174 * quotearg.c: Include gettext.h instead of <libintl.h>.
8175 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8176 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8177 * userspec.c: Include gettext.h instead of <libintl.h>.
8178 * version-etc.c: Include gettext.h instead of <libintl.h>.
8179 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8180 (textdomain): Remove definition.
8181 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8183 * long-options.c: Remove include of <libintl.h> and definition of _.
8184 * same.c: Remove include of <libintl.h> and definition of _.
8186 2002-11-04 Bruno Haible <bruno@clisp.org>
8188 * stpcpy.h: New file, from GNU gettext-0.11.5.
8189 * strcase.h: New file, from GNU gettext-0.11.5.
8190 * strpbrk.h: New file, from GNU gettext-0.11.5.
8191 * strstr.h: New file, from GNU gettext-0.11.5.
8192 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8194 2002-05-09 Bruno Haible <bruno@clisp.org>
8196 * config.charset: Update for newest glibc. Add canonical names
8197 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8199 2002-05-09 Bruno Haible <bruno@clisp.org>
8201 * localcharset.c (get_charset_aliases): Add more Windows specific
8204 2002-05-08 Owen Taylor <otaylor@redhat.com>
8206 * config.charset: A few additions for Solaris.
8208 2001-12-05 Bruno Haible <bruno@clisp.org>
8210 * localcharset.c (locale_charset): Don't return an empty string.
8212 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8214 * config.charset: msdos in uk_UA uses CP1125.
8216 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8218 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8219 * localcharset.c (locale_charset): Declare as extern "C".
8221 2002-02-15 Bruno Haible <bruno@clisp.org>
8223 * config.charset [msdosdjgpp]: For Russian, use CP866.
8225 2002-02-11 Bruno Haible <bruno@clisp.org>
8227 * config.charset: Add support for NetBSD.
8229 2002-09-25 <karl@gnu.org>
8231 * strdup.c: copy from libc/string (via ../config/srclist*).
8232 * getopt*: copy from libc/posix.
8233 * gettext.h: copy from gettext.
8234 * .cppi-disable: add strdup.c, gettext.h.
8236 2002-07-01 Jim Meyering <meyering@lucent.com>
8238 * c-stack.c: Include sys/time.h.
8239 From Volker Borchert.
8241 2002-06-11 Paul Eggert <eggert@twinsun.com>
8243 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8244 New macro. Use it uniformly instead of
8245 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8246 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8247 reported by Vin Shelton.
8249 2002-06-22 Jim Meyering <meyering@lucent.com>
8251 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8252 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8254 2002-06-22 Paul Eggert <eggert@twinsun.com>
8256 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8257 Do not assume SA_SIGINFO behavior.
8258 Bug reported by Jim Meyering on NetBSD 1.5.2.
8260 2002-06-22 Jim Meyering <meyering@lucent.com>
8262 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8264 * exitfail.c, exitfail.h: Likewise.
8265 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8267 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8269 (EXTRA_DIST): Add fnmatch_loop.c.
8270 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8272 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8273 * fnmatch.c: Update from diffutils-2.8.2.
8274 * fnmatch_.h: New file. From diffutils-2.8.2.
8275 * fnmatch.h: Remove file.
8277 2002-06-18 Paul Eggert <eggert@twinsun.com>
8279 * file-type.h: Report an error if neither S_ISREG nor
8280 S_IFREG is defined, instead of using a test specific to glibc
8281 2.2. This should be safe, since POSIX requires S_ISREG and
8282 Unix Version 7 had S_IFREG. We don't need to check for
8283 <sys/types.h> since we don't use any symbols that it defines.
8285 2002-06-15 Jim Meyering <meyering@lucent.com>
8287 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8288 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8289 have been included before this file.
8291 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8293 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8294 so that each temporary file name is unique and valid in the first
8295 8 characters, for operation under DOS.
8297 2002-06-15 Jim Meyering <meyering@lucent.com>
8299 Work even with DJGPP 2.03, which lacks support for symlinks.
8301 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8303 * lchown.c (S_ISLNK): Likewise.
8305 2002-06-14 Jim Meyering <meyering@lucent.com>
8307 * file-type.h: Use the version from diffutils-2.8.2.
8308 * file-type.c: Likewise.
8310 2002-05-27 Jim Meyering <meyering@lucent.com>
8312 Fix a problem seen only on nonconforming systems whereby ls.c's
8313 use of localtime, and then of gettimeofday would cause trouble:
8314 the localtime call used to initialize rpl_gettimeofday's save
8315 mechanism would clobber ls's current local time information so
8316 that in any long listing the first file would always be listed
8317 with date 1970-01-01. Analysis by Volker Borchert.
8319 * gettimeofday.c (localtime): Undefine.
8320 (rpl_localtime): New function.
8322 2002-05-22 Jim Meyering <meyering@lucent.com>
8324 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8325 * file-type.h: New file.
8326 * file-type.c (file_type): New file/function. Extracted from diffutils.
8328 2002-04-29 Paul Eggert <eggert@twinsun.com>
8330 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8332 2002-04-28 Paul Eggert <eggert@twinsun.com>
8334 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8335 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8336 of 127, since 64 is the largest conceivable number for ancient
8338 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8340 2002-04-28 Jim Meyering <meyering@lucent.com>
8342 * sig2str.c (WTERMSIG): Remove definition (unused).
8344 2002-04-28 Paul Eggert <eggert@twinsun.com>
8346 * sig2str.h, sig2str.c: New files.
8347 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8349 2002-04-24 Jim Meyering <meyering@lucent.com>
8351 * gettext.h: New file, from Gettext.
8352 * Makefile.am (INCLUDES): Remove -I../intl.
8353 (libfetish_a_SOURCES): Add gettext.h.
8355 2002-04-16 Jim Meyering <meyering@lucent.com>
8357 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8358 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8359 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8361 2002-04-12 Jim Meyering <meyering@lucent.com>
8363 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8365 2002-03-10 Jim Meyering <meyering@lucent.com>
8367 * makepath.c (make_path): Remove a comma from a diagnostic.
8368 Suggestion from Santiago Vila.
8370 2002-03-08 Jim Meyering <meyering@lucent.com>
8372 * rename.c: Mention that this wrapper is needed also on
8373 mips-dec-ultrix4.4 systems.
8375 2002-03-02 Jim Meyering <meyering@lucent.com>
8377 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8378 not HAVE_CLOCK_SETTIME.
8380 2002-02-27 Paul Eggert <eggert@twinsun.com>
8382 * nanosleep.h: Rename to....
8383 * timespec.h: New name for nanosleep.h. All uses changed.
8385 * gettime.c: New file.
8386 * settime.c: New file.
8389 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8390 timespec.h. Remove nanosleep.h.
8392 2002-02-25 Paul Eggert <eggert@twinsun.com>
8394 * acl.c, acl.h: New files.
8395 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8397 2002-02-24 Jim Meyering <meyering@lucent.com>
8399 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8400 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8401 cause trouble. Reported by Nelson Beebe.
8403 2002-02-23 Paul Eggert <eggert@twinsun.com>
8405 * path-concat.c (xpath_concat): Reorder code to pacify
8406 compilers that don't know that xalloc_die never returns.
8408 2002-02-20 Jim Meyering <meyering@lucent.com>
8410 * getdate.c: Regenerate using bison-1.33.
8412 2002-02-15 Paul Eggert <eggert@twinsun.com>
8414 * posixver.c, posixver.h: New files.
8415 * Makefile.am (libfetish_a_SOURCES): Add them.
8417 2002-02-02 Paul Eggert <eggert@twinsun.com>
8418 Bruno Haible <bruno@clisp.org>
8420 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8421 (fwrite_success_callback): New declaration.
8422 * unicodeio.c (unicode_to_mb): New function, extracted from
8423 print_unicode_char. Call failure callback instead of error.
8424 (fwrite_success_callback): New function.
8425 (exit_failure_callback): New function.
8426 (fallback_failure_callback): New function.
8427 (print_unicode_char): Call unicode_to_mb.
8429 2002-01-26 Jim Meyering <meyering@lucent.com>
8431 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8433 2002-01-22 Jim Meyering <meyering@lucent.com>
8435 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8436 Otherwise, some versions of automake would omit the rule that makes
8437 Makefile from Makefile.in.
8439 2001-01-21 Paul Eggert <eggert@twinsun.com>
8441 * xmemcoll.h, xmemcoll.c: New files.
8442 * Makefile.am (libfetish_a_SOURCES): Add them.
8443 * memcoll.c: Include errno.h, and declare errno if not defined.
8444 (memcoll): Set errno to zero if there is no error.
8446 * quotearg.c (quotearg_buffer_restyled):
8447 Fix bug with quoting buffers containing NUL when backslashing escapes.
8448 This bug was exposed by the other changes in this patch.
8449 (quotearg_n_options): New arg ARGSIZE.
8450 All callers changed.
8451 (quoting_options_from_style): New function.
8452 (quotearg_n_style): Use it.
8453 (quotearg_n_style_mem): New function.
8455 * quotearg.h (quotearg_n_style_mem): New function.
8457 2002-01-16 Jim Meyering <meyering@lucent.com>
8459 * getdate.y: Add three semicolons, each just before a closing brace.
8460 Bison (as of version 1.31) no longer papers over that mistake.
8462 2002-02-14 Paul Eggert <eggert@twinsun.com>
8464 * backupfile.c (ISDIGIT): Comment fix.
8465 * getdate.y (ISDIGIT): Likewise.
8466 * posixtm.c (ISDIGIT, year): Likewise.
8467 * strverscmp.c (ISDIGIT): Likewise.
8468 * userspec.c (ISDIGIT): Likewise.
8470 2002-01-05 Jim Meyering <meyering@lucent.com>
8472 * version-etc.c (version_etc_copyright): Update copyright year.
8474 2001-01-19 Paul Eggert <eggert@twinsun.com>
8476 * closeout.c (close_stdout_status): If ferror (stdout), do
8477 not silently exit merely because the output buffer happens to
8478 have nothing pending.
8480 2001-12-18 Paul Eggert <eggert@twinsun.com>
8482 See the big note in ../ChangeLog.
8483 * human.c (suffixes): Prefer K to k for 1024.
8484 (generate_suffix_backwards): New function.
8485 (human_readable_inexact): Use it.
8486 * xstrtol.c (__xstrtol): If there is no number but there
8487 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
8488 Accept 'K' as well as 'k'.
8490 2001-12-15 Jim Meyering <meyering@lucent.com>
8492 * regex.h (__restrict_arr): Update from libc.
8494 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8495 as `remote' if the name starts with `//'. Suggested by Michael Stone.
8498 2001-12-10 Jim Meyering <meyering@lucent.com>
8500 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8501 Instead, include "xalloc.h".
8502 (initbuffer): Don't cast xmalloc return value to char*.
8503 (readline): Reword comment.
8504 Don't cast xrealloc return value to char*
8507 2001-12-09 Jim Meyering <meyering@lucent.com>
8509 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8510 `signed and unsigned type in conditional expression'.
8511 * posixtm.c (posix_time_parse): Likewise.
8513 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8515 * readtokens.c (readtoken): Declare an index to be of type unsigned
8516 to avoid a pedantic warning.
8518 * getstr.c: Don't include assert.h.
8519 (getstr): Remove warning-evoking assertions.
8520 Return -1 if offset parameter is out of bounds.
8521 Change the type of a local from int to size_t.
8523 * strftime.c (my_strftime_localtime_r): Include this function
8524 definition in the `#if ! HAVE_TM_GMTOFF' block.
8526 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8527 Include xalloc.h instead.
8529 2001-12-02 Jim Meyering <meyering@lucent.com>
8531 * tempname.c: Don't declare getenv, thus reverting the change of
8532 2001-11-18. It's no longer necessary, now that stdlib.h is always
8535 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8536 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
8538 2001-11-30 Akim Demaille <akim@epita.fr>
8540 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8541 before being defined.
8543 2001-11-27 Paul Eggert <eggert@twinsun.com>
8545 * quotearg.h (quotearg_n, quotearg_n_style):
8546 First arg is int, not unsigned.
8547 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8548 (SIZE_MAX, UINT_MAX): New macros.
8549 (quotearg_n_options): Abort if N is negative.
8550 Avoid overflow check on hosts where size_t is 64 bits and int
8551 is 32 bits, as overflow is impossible there.
8552 Fix off-by-one typo that caused unnecessary reallocation.
8554 2001-11-27 Jim Meyering <meyering@lucent.com>
8556 * tempname.c: Merge with version from libc.
8557 * regex.c: Likewise.
8559 * tempname.c: Include stdlib.h unconditionally. On some old systems
8560 for which STDC_HEADERS is 0, it was not included, resulting in a
8561 warning about an integer-to-pointer conversion problem with getenv.
8562 Reported by Volker Borchert.
8564 2001-11-26 Jim Meyering <meyering@lucent.com>
8566 * gtod.h: Remove file.
8567 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8568 * gettimeofday.c: Don't include gtod.h.
8569 (GTOD_init): Remove function.
8570 (rpl_gettimeofday): Do its job here instead, rather than aborting.
8571 Suggestion from Volker Borchert.
8573 2001-11-23 Jim Meyering <meyering@lucent.com>
8575 * hash.h (struct hash_table): Don't define here. Merely declare it.
8576 * hash.c (struct hash_table): Define it here instead.
8578 2001-11-22 Jim Meyering <meyering@lucent.com>
8580 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8582 2001-11-18 Paul Eggert <eggert@twinsun.com>
8584 * tempname.c (TMP_MAX): Remove; no longer needed.
8585 (TEMPORARIES): New macro.
8586 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
8587 removes an artificial limitation (e.g. HP-UX 10.20, where
8590 2001-11-18 Jim Meyering <meyering@lucent.com>
8592 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8595 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8596 files will be created before anything else.
8598 2001-11-17 Jim Meyering <meyering@lucent.com>
8600 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8601 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8602 rather than group writable. Patch by Juan F. Codagnone.
8604 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8605 Instead, include "xalloc.h".
8607 * mountlist.c: Include unlocked-io.h after all system headers.
8608 Remove explicit declarations of xmalloc, xrealloc,
8609 and xstrdup. Instead, include "xalloc.h".
8611 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8612 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8613 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8615 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8616 Reported by Padraig Brady.
8618 * mkstemp.c: #undef mkstemp.
8620 (rpl_mkstemp): Rename from mkstemp.
8623 2001-11-16 Jim Meyering <meyering@lucent.com>
8625 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8626 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8627 determine the amount of total physical memory, use pstat_getstatic.
8628 HPUX-11 doesn't define _SC_PHYS_PAGES.
8629 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8630 If sysconf couldn't be used to determine the amount of available
8631 physical memory, use both pstat_getstatic and pstat_getdynamic.
8632 Based on a patch from Bob Proulx.
8634 2001-11-05 Jim Meyering <meyering@lucent.com>
8636 * xstat.in (slash_aware_lstat): Correct a misleading comment.
8638 2001-11-03 Jim Meyering <meyering@lucent.com>
8640 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8641 in argmatch_to_argument call.
8643 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8646 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8647 e.g., a fault due to an attempt to free a NULL pointer.
8649 2001-11-01 Jim Meyering <meyering@lucent.com>
8651 * dirfd.c, dirfd.h: New files.
8652 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8654 * hash.c (hash_print) [TESTING]: Clean up.
8656 2001-10-22 Paul Eggert <eggert@twinsun.com>
8658 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8659 to avoid a warning if -Wall.
8661 2001-10-21 Paul Eggert <eggert@twinsun.com>
8663 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8665 2001-10-21 Jim Meyering <meyering@lucent.com>
8667 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
8668 this code would end up calling gettext even in packages built
8670 * getopt.c (_): Likewise.
8671 * regex.c (_): Likewise.
8673 2001-10-20 Paul Eggert <eggert@twinsun.com>
8675 * error.c (strerror_r): Do not declare unless !_LIBC.
8676 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8677 Use strerror_r that is only a macro, even if it is not a function.
8678 (strerror): Check for HAVE_DECL_STRERROR before declaring.
8679 (private_strerror): Use prototypes, not old-style function definition.
8680 (print_errno_message): New function.
8681 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8683 (error_tail, error, error_at_line): Use it.
8685 2001-10-11 Jim Meyering <meyering@lucent.com>
8687 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8688 and quote_n (1, ... to avoid clobbering a buffer.
8690 2001-10-05 Jim Meyering <meyering@lucent.com>
8692 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8693 * hash-pjw.c: New file (factored out of fileutils' remove.c).
8694 * hash-pjw.h: New file.
8696 2001-09-30 Jim Meyering <meyering@lucent.com>
8698 * mountlist.c [MOUNTED_GETFSSTAT]:
8699 Include <sys/ucred.h>, for Apple Darwin.
8700 Include sys/mount.h and sys/fs_types.h only if available.
8702 (read_filesystem_list): Use FS_TYPE.
8704 2001-09-29 Paul Eggert <eggert@twinsun.com>
8706 * exclude.c (excluded_filename): 0 -> false, since it's
8709 2001-09-28 Paul Eggert <eggert@twinsun.com>
8711 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8712 #defines strtoimax. Also treat the other strto* functions
8715 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8716 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8717 (strtoimax, strtoumax): Do not declare if already defined as a macro.
8719 2001-09-26 Jim Meyering <meyering@lucent.com>
8721 Most macros in unlocked-io.h had the wrong number of arguments.
8722 * gen-uio: New script.
8723 (USE_UNLOCKED_IO): Define to 1 if not already defined.
8724 * unlocked-io.hin: Remove file.
8725 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8726 rather than trying to embed it here.
8727 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
8728 Reported by Padraig Brady.
8730 2001-09-25 Volker Borchert <bt@teknon.de>
8732 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8734 2001-09-23 Jim Meyering <meyering@lucent.com>
8736 * mountlist.c: Remove useless parentheses in #if directives.
8737 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8738 the deprecated MOUNTED symbol is no longer defined in mntent.h.
8740 2001-09-22 Jim Meyering <meyering@lucent.com>
8742 * localcharset.c: Update from latest gettext.
8743 * config.charset: Likewise.
8745 2001-09-20 Jim Meyering <meyering@lucent.com>
8747 * xstrtol.c (strtoimax): Guard declaration with
8748 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8749 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8750 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8751 (strtoumax): Likewise, for completeness (it wasn't necessary).
8753 2001-09-06 Paul Eggert <eggert@twinsun.com>
8755 * strtoimax.c (HAVE_LONG_LONG):
8756 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8757 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8758 to work around bug in IBM C compiler.
8760 2001-09-16 Jim Meyering <meyering@lucent.com>
8762 * mkdir.c: New file.
8764 2001-09-04 Paul Eggert <eggert@twinsun.com>
8766 * xgetcwd.c: Revert some of the previous change; intead,
8767 fix the HAVE_GETCWD_NULL code to behave more like the
8768 !HAVE_GETCWD_NULL code used to.
8771 (xgetcwd): Do not return NULL when memory is exhausted; instead,
8774 2001-09-04 Paul Eggert <eggert@twinsun.com>
8776 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
8777 Use ssize_t, not int, to store result of readlink.
8778 Check for ssize_t overflow as well as size_t overflow,
8779 as POSIX says the result of readlink is implementation-defined
8780 when ssize_t overflows.
8781 Remove unnecessary cast to char*.
8782 Use free+malloc instead of realloc, as the storage doesn't need
8783 to be preserved and it's clearer and can be more efficient that way.
8784 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8785 * xreadlink.h (xreadlink): Update prototype.
8787 2001-09-03 Paul Eggert <eggert@twinsun.com>
8789 * exclude.c (fnmatch_no_wildcards): Fix confusion between
8790 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
8791 spotted by Jim Meyering.
8793 2001-09-03 Jim Meyering <meyering@lucent.com>
8795 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8797 2001-09-03 Paul Eggert <eggert@twinsun.com>
8799 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8800 like the HAVE_GETCWD_NULL code.
8801 Include pathmax.h if not HAVE_GETCWD.
8802 Do not include xalloc.h.
8803 (INITIAL_BUFFER_SIZE): New symbol.
8804 Do not use xmalloc / xrealloc, since the caller is responsible for
8805 handling errors. Preserve errno around `free' during failure.
8806 Do not overrun buffer when using getwd.
8808 2001-09-03 Paul Eggert <eggert@twinsun.com>
8810 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8811 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8813 2001-09-02 Jim Meyering <meyering@lucent.com>
8815 * error.c: Update from GNU libc.
8817 2001-09-01 Jim Meyering <meyering@lucent.com>
8819 * xreadlink.c: New file.
8820 * xreadlink.h: New file.
8821 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8823 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8824 doesn't conflict with sparc Solaris 7's definition in
8825 /usr/include/sys/int_types.h.
8827 * exclude.c: Use `""', not `<>' to #include non-system header files.
8828 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8829 and strncasecmp as r-values. Unixware didn't have declarations.
8831 2001-08-31 Jim Meyering <meyering@lucent.com>
8833 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8834 Use an initial, malloc'd, buffer of length 128 rather than
8835 a statically allocated one of length 1024.
8837 2001-08-30 Paul Eggert <eggert@twinsun.com>
8839 * xgetcwd.c: Don't include pathmax.h.
8840 Include stdlib.h and unistd.h if available.
8842 (xmalloc, xstrdup, free): Remove decls.
8843 (xgetcwd): Don't assume sizes fit in unsigned.
8844 Check for overflow when computing sizes.
8845 Simplify reallocation code.
8847 2001-08-28 Paul Eggert <eggert@twinsun.com>
8849 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8851 * strtoimax.c: Renamed from strtoxmax.c, removing the
8854 Also, make the following further changes to make this file's
8855 configuration more similar to that of strtol.c:
8856 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
8857 (strtoumax, uintmax_t, strtoull, strtol): Remove.
8858 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8859 (strtoimax): Renamed from strtoumax. All uses of unsigned values
8860 changed to signed values.
8862 And make the following changes as well:
8863 Fix copyright notice, as 1999 was missing.
8864 (verify): New macro.
8865 (strtoimax): Check sizes at compile-time, not run-time.
8866 Prefer strtol to strtoll if both work.
8867 (main): Remove; it was not that useful and was a pain to maintain.
8869 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8871 2001-08-30 Paul Eggert <eggert@twinsun.com>
8873 * savedir.c (savedir): Remove size parameter, as POSIX says that
8874 a directory's st_size can have an arbitrary value, so the old
8875 usage could waste an arbitrary amount of memory. All uses
8877 * savedir.h: Update prototype.
8879 2001-08-30 Paul Eggert <eggert@twinsun.com>
8881 * xstrtol.c (strtoimax): New decl.
8883 2001-08-28 Paul Eggert <eggert@twinsun.com>
8885 * xstrtol.h: Add copyright notice.
8886 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8887 LONGINT_INVALID_SUFFIX_CHAR.
8889 2001-08-30 Paul Eggert <eggert@twinsun.com>
8891 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8894 2001-08-30 Paul Eggert <eggert@twinsun.com>
8896 * hash.c: Remove '2001' from copyright notice.
8898 2001-08-30 Paul Eggert <eggert@twinsun.com>
8900 * full-write.h: New file.
8901 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8902 * full-write.c: Correct credits, as cccp.c no longer
8903 exists and anyway it was so heavily changed from the old cccp
8904 code as to be unrecognizable. Include full-write.h.
8905 (full_write) Return size_t, with short writes meaning failure.
8906 All callers changed. This fixes a bug with large buffers
8908 * utime.c: Include full-write.h.
8910 2001-08-30 Paul Eggert <eggert@twinsun.com>
8912 Merge 'exclude' changes from tar 1.13.22.
8913 This fixes one or two unlikely storage allocation overflow bugs,
8914 but doesn't change user-visible behavior otherwise.
8916 2001-08-30 Paul Eggert <eggert@twinsun.com>
8918 * exclude.c (bool): Declare, perhaps by including stdbool.h.
8919 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8920 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8921 Include if available.
8922 (<xalloc.h>): Include
8923 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8924 (verify): New macro. Use it to verify that EXCLUDE macros do not
8925 collide with FNM macros.
8926 (struct patopts): New struct.
8927 (struct exclude): Use it, as exclude patterns now come with options.
8928 (new_exclude): Support above changes.
8929 (new_exclude, add_exclude_file):
8930 Initial size must now be a power of two to simplify overflow checking.
8931 (free_exclude, fnmatch_no_wildcards): New function.
8932 (excluded_filename): No longer requires options arg, as the options
8933 are determined by add_exclude. Now returns bool, not int.
8934 (excluded_filename, add_exclude):
8935 Add support for the fancy new exclusion options.
8936 (add_exclude, add_exclude_file): Now takes int options arg.
8937 Check for arithmetic overflow when computing sizes.
8938 (add_exclude_file): xrealloc might modify errno, so don't
8939 realloc until after errno might be used.
8941 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8943 (free_exclude): New decl.
8944 (add_exclude, add_exclude_file): Now takes int options arg.
8945 (excluded_filename): No longer requires options arg, as the options
8946 are determined by add_exclude. Now returns bool, not int.
8948 2001-08-30 Paul Eggert <eggert@twinsun.com>
8950 * alloca.c (alloca): Arg is of type size_t, not unsigned.
8952 2001-08-27 Jim Meyering <meyering@lucent.com>
8954 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8956 * version-etc.c (N_): Remove definition.
8957 Revert most of last change.
8958 Instead, simply don't mark the `Copyright...' string for translation.
8959 Based on advice from Paul Eggert.
8961 * strtoxmax.c: Tweak comment.
8963 2001-08-26 Jim Meyering <meyering@lucent.com>
8965 * version-etc.c (version_etc_copyright_fmt): Replace literal year
8966 of copyright with `%s' so translators don't get an untranslated
8968 (COPYRIGHT_YEAR): Define.
8969 (version_etc): Use fprintf rather than fputs.
8970 Suggestion from Ulrich Drepper.
8972 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8974 * strtoll.c: New file, from GNU libc.
8975 * xstrtoimax.c: New file.
8977 * xstrtol.h: Add xstrtoimax.
8978 * strtoumax.c: New file. Simply include "strtoumax.c".
8979 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
8981 * strtoumax.c: Factor to work both for unsigned and signed types, ...
8982 * strtoxmax.c: ... then renamed to this.
8984 2001-08-13 Paul Eggert <eggert@twinsun.com>
8986 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8987 Port to Solaris 8, where 'sed' requires a space after the 'r'
8988 command, and where sh dislikes "$/". Clean up the spacing a bit.
8989 Redirect output to $tmp just once.
8991 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
8993 * addext.c (<errno.h>): Include.
8994 (errno): Declare if not defined.
8995 (addext): Work correctly when pathconf returns -1 and leaves
8996 errno alone because there is no limit. Also, work even if
8997 pathconf returns a value greater than SIZE_MAX.
8999 2001-08-12 Jim Meyering <meyering@lucent.com>
9001 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9002 Simply `return getcwd (NULL, 0);'.
9003 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9004 Use 1300 as initial value for length, not PATH_MAX.
9006 * pathmax.h: Clean up cpp syntax.
9008 2001-08-12 Jim Meyering <meyering@lucent.com>
9010 * gettimeofday.c: New file.
9012 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9014 2001-08-04 Jim Meyering <meyering@lucent.com>
9016 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9017 to get in sync with glibc.
9019 2001-08-03 Paul Eggert <eggert@twinsun.com>
9021 The following changes are from gettext 0.10.39 as maintained by
9024 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9025 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9026 with inverted sense. All uses changed.
9028 * mbswidth.c: Don't include <limits.h>.
9029 Include <stdlib.h> and <string.h> unconditionally.
9030 (iswcntrl, mbsinit, ISCNTRL): New macros.
9031 (mbsnwidth): Use K&R style function declarations.
9032 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9033 can optimize it when MB_CUR_MAX == 1.
9034 The width of control characters is zero, not 1.
9036 2001-07-15 Jim Meyering <meyering@lucent.com>
9038 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9039 (BUILT_SOURCES): Add unlocked-io.h.
9040 (io_functions): Define.
9041 (unlocked-io.h): New rule.
9042 (DISTCLEANFILES): Add unlocked-io.h.
9043 (all-local): Depend on unlocked-io.h, to ensure it is created.
9045 * unlocked-io.hin: New file
9047 * regex.c: Update from glibc.
9049 2001-07-05 Jim Meyering <meyering@lucent.com>
9051 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9053 (libfetish_a_SOURCES): Put all .h files here instead.
9054 Remove a thus-exposed (better checks in automake) duplicate and
9055 two unnecessary .h files.
9057 2001-06-11 Jim Meyering <meyering@lucent.com>
9059 * regex.c: Update from GNU libc.
9061 2001-05-27 Jim Meyering <meyering@lucent.com>
9063 * readutmp.h (UT_TYPE): Define.
9065 2001-05-24 Jim Meyering <meyering@lucent.com>
9067 * argmatch.c: Include "quote.h".
9068 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9069 quote function. Reported by Göran Uddeborg.
9071 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9073 * dirname.c (dir_name): Compute append_dot using path, not newpath
9074 which is not yet declared.
9076 2001-05-11 Paul Eggert <eggert@twinsun.com>
9078 * Makefile.am (libfetish_a_SOURCES):
9079 Add strftime.c, since we now compile it on all hosts.
9081 * strftime.c (my_strftime):
9082 Define to nstrftime if emacs, but only if my_strftime is not defined.
9083 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9084 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9085 Add one more extra argument: a nanoseconds value.
9088 (my_strftime function): Add %N format.
9089 (emacs_strftimeu): Renamed from emacs_strftime,
9090 with extra ut argument.
9092 2001-05-11 Paul Eggert <eggert@twinsun.com>
9094 dirname code cleanup. base_name now behaves more compatibly
9095 with POSIX basename when given file names that have trailing
9096 slashes, and similarly for dir_name. Add new primitives
9097 base_len and dir_len. Put the directory-name-related decls
9100 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9101 * backupfile.c (base_name): Likewise.
9102 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9103 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9104 * makepath.c (strip_trailing_slashes): Likewise.
9105 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9107 * rename.c (strip_trailing_slashes): Likewise.
9108 * same.c (base_name): Likewise.
9109 * stripslash.c (ISSLASH): Likewise.
9111 * addext.c: Include <dirname.h> after size_t is defined.
9112 * backupfile.c: Likewise.
9114 * addext.c (addext): Use base_len to trim redundant
9115 trailing slashes instead of doing it ourselves.
9116 But do not trim the last slash if it is not redundant.
9118 * backupfile.c (find_backup_file_name,
9119 max_backup_version): Use base_len instead of rolling it ourselves.
9120 Handle the case of "" and (on DOS) "C:" correctly.
9122 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9123 Include <string.h>, <dirname.h>.
9124 (base_name): Allow file names ending in slashes, other than names
9125 that are all slashes. In this case, return the basename followed
9126 by the slashes. This is more general, and can be used in places
9127 where the original base_name purposely had an assertion failure.
9128 (base_len): New function.
9130 * dirname.c: Include <string.h> instead of <stdlib.h>.
9131 Do not include <assert.h>; no longer needed.
9133 (memrchr): Remove decl.
9134 (dir_name_r): Remove.
9135 (dir_len): Renamed from dirlen. All callers changed.
9136 Rewrite in terms of base_name, for simplicity and consistency.
9137 (dir_name): Never return NULL. All callers changed.
9138 Do not include <stdlib.h> in test program; no longer needed.
9139 return 0; is fine for test program.
9141 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9143 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9145 * path-concat.c (path_concat): Use base_len to compute
9146 base length, not strlen; this means we cannot rely on memcpy
9149 * same.c (STREQ): Remove.
9150 (same_name): Handle the case where the basename ends in trailing '/'.
9152 * stripslash.c (strip_trailing_slashes): Return nonzero if
9153 a slash was stripped. Do not strip the last slash after a
9156 2001-04-08 Jim Meyering <meyering@lucent.com>
9158 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9159 recomputed; that's necessary when the offset spans a DST transition.
9160 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9162 2001-04-02 Jim Meyering <meyering@lucent.com>
9164 * regex.h, regex.c: Update from GNU libc.
9166 2001-03-19 Paul Eggert <eggert@twinsun.com>
9168 * version-etc.c (version_etc_copyright): Update to 2001.
9170 2001-03-16 Paul Eggert <eggert@twinsun.com>
9172 * tempname.c (uint64_t): Define to uintmax_t if
9173 not defined, and if UINT64_MAX is not defined.
9174 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9175 Reported by John David Anglin.
9177 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9179 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9180 alias if codeset is empty.
9181 * config.charset (BeOS): Use wildcard syntax.
9183 2001-03-13 Jim Meyering <meyering@lucent.com>
9185 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9186 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9189 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9191 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9193 * unicodeio.c (print_unicode_char): Simplify accordingly.
9195 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9197 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9198 support for DOS/DJGPP.
9200 2001-02-28 Paul Eggert <eggert@twinsun.com>
9202 * Makefile.am (libfetish_a_SOURCES):
9203 Add dup-safer.c, fopen-safer.c.
9204 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9206 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9208 2001-02-25 Paul Eggert <eggert@twinsun.com>
9210 The mkstemp replacement is taken from glibc 2.2.2, with some
9211 portability fixes for use outside glibc, as follows:
9213 * tempname.c (struct_stat64): New macro.
9214 (direxists, __gen_tempname): Use it.
9215 This avoids a portability problem with Solaris 8.
9217 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9218 (<stddef.h>, <stdint.h>, <string.h>):
9219 Include only if STDC_HEADERS || _LIBC.
9220 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9221 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9222 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9223 (__set_errno): Define this macro if <errno.h> doesn't.
9224 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9225 Define these macros if <stdio.h> doesn't.
9226 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9227 Define these macros if <sys/stat.h>
9228 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9229 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9230 __xstat64): Define if not _LIBC.
9231 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9232 (__gen_tempname): Invoke gettimeofday only if
9233 HAVE_GETTIMEOFDAY || _LIBC;
9234 otherwise, fall back on plain "time".
9235 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9237 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9239 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9241 2001-02-17 Jim Meyering <meyering@lucent.com>
9243 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9244 around included file name.
9246 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9248 * strftime.c: Update from GNU libc (the only changes were to comments).
9250 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9252 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9254 2001-02-17 Paul Eggert <eggert@twinsun.com>
9256 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9257 Remove workaround macros for hosts that have mbrtowc but not
9258 mbstate_t, as we now insist on proper declarations for both
9259 before using mbrtowc.
9261 2001-02-17 Jim Meyering <meyering@lucent.com>
9263 * regex.c: Update from libc.
9265 2001-02-16 Paul Eggert <eggert@twinsun.com>
9267 * alloca.c (malloc): Undef before defining, since stdlib.h
9268 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9269 Reported by Mark Hounschell via Paul Eggert.
9271 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9273 * config.charset: Update for FreeBSD 4.2.
9275 2001-01-26 Jim Meyering <meyering@lucent.com>
9277 * quotearg.c: Include stddef.h.
9278 * quote.c: Include stddef.h.
9279 Reported by Axel Kittenberger.
9281 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9282 line in double quotes so that it evokes a better diagnostic.
9283 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9284 Reported by Axel Kittenberger.
9286 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9288 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9289 to avoid a warning. Add back 'const' to inptr.
9291 2001-01-16 Jim Meyering <meyering@lucent.com>
9293 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9296 2001-01-14 Jim Meyering <meyering@lucent.com>
9298 * rename.c: New file. From Volker Borchert.
9299 Include stdlib.h, string.h or strings.h, and xalloc.h.
9300 Use strip_trailing_slashes rather than open-coding it.
9302 2001-01-03 Paul Eggert <eggert@twinsun.com>
9304 * strftime.c: Sync with glibc time/strftime.c 1.81.
9306 2001-01-03 Jim Meyering <meyering@lucent.com>
9308 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9309 local `inptr' to avoid warning with some system declarations of iconv.
9311 2000-12-29 Paul Eggert <eggert@twinsun.com>
9313 * modechange.c: Do not assume that mode_t uses the
9314 traditional octal encoding. E.g. "chmod 1 FOO" should set
9315 the other-execute bit of FOO even if S_IXOTH != 1.
9317 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9318 WOTH, XOTH, ALLM): New macros.
9319 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9320 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9322 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9323 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9325 No need to use uintmax_t; unsigned long is long enough.
9326 Don't bother to get suffix since we don't use it.
9328 2000-12-24 Jim Meyering <meyering@lucent.com>
9330 * hash.c (is_prime): Return explicit boolean values.
9331 (hash_get_first): Return NULL to appease Irix5.6's 89.
9332 Reported by Nelson Beebe.
9334 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9336 * localcharset.c (locale_charset): Add support for Win32.
9338 2000-12-18 Paul Eggert <eggert@twinsun.com>
9340 * physmem.h, physmem.c: New files.
9342 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9343 (noinst_HEADERS): Add physmem.h.
9345 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9346 't' for compatibility with Solaris 8 sort.
9348 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9350 * config.charset: Add support for BeOS.
9352 2000-12-16 Jim Meyering <meyering@lucent.com>
9354 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9355 SHELLS_FILE to a file name that's useful on djgpp systems.
9357 (ADDITIONAL_DEFAULT_SHELLS): Define.
9358 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9359 Based mostly on a patch from Prashant TR.
9361 2000-12-16 Jim Meyering <meyering@lucent.com>
9363 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9364 N and M) would have treated it like `chown N:N FILE'.
9366 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9368 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9370 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9371 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9372 to the list of canonical encodings. Rename EUC-CN to GB2312.
9374 2000-12-08 Andreas Schwab <schwab@suse.de>
9376 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9377 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9379 2000-12-07 Jim Meyering <meyering@lucent.com>
9381 * stripslash.c (ISSLASH): Define.
9382 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9385 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9386 (dir_name_r): Declare this function as static.
9387 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9388 manifest itself on a name containing a mix of slashes and
9390 Make this function work with names starting with a DOS-style
9391 drive letter and colon prefix.
9392 (dir_name): Append `.' if necessary.
9393 Based mostly on patches from Prashant TR and Eli Zaretskii.
9395 * dirname.h (dir_name_r): Remove prototype.
9397 2000-12-05 Jim Meyering <meyering@lucent.com>
9399 * dirname.c (dir_name_r): Add `const' in a few local declarations.
9401 2000-12-04 Jim Meyering <meyering@lucent.com>
9403 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9404 Also include memory.h, stdlib.h, unistd.h if appropriate.
9405 Reported by Andreas Jaeger (conflicting declaration of malloc).
9407 2000-12-02 Jim Meyering <meyering@lucent.com>
9409 * closeout.h: Make idempotent, to avoid some obscure warnings.
9411 2000-12-01 Paul Eggert <eggert@twinsun.com>
9413 * memrchr.c: Include <config.h> before any system include file.
9415 2000-11-29 Paul Eggert <eggert@twinsun.com>
9417 * dirname.c (dir_name_r): Fix typo: int -> size_t.
9419 2000-11-26 Jim Meyering <meyering@lucent.com>
9421 * memcoll.c: Include sys/types.h. From Werner Almesberger.
9423 2000-11-22 Paul Eggert <eggert@twinsun.com>
9425 * strftime.c (my_strftime): Do not invoke mbrlen with a
9426 size of (size_t) -1; it's not portable.
9428 2000-11-17 Akim Demaille <akim@epita.fr>
9430 * obstack.h: Formatting changes.
9431 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9432 prevent type checking.
9433 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9434 cast the value to (void *): assigning a `foo *' to a `void *'
9436 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9438 2000-11-17 Jim Meyering <meyering@lucent.com>
9440 * strstr.c: Update from GNU libc.
9442 2000-11-16 Jim Meyering <meyering@lucent.com>
9444 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9446 2000-11-11 Jim Meyering <meyering@lucent.com>
9448 * error.c: Add a couple #includes, merging from GNU libc version.
9450 2000-11-10 Jim Meyering <meyering@lucent.com>
9452 * obstack.h: Update from GNU libc.
9453 * obstack.c: Likewise.
9455 2000-11-06 Paul Eggert <eggert@twinsun.com>
9457 * getusershell.c (setusershell): Use rewind rather than
9458 fseek/fseeko, to avoid configuration hassles with fseeko.
9459 Don't bother opening SHELLS_FILE if shellstream is NULL;
9462 2000-11-05 Jim Meyering <meyering@lucent.com>
9464 * makepath.h (make_dir): Declare.
9465 * makepath.c (make_dir): Remove `static' attribute.
9468 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
9470 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
9471 last one in a bucket, advance to the next bucket.
9473 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
9475 * fnmatch.c: Do not comment out all the code if we are using
9476 the GNU C library, because in some cases we are replacing buggy
9477 code in the GNU C library itself.
9479 2000-10-30 Paul Eggert <eggert@twinsun.com>
9481 * error.h, getline.h, modechange.h:
9482 Remove "2000" from Copyright line, as the file hasn't been
9483 changed this year other than in the copyright notice.
9485 * xalloc.h: Add "2000" to Copyright line, as this file
9486 was changed this year.
9488 2000-10-30 Paul Eggert <eggert@twinsun.com>
9490 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9491 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9492 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9494 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
9496 * regex.h (__restrict_arr): Move definition out of #ifndef block.
9497 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9498 doesn't define __restrict_arr.
9500 2000-10-29 Jim Meyering <meyering@lucent.com>
9502 * xstat.in: Fix grammar in comment.
9504 2000-10-28 Jim Meyering <meyering@lucent.com>
9506 * memchr.c: Update from libc.
9507 Adjust for portability:
9508 [HAVE_STDLIB_H]: Include stdlib.h.
9509 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9510 Undef __memchr, too.
9511 [!weak_alias]: Define __memchr to memchr.
9513 * regex.c: Update from libc.
9514 * regex.h: Likewise.
9515 * getopt1.c: Likewise.
9516 * memcmp.c: Likewise.
9518 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9519 Avoid using fseek, when possible -- it's broken by design.
9520 Patch by Ulrich Drepper.
9522 2000-10-26 Jim Meyering <meyering@lucent.com>
9524 * strftime.c: Update from libc.
9526 2000-10-25 Jim Meyering <meyering@lucent.com>
9528 * obstack.c: Update from libc.
9530 2000-10-23 Jim Meyering <meyering@lucent.com>
9532 * hard-locale.c (hard_locale): Revert last change -- it was simply
9533 wrong. That set_locale call must not have any side effects.
9536 2000-10-22 Jim Meyering <meyering@lucent.com>
9538 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9539 [CYCLIC]: Remove now-unused definition.
9541 * save-cwd.c (O_DIRECTORY): Define, if needed.
9542 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9543 Suggestion from Ulrich Drepper.
9545 2000-10-21 Jim Meyering <meyering@lucent.com>
9547 * dirname.c (dir_name_r): New function, factored out of dir_name.
9548 (dir_name): Use dir_name_r.
9549 * dirname.h (dir_name_r): Declare it.
9551 2000-10-21 Jim Meyering <meyering@lucent.com>
9553 * dirname.c (memrchr): Declare if necessary.
9554 (dir_name): Remove the restriction that there be no
9555 trailing slashes. Now, this code skips past them, effectively
9557 [TEST_DIRNAME] (main): New unit tests.
9559 * memrchr.c: New file from GNU libc.
9560 Undef __memrchr, too.
9561 [!weak_alias]: Define __memrchr to memrchr.
9562 Guard weak_alias use with `#ifdef weak_alias'.
9564 2000-10-17 Jim Meyering <meyering@lucent.com>
9566 * quote.h (PARAMS): Define and use.
9567 Reported by Akim Demaille.
9569 * getopt.c: Update from libc.
9571 2000-10-16 Jim Meyering <meyering@lucent.com>
9573 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9576 2000-09-25 Jim Meyering <meyering@lucent.com>
9578 * md5.h (rol): Define (from GnuPG).
9580 * sha.c: Give credit (GnuPG) where due.
9581 (M): Use rol rather than open-coding it.
9582 Add a FIXME comment.
9584 2000-09-21 Jim Meyering <meyering@lucent.com>
9586 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9587 Reported by Michael Stone.
9589 2000-09-20 Jim Meyering <meyering@lucent.com>
9591 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9592 (noinst_HEADERS): Add sha.h.
9593 Based on code from Scott G. Miller and from GnuPG.
9595 2000-09-15 Jim Meyering <meyering@lucent.com>
9597 * regex.c: Update from libc.
9599 2000-09-10 Jim Meyering <meyering@lucent.com>
9601 * getopt.c (_getopt_internal): Update from glibc.
9603 2000-09-09 Jim Meyering <meyering@lucent.com>
9605 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9606 think it should be used as a general replacement for isascii.
9607 * fnmatch.c: Likewise.
9608 * mbswidth.c: Likewise
9609 * regex.c: Likewise.
9612 * userspec.c: Include sys/param.h and limits.h.
9614 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9615 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9616 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9617 UID, GID. Check range.
9619 2000-09-06 Jim Meyering <meyering@lucent.com>
9621 * getopt.c (_getopt_internal): Update from glibc.
9623 2000-08-30 Jim Meyering <meyering@lucent.com>
9625 * strftime.c: Merge in changes from GNU libc.
9627 2000-08-26 Jim Meyering <meyering@lucent.com>
9629 * closeout.c: Include "__fpending.h".
9630 (close_stdout_status): Return right away if there's nothing to flush.
9632 * Makefile.am (noinst_HEADERS): Add __fpending.h.
9633 * __fpending.c: New file.
9634 * __fpending.h: New file.
9636 2000-08-07 Paul Eggert <eggert@twinsun.com>
9638 Standardize on "memory exhausted" instead of "Memory exhausted"
9639 or "virtual memory exhausted".
9640 * obstack.c (print_and_abort): Use "memory exhausted", not
9641 "virtual memory exhausted".
9642 * same.c (same_name): Invoke xalloc_die instead of printing
9644 * userspec.c (parse_user_spec): Likewise.
9645 * bumpalloc.h: comment fix
9646 * same.c, userspec.c: Include xalloc.h.
9648 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9649 not char *const and pointing to a constant array.
9650 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9651 (xrealloc): Comment fix.
9653 * userspec.c (parse_user_spec):
9654 Don't translate a message until just before returning,
9655 to avoid unnecessary translation.
9657 2000-08-07 Jim Meyering <meyering@lucent.com>
9659 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9660 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9661 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9662 getgroups.c, gethostname.c, getopt.h, group-member.c,
9663 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9664 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9665 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9666 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9667 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9668 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9669 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9670 yesno.c: Back out Copyright date changes for each file with no change
9671 this year. This eases coordination with other programs using the same
9672 source code modules. From Paul Eggert.
9674 2000-08-03 Greg McGary <greg@mcgary.org>
9676 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9677 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9678 (EXTEND_BUFFER): Use them.
9680 2000-08-01 Jim Meyering <meyering@lucent.com>
9682 * dirname.c (ISSLASH): Define.
9683 (BACKSLASH_IS_PATH_SEPARATOR): Define.
9684 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9685 both `\' and `/' may be use as path separators.
9686 Based on a patch from Prashant TR.
9688 2000-07-31 Paul Eggert <eggert@twinsun.com>
9690 * quotearg.c (quotearg_n_options): Don't make the initial
9691 slot vector a constant, since it might get modified.
9693 2000-07-31 Jim Meyering <meyering@lucent.com>
9695 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9696 * obstack.c (print_and_abort): Likewise.
9698 2000-07-30 Paul Eggert <eggert@twinsun.com>
9700 * quotearg.c (quotearg_n_options): Preallocate a slot 0
9701 buffer, so that the caller can always quote one small
9702 component of a "memory exhausted" message in slot 0.
9703 From a suggestion by Jim Meyering.
9705 2000-07-30 Jim Meyering <meyering@lucent.com>
9707 * makepath.c (make_path): Quote the other instance, too.
9709 * quotearg.c (N_STATIC_SLOTVECS): Define.
9710 (STATIC_BUF_SIZE): Define.
9711 (quotearg_n_options): Use only statically allocated storage when
9712 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9713 than STATIC_BUF_SIZE.
9715 2000-07-29 Jim Meyering <meyering@lucent.com>
9717 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9718 * dirname.c (dir_name): Likewise.
9720 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9722 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9723 (dir_name): Assert that there are no trailing slashes.
9725 2000-07-18 Bruno Haible <haible@clisp.cons.org>
9727 * mbswidth.h (mbswidth): Add a flags argument.
9728 (mbswidth): New declaration.
9729 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9730 * mbswidth.c (mbswidth): Add a flags argument.
9731 (mbsnwidth): New function.
9733 2000-07-24 Jim Meyering <meyering@lucent.com>
9735 * mbswidth.c: Remove useless #else. From Bruno Haible.
9737 2000-07-23 Paul Eggert <eggert@twinsun.com>
9739 * mbswidth.c (_XOPEN_SOURCE):
9740 Don't define; this causes problems on Solaris 7.
9741 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9743 2000-07-23 Paul Eggert <eggert@twinsun.com>
9746 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9747 so that mbstate_t is always defined.
9749 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9750 be 1 in at least one GCC installation, and this configuration
9751 error is likely to be common. Ignoring MB_LEN_MAX hurts
9752 performance on hosts that have mbrtowc but have only unibyte
9753 locales, but I assume these hosts are rare.
9755 2000-07-23 Paul Eggert <eggert@twinsun.com>
9757 * quotearg.c: Streamline by invoking multibyte code only if needed.
9758 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9759 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9760 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9761 invoke multibyte primitives.
9763 2000-07-23 Jim Meyering <meyering@lucent.com>
9765 * basename.c (base_name): Add an assertion.
9767 2000-07-15 Bruno Haible <clisp.cons.org>
9769 * quotearg.c: When the system forces us to redefine mbstate_t,
9770 shadow its mbsinit function.
9772 2000-07-16 Bruno Haible <haible@clisp.cons.org>
9774 * mbswidth.h: New file.
9775 * mbswidth.c: New file.
9776 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9777 (noinst_HEADERS): Add mbswidth.h.
9779 2000-07-17 Bruno Haible <haible@clisp.cons.org>
9781 * config.charset: Add support for FreeBSD. Improve support for HP-UX
9784 2000-07-15 Jim Meyering <meyering@lucent.com>
9786 * makepath.c: Include quote.h.
9787 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9788 corresponding argument in a `quote (...)' call.
9789 Give better diagnostics.
9791 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9792 (noinst_HEADERS): Add quote.h.
9794 * quote.c (quote, quote_n): New file. Two functions taken verbatim
9795 from tar's src/misc.c.
9796 * quote.h: New file. Prototypes for same.
9798 2000-07-10 Paul Eggert <eggert@twinsun.com>
9800 From a suggestion by Bruno Haible.
9801 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9802 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9803 to decide whether to define the BeOS workaround macro;
9804 this adjusts to the change to AC_MBSTATE_T.
9806 2000-07-13 Paul Eggert <eggert@twinsun.com>
9808 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9810 * quotearg.c (quoting_style_args, quoting_style_vals,
9811 quotearg_buffer_restyled): Add support for
9812 clocale_quoting_style. Undo previous change to
9813 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9814 and "{RIGHT QUOTATION MARK}" msgids.
9816 2000-07-05 Paul Eggert <eggert@twinsun.com>
9818 The old behavior of quoting `like this' doesn't look good with
9819 newer, ISO-style fonts. See:
9820 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9822 Instead, quote "like this" by default. Let the translator
9823 tailor the locale-specific quoting behavior by providing
9824 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9826 * quotearg.c (N_): New macro.
9827 (gettext_default): New function.
9828 (quotearg_buffer_restyled): Use
9829 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9830 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9832 2000-07-09 Jim Meyering <meyering@lucent.com>
9834 * Most files: Update copyright dates to include 2000.
9836 2000-07-08 Jim Meyering <meyering@lucent.com>
9838 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9840 (xgethostname): Remove now-unnecessary #ifdef.
9841 Move declaration of `err' into loop where it's used.
9843 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9845 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9846 by allocating a larger buffer. Test the gethostname return value for
9847 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
9848 returns an error and ENAMETOOLONG isn't defined.
9850 2000-07-05 Paul Eggert <eggert@twinsun.com>
9851 and Bruno Haible <haible@clisp.cons.org>
9853 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9855 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9857 * quotearg.c (struct quoting_options): Simplify quote_these_too
9860 2000-07-03 Jim Meyering <meyering@lucent.com>
9862 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9863 Reported by Bruno Haible.
9865 2000-07-04 Jim Meyering <meyering@lucent.com>
9867 * quotearg.c: Make inclusion of <wchar.h> independent of whether
9868 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
9871 2000-07-03 Paul Eggert <eggert@twinsun.com>
9872 and Bruno Haible <haible@clisp.cons.org>
9874 * quotearg.c (mbrtowc):
9875 Assign to *pwc, and return 1 only if result is nonzero.
9876 (iswprint): Use ISPRINT when substituting our own mbrtowc.
9878 2000-07-03 Jim Meyering <meyering@lucent.com>
9880 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9881 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9884 2000-07-02 Jim Meyering <meyering@lucent.com>
9886 * quotearg.c (mbstate_t): Don't define here.
9888 2000-07-02 Jim Meyering <meyering@lucent.com>
9890 * nanosleep.c (SIGCONT): Define if not already defined.
9892 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9894 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9895 per change in ../m4/ls-mntd-fs.m4.
9896 (read_filesystem_list): Ignore symbolic links.
9898 2000-06-29 Jim Meyering <meyering@lucent.com>
9900 * same.c: Include <string.h> or <strings.h>, as appropriate,
9901 for declaration of strcmp.
9903 * long-options.c: Include <stdlib.h>, for declaration of exit.
9905 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9906 Avoid warning by casting result to `char *' to remove `const'.
9908 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9910 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9912 2000-06-26 Paul Eggert <eggert@twinsun.com>
9914 savedir now sets errno on failure and invokes xmalloc to get memory.
9915 Fix a couple of other minor bugs while we're at it.
9917 * savedir.c (<unistd.h>): Do not include; there's no need.
9918 (NAMLEN): Remove macro.
9919 (malloc, realloc): Remove decls.
9921 ("xalloc.h"): Include.
9922 (NAME_SIZE_DEFAULT): New macro.
9923 (savedir): Use xmalloc / xrealloc to allocate memory.
9924 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9925 Skip "" directory entries.
9926 Use strlen to calculate directory entry length, since the old method
9927 is rarely used these days and isn't worth supporting.
9928 Don't use a pointer after freeing it.
9929 Check for integer overflow when calculating allocation size.
9930 Use memcpy to copy entries, instead of stpcpy.
9931 Set errno properly when returning NULL.
9932 Check for readdir error.
9934 2000-06-26 Jim Meyering <meyering@lucent.com>
9936 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9938 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9940 * getusershell.c (xmalloc, xrealloc): Remove functions.
9942 Don't include <stdlib.h>. Don't declare malloc, realloc.
9944 2000-06-23 Bruno Haible <haible@clisp.cons.org>
9946 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9948 2000-06-24 Jim Meyering <meyering@lucent.com>
9950 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9952 2000-06-21 Jim Meyering <meyering@lucent.com>
9954 * getpass.c: New file, from Bruno Haible. Required for BeOS.
9956 2000-06-19 Paul Eggert <eggert@twinsun.com>
9958 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9959 (mbrtowc, mbstate_t): Define substitutes if
9960 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9961 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9962 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9964 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9966 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9967 than 1024, return a memory chunk of least possible size, instead
9968 of size PATH_MAX + 2. In the loop, increment the size proportionally.
9969 Use free/xmalloc instead of xrealloc to avoid copying for very long
9972 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9974 * canon-host.c (canon_host): Use malloc and memcpy to copy an
9975 address, not strdup. Include <stdlib.h> and don't declare free().
9977 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9979 * path-concat.c (path_concat): Don't access dir[-1] if dir is
9982 2000-06-21 Jim Meyering <meyering@lucent.com>
9984 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9985 (noinst_HEADERS): Add getstr.h.
9987 * getline.c (getstr): Move into a separate file.
9988 * getstr.c (getstr): New file, extracted from getline.c, with
9989 the following changes: new parameter, delim2; both delim[12]
9990 parameters have type `int', not `char'. The latter would lose
9991 with 8-bit delimiters.
9992 * getstr.h: New file.
9994 2000-06-19 Jim Meyering <meyering@lucent.com>
9996 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9998 2000-06-18 Jim Meyering <meyering@lucent.com>
10000 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10001 Besides, these days every porting target provides a mkdir function.
10003 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10004 (this snippet comes from src/system.h).
10006 2000-06-15 Paul Eggert <eggert@twinsun.com>
10008 * human.c (adjust_value): New function.
10009 (human_readable_inexact): Apply rounding style even when
10010 printing approximate values.
10012 2000-06-14 Paul Eggert <eggert@twinsun.com>
10014 * human.c (human_readable_inexact): Allow an input block
10015 size that is not a multiple of the output block size, and vice versa.
10016 Reported by Piergiorgio Sartor.
10018 2000-06-14 Paul Eggert <eggert@twinsun.com>
10020 * getdate.y (get_date): Apply relative times after time
10021 zone indicator, not before. Reported by Todd A. Jacobs.
10023 2000-06-13 Jim Meyering <meyering@lucent.com>
10025 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10027 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10029 2000-06-12 Paul Eggert <eggert@twinsun.com>
10031 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10033 2000-06-04 Paul Eggert <eggert@twinsun.com>
10035 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10037 2000-06-04 Jim Meyering <meyering@lucent.com>
10039 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10040 SunOS 4.1.4 for which gid_t is an unsigned type.
10042 2000-06-03 Jim Meyering <meyering@lucent.com>
10044 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10046 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10048 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10049 newer, don't install charset.alias.
10050 * config.charset: Change the Linux/glibc rules so they become empty
10051 on glibc-2.1 or newer.
10053 2000-06-02 Jim Meyering <meyering@lucent.com>
10055 * mountlist.c: Back out last change. Instead, do this...
10056 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10057 member using the same `ignore'-testing code.
10058 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10062 2000-05-29 Jim Meyering <meyering@lucent.com>
10064 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10065 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10067 2000-05-22 Jim Meyering <meyering@lucent.com>
10069 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10071 2000-05-18 Jim Meyering <meyering@lucent.com>
10073 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10074 back, too, since it may have been modified by allocate_entry.
10075 (hash_delete): Rewrite to use neither the assignment operator
10076 nor the comma operator in an if-expression.
10078 2000-05-15 Paul Eggert <eggert@twinsun.com>
10081 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10082 Remove; no longer needed.
10083 "quotearg.h": Add include.
10084 (file_name): Do not bother to explicitly initialize to NULL; it's less
10085 efficient on some hosts.
10086 (close_stdout_status): Remove test as to whether stdout was already
10087 closed; it breaks for the case "echo x | sort >&-".
10088 Quote file name colons.
10089 Do not assume that _("write error") lacks format strings.
10091 2000-05-15 Jim Meyering <meyering@lucent.com>
10093 * version-etc.c (version_etc_copyright): Update the copyright string
10094 used in all --version output.
10096 2000-05-14 Jim Meyering <meyering@lucent.com>
10098 * closeout.c (close_stdout_set_file_name): New function.
10099 (close_stdout_status): Use new file-scoped global.
10100 Return right away if fstat says the stdout file descriptor is invalid.
10101 * closeout.h (close_stdout_set_file_name): Declare.
10103 2000-05-10 Jim Meyering <meyering@lucent.com>
10105 * closeout.c [default_exit_status]: New file-scoped variable.
10106 (close_stdout_set_status): New function.
10107 * closeout.h (close_stdout_set_status): Declare.
10109 2000-05-08 Jim Meyering <meyering@lucent.com>
10111 * long-options.c: Don't include closeout.h.
10112 (parse_long_options): Don't call close_stdout for --version.
10114 2000-05-06 Jim Meyering <meyering@lucent.com>
10116 * strnlen.c: Undefine __strnlen and strnlen.
10117 [!weak_alias]: Define __strnlen to strnlen.
10119 * atexit.c: New file, from libiberty.
10121 2000-05-06 Jim Meyering <meyering@lucent.com>
10123 * closeout.c (close_stdout_status): Also check for errors on the
10126 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10128 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10129 instead of xmalloc, xrealloc, path_concat.
10130 (locale_charset): Treat empty environment variables as absent.
10131 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10133 2000-05-04 Jim Meyering <meyering@lucent.com>
10135 * getopt.c: Update from glibc.
10136 * obstack.c: Likewise.
10137 * obstack.h: Likewise.
10138 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10140 * regex.h: Likewise.
10141 * strndup.c: Likewise.
10142 * strnlen.c: New file, from glibc.
10144 2000-05-01 Jim Meyering <meyering@lucent.com>
10146 * full-write.c (full_write): Remove `FIXME' part of comment.
10148 2000-04-29 Jim Meyering <meyering@lucent.com>
10150 * path-concat.c: Declare strdup only if it's not defined.
10151 * canon-host.c: Likewise.
10153 2000-04-28 Jim Meyering <meyering@lucent.com>
10155 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10156 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10157 included first, then limits.h is included by locale.h by libintl.h.
10158 From John David Anglin.
10160 2000-04-25 Jim Meyering <meyering@lucent.com>
10162 * makepath.c (S_IRWXUGO): Define.
10163 (make_path): Always perform explicit chmod if MODE specifies any
10164 of the `special' permission bits. Prompted by a bug report against
10165 install from Mate Wierdl and Joost van Baal.
10167 2000-04-18 Jim Meyering <meyering@lucent.com>
10169 * README: New file.
10171 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10172 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10174 2000-04-17 Jim Meyering <meyering@lucent.com>
10176 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10177 the definition of it to rpl_strftime also defined-away the system's
10180 2000-04-15 Jim Meyering <meyering@lucent.com>
10182 Use `C' to denote so-called `contiguous' files, the same way
10184 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10185 (ftypelet): Use S_ISCTG.
10186 From Michael Deutschmann.
10188 2000-04-14 Jim Meyering <meyering@lucent.com>
10190 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10192 2000-04-08 Jim Meyering <meyering@lucent.com>
10194 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10195 names don't conflict. Reported by Eli Zaretskii.
10197 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10199 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10200 bug. Deal with the different error behavior of Irix iconv.
10202 2000-04-07 Jim Meyering <meyering@lucent.com>
10204 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10205 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10207 2000-04-05 Jim Meyering <meyering@lucent.com>
10209 Portability tweaks required for ultrix4.3.
10210 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10211 * readutmp.c: Include sys/types.h before sys/stat.h.
10212 * canon-host.c: Declare strdup.
10213 * path-concat.c: Likewise.
10214 From John David Anglin.
10216 2000-04-04 Jim Meyering <meyering@lucent.com>
10218 Be more DOS 8.3-friendly.
10219 * ref-add.sin: Renamed from ref-add.sed.in.
10220 * ref-del.sin: Renamed from ref-del.sed.in.
10221 * Makefile.am: Reflect renaming.
10222 Reported by Eli Zaretskii.
10224 Use a temporary file name that won't clash with `charset.alias'
10225 in the DOS 8.3 name space.
10226 * Makefile.am (charset_tmp): Define.
10227 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10228 (uninstall-local): Likewise.
10229 Reported by Eli Zaretskii.
10231 2000-03-29 Paul Eggert <eggert@twinsun.com>
10233 * time/strftime.c (my_strftime): Make sure we call the system
10234 strftime, not ourselves, when invoking the underlying strftime.
10236 2000-03-24 Jim Meyering <meyering@lucent.com>
10238 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10239 (charset_alias): Define.
10240 (install-exec-local): Factor out common code.
10241 (uninstall-local): Split lines longer than 80.
10242 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10243 (SUFFIXES): Define.
10244 (.sed.in.sed): New rule. Don't redirect directly to $@.
10245 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10247 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10249 * config.charset: Output a line containing "Packages using this file".
10250 * ref-add.sed.in, ref-del.sed.in: New files.
10251 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10252 ref-del.sed): New rules.
10254 2000-03-17 Jim Meyering <meyering@lucent.com>
10256 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10257 Otherwise, include <strings.h>
10259 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10261 * unicodeio.c (utf8_wctomb): New function.
10262 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10263 format instead of in UCS-4 with platform dependent endianness.
10265 2000-03-07 Paul Eggert <eggert@twinsun.com>
10267 * savedir.c (savedir): Work even if directory size is
10268 negative; this can happen with some screwy NFS configurations.
10270 2000-03-06 Jim Meyering <meyering@lucent.com>
10272 * localcharset.c (get_charset_aliases): Don't try to free file_name
10273 if it's NULL (because we ran out of memory). From Bruno Haible.
10275 2000-03-05 Jim Meyering <meyering@lucent.com>
10277 * localcharset.c ("path-concat.h"): Include.
10278 (get_charset_aliases): Use path_concat instead of ANSI string
10281 * unicodeio.h (PARAMS): Define.
10282 Use it to guard prototype.
10284 2000-03-04 Jim Meyering <meyering@lucent.com>
10286 * Makefile.am (install-exec-local): Create $(libdir) before installing
10288 (uninstall-local): Uncomment this rule so `make distcheck' works
10291 * unicodeio.c (<errno.h>): Include it.
10292 (errno): Declare if not defined.
10294 * localcharset.c: Add Bruno's comment justifying use of volatile.
10296 * config.charset: New version, incorporating remarks from a linux
10297 i18n mailing list. From Bruno Haible.
10299 2000-03-02 Jim Meyering <meyering@lucent.com>
10301 * Makefile.am (EXTRA_DIST): Add config.charset.
10303 2000-03-01 Jim Meyering <meyering@lucent.com>
10305 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10306 * unicodeio.c: Likewise.
10308 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10310 * config.charset: New file.
10311 * localcharset.c: New file.
10312 * unicodeio.h, unicodeio.c: New files.
10313 * Makefile.am (DEFS): Add -DLIBDIR=...
10314 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10315 (noinst_HEADERS): Add unicodeio.h.
10316 (all-local, install-exec-local, charset.alias): New targets.
10318 2000-02-28 Paul Eggert <eggert@twinsun.com>
10320 * quotearg.c (ALERT_CHAR): New macro.
10321 (quotearg_buffer_restyled): Use it.
10323 2000-02-27 Jim Meyering <meyering@lucent.com>
10325 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10326 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10328 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10329 not `#if STDC_HEADERS'.
10330 Declare malloc if needed.
10332 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10333 now that autoconf always defines the HAVE_DECL_ symbols.
10334 * human.c: Likewise.
10335 * same.c: Likewise.
10336 * strtoumax.c: Likewise.
10338 * backupfile.c: Arrange for cpp to fail if the configure-time
10339 declaration check was not run.
10340 * hash.c: Likewise.
10341 * human.c: Likewise.
10342 * same.c: Likewise.
10343 * strtoumax.c: Likewise.
10345 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10346 then first look up the entire `.'-containing string as a login name.
10348 2000-02-18 Paul Eggert <eggert@twinsun.com>
10350 * getdate.y: Handle two-digit years with leading zeros correctly.
10351 (textint): New typedef.
10352 (parser_control): Member year changed from int to textint.
10354 (YYSTYPE): Removed; replaced by %union with int and textint members.
10355 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10356 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10357 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10358 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10359 (date, number, to_year): Use width of number in digits, not its value,
10360 to determine whether it's a 2-digit year, or a 2-digit time.
10361 (yylex): Store number of digits of numeric tokens.
10362 Reported by John Kendall.
10364 (parser_control): Changed from struct parser_control to typedef (for
10365 consistency). All uses changed.
10367 (tID): Removed; not used.
10368 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10370 2000-02-14 Paul Eggert <eggert@twinsun.com>
10372 * getpagesize.h (getpagesize): Port to VMS for Alpha;
10373 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10375 2000-02-12 Jim Meyering <meyering@lucent.com>
10377 * userspec.c (ISDIGIT): Define it.
10378 (isdigit): Remove definition.
10379 (is_number): Use ISDIGIT, not isdigit.
10380 <libintl.h>: Include.
10381 (_ and N_): Define.
10382 (parse_user_spec): Mark translatable strings.
10384 2000-02-10 Jim Meyering <meyering@lucent.com>
10386 With these changes, nanosleep.[ch] are finally enough like the other
10387 lib/* replacement files to compile on a few more losing systems.
10389 * nanosleep.h: Don't include config.h.
10390 Remove prototype from declaration of nanosleep.
10391 (PARAMS): Remove now-unneeded definition.
10392 * nanosleep.c: #undef nanosleep.
10393 (rpl_nanosleep): Rename from nanosleep.
10395 2000-02-03 Jim Meyering <meyering@lucent.com>
10397 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10398 rather than with `#if HAVE_UTMPNAME'.
10400 2000-02-01 Jim Meyering <meyering@lucent.com>
10402 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
10404 2000-01-31 Jim Meyering <meyering@lucent.com>
10406 * nanosleep.h (nanosleep): Guard declaration with
10407 `#if ! HAVE_DECL_NANOSLEEP'.
10408 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10409 the declaration in that vendor's sys/timers.h.
10410 Reported by Christian Krackowizer.
10412 * quotearg.c (ISASCII): Add #undef and move definition to follow
10413 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10414 (ISPRINT): Likewise.
10415 Reported by Tom Tromey.
10417 2000-01-30 Jim Meyering <meyering@lucent.com>
10419 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10420 uses of ->ut_name. The latter doesn't work with new Linux header files
10421 where only utmpx.ut_user is declared.
10423 * readutmp.h (UT_USER): Define.
10425 2000-01-23 Jim Meyering <meyering@lucent.com>
10427 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10430 2000-01-22 Jim Meyering <meyering@lucent.com>
10432 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10433 [! HAVE_DECL_STRTOULL]: Declare strtoull.
10434 Required for some AIX systems. Reported by Christian Krackowizer.
10435 [TESTING] (main): New function.
10437 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
10438 * dirname.c (dir_name): Support for DOS-style file names with drive
10441 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10443 * strverscmp.c (ISDIGIT): Define.
10444 (strverscmp): Use ISDIGIT, not isdigit.
10446 2000-01-17 Paul Eggert <eggert@twinsun.com>
10448 * nanosleep.c (nanosleep):
10449 Don't use SA_INTERRUPT to decide whether to call sigaction, as
10450 POSIX.1 doesn't require SA_INTERRUPT and some systems
10451 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
10452 it's been part of POSIX.1 since day 1 (in 1988).
10454 2000-01-17 Jim Meyering <meyering@lucent.com>
10456 * interlock: Remove unused file. Reported by François Pinard.
10458 2000-01-16 Paul Eggert <eggert@twinsun.com>
10460 * quotearg.c (quotearg_buffer_restyled): Do not quote
10461 alert, backslash, formfeed, and vertical tab unnecessarily in
10462 shell quoting style.
10465 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10466 Free Software Foundation, Inc.
10467 Copying and distribution of this file, with or without modification,
10468 are permitted provided the copyright notice and this notice are preserved.