1 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
3 * isapipe.c, isapipe.h: New files.
5 2006-08-29 Eric Blake <ebb9@byu.net>
7 * error.c (error_at_line, print_errno_message): Match libc, after
8 resolution of upstream bug 3044.
10 2006-08-29 Bruno Haible <bruno@clisp.org>
12 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
14 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
18 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
20 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
21 sharing with gnulib. Report by Eric Blake.
23 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
26 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
28 * dirchownmod.c: Likewise.
31 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
32 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
33 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
34 just before including <inttypes.h>, to avoid circular inclusion.
36 2006-08-28 Bruno Haible <bruno@clisp.org>
38 * inttypes_.h (SCNX*): Remove definitions.
39 Reported by Eric Blake.
41 2006-08-26 Bruno Haible <bruno@clisp.org>
43 * vasnprintf.c (EOVERFLOW): Remove definition.
44 (VASNPRINTF): Return a string of length > INT_MAX without failing.
45 * vasprintf.c: Include errno.h, limits.h.
46 (EOVERFLOW): New fallback definition.
47 (vasprintf): Test here whether the string length is > INT_MAX.
48 * vsnprintf.c: Include errno.h, limits.h.
49 (EOVERFLOW): New fallback definition.
50 (vsnprintf): Fix bug when generated string was too long for the buffer.
51 Test here whether the string length is > INT_MAX.
53 2006-08-26 Bruno Haible <bruno@clisp.org>
54 Simon Josefsson <jas@extundo.com>
57 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
59 2006-08-28 Bruno Haible <bruno@clisp.org>
61 * c-strstr.h: New file, from GNU gettext.
62 * c-strstr.c: New file, from GNU gettext.
64 2006-08-26 Bruno Haible <bruno@clisp.org>
66 * inttypes_.h: New file.
67 * inttypes.h: Remove file.
68 * stdint_.h: Include <inttypes.h> through its absolute filename.
70 * imaxabs.c: New file.
72 * imaxdiv.c: New file.
74 2006-08-22 Bruno Haible <bruno@clisp.org>
76 * readutmp.h: Skip most definitions if neither <utmp.h> nor
79 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
82 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
83 Problem reported by Bruno Haible.
85 2006-08-21 Bruno Haible <bruno@clisp.org>
88 * mbchar.h: Include <wctype.h> only if it exists.
90 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
92 * cycle-check.h: Include <stdint.h> unconditionally, since we
93 now assume the stdint module. Do not include inttypes.h.
94 * fsusage.h: Likewise.
95 * getndelim2.c: Likewise.
97 * inttostr.h: Likewise.
98 * obstack.c: Likewise.
99 * regex_internal.h: Likewise.
100 * tempname.c: Likewise.
101 * utimecmp.c: Likewise.
102 * xstrtol.h: Likewise.
104 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
106 * strtoimax.c: Adjust to macro name changes in Autoconf,
107 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
110 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
112 * fchmodat.c: New file, from coreutils. This was inadvertently
113 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
115 2006-08-18 Bruno Haible <bruno@clisp.org>
117 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
118 (ME_DUMMY): Treat "kernfs" as a dummy.
119 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
121 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
123 Update from coreutils.
125 * __fpending.h: Add copyright notice.
126 * fprintftime.h: Likewise.
127 * savedir.c: Use (C) in copyright notice.
128 * savedir.h: Likewise.
130 2006-08-15 Jim Meyering <jim@meyering.net>
132 * at-func.c: New file, with the logic of all emulated at-functions.
133 * openat-priv.h: Include <errno.h> and define ENOSYS,
134 in support of the EXPECTED_ERRNO macro.
135 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
136 Instead, define the appropriate symbols and include "at-func.c".
137 * mkdirat.c (mkdirat): Likewise.
138 * fchmodat.c (fchmodat): Likewise.
139 (ENOSYS): Remove definition.
140 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
141 Don't include "unistd--.h" -- it wasn't ever used.
143 2006-01-17 Jim Meyering <jim@meyering.net>
145 Rewrite fts.c not to change the current working directory,
146 by using openat, fstatat, fdopendir, etc..
148 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
149 (HAVE_OPENAT_SUPPORT): Define.
150 [_LIBC] (fchdir): Don't undef or define; no longer used.
151 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
152 Now, this `function' always succeeds, and consumes its file descriptor
153 parameter -- so callers must not close such FDs. Update callers.
154 (diropen_fd, opendirat, cwd_advance_fd): New functions.
155 (diropen): Add parameter, SP. Adjust all callers.
156 Implement using diropen_fd, rather than open.
157 (fts_open): Initialize new member, fts_cwd_fd.
158 Remove fts_rft-setting code.
159 (fts_close): Close fts_cwd_fd, if necessary.
160 (__opendir2): Define in terms of opendir or opendirat,
161 depending on whether the FST_NOCHDIR flag is set.
162 (fts_build): Since fts_safe_changedir consumes its FD, and since
163 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
164 and close the dup'd file descriptor upon failure.
165 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
166 (fts_safe_changedir): Tweak semantics to reflect that this function
167 now calls cwd_advance_fd and hence consumes its FD argument.
168 * fts_.h [struct FTS] (fts_cwd_fd): New member.
169 [struct FTS] (fts_rft): Remove now-unused member.
170 [struct FTS] (fts_cycle.state): Improve comment.
172 * openat.c (openat_needs_fchdir): New function.
173 * openat.h (openat_needs_fchdir): Declare it.
175 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
177 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
178 Problem and fix reported by Pádraig Brady in
179 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
181 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
183 * memcoll.c (memcoll): Optimize for the common case where the
184 arguments are bytewise equal.
186 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
188 Change copyright notice from LGPL 2 to GPL 2, since that's the
189 standard form used in the gnulib repository.
190 * lock.c: LGPL -> GPL.
192 * strnlen1.c: Likewise.
193 * strnlen1.h: Likewise.
196 * tmpdir.c: Likewise.
198 * TODO: Remove; this belongs only in coreutils.
200 2006-08-14 Eric Blake <ebb9@byu.net>
202 Import the following change from libc:
204 2006-08-12 Ulrich Drepper <drepper@redhat.com>
207 * misc/error.c: Add space between program name and message if file
210 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
212 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
213 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
215 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
216 in wchar_t. Problem reported by Eric Blake.
218 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
219 LEN is smaller than SIZE. Suggested by Bruno Haible.
220 Also, help the compiler to keep LEN in a register.
222 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
224 * .cppi-disable: Add snprintf.h, socket_.h.
225 * snprintf.c: Include <errno.h> and <limits.h>.
226 (EOVERFLOW): Define if the system does not.
227 Do not include "minmax.h"; it wasn't used.
228 (snprintf): Don't assume size_t promotes to an unsigned type.
229 Fix bug when generated string was too long for the buffer: the
230 buffer's contents are supposed to be the initial prefix of the
231 output. Don't assume vasnprintf returns EOVERFLOW if the size
232 exceeds INT_MAX; do the check ourselves.
234 Import the following changes from libc:
236 2006-06-02 Jakub Jelinek <jakub@redhat.com>
238 * posix/regex_internal.c (re_string_skip_chars): If no character has
239 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
240 to the byte which couldn't be converted.
241 (re_string_reconstruct): Don't clear valid_raw_len before calling
242 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
243 tip_context using re_string_context_at.
245 2006-05-02 Ulrich Drepper <drepper@redhat.com>
247 * posix/regex.h: g++ still cannot handled [restrict].
249 2006-04-21 Ulrich Drepper <drepper@redhat.com>
251 * posix/regex.h: Remove special handling for VMS.
253 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
257 2006-07-19 Mike Frysinger <vapier@gentoo.org>
259 * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
260 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
262 2006-08-08 Eric Blake <ebb9@byu.net>
264 * verror.c (verror_at_line): Work around glibc bug 2997, so that
265 verror_at_line output complies with GNU Coding Standards even when
268 2006-08-08 Eric Blake <ebb9@byu.net>
270 * verror.h, verror.c: New files.
272 2006-08-07 Bruno Haible <bruno@clisp.org>
274 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
276 Reported by Ralf Wildenhues.
278 2006-08-06 Eric Blake <ebb9@byu.net>
280 * error.h: Fold in some upstream changes from glibc.
283 2006-07-29 Bruno Haible <bruno@clisp.org>
285 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
287 2006-07-29 Bruno Haible <bruno@clisp.org>
289 * setenv.c: Undo unintended modification done on 2006-02-27.
291 2006-07-28 Eric Blake <ebb9@byu.net>
293 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
296 2006-07-28 Simon Josefsson <jas@extundo.com>
298 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
301 2006-07-28 Simon Josefsson <jas@extundo.com>
303 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
306 2006-07-28 Bruno Haible <bruno@clisp.org>
308 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
310 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
312 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
315 2006-07-28 Bruno Haible <bruno@clisp.org>
317 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
318 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
320 Avoids link error on FreeBSD 4.x.
321 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
323 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
325 * mbswidth.c (iswcntrl): Likewise.
327 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
329 * modechange.c (mode_compile): Numeric modes now affect setuid and
330 setgid on directories only if they set these bits.
331 * modechange.h: Remove obsolete comment about masks.
333 2006-07-27 Bruno Haible <bruno@clisp.org>
335 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
336 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
339 2006-07-26 Eric Blake <ebb9@byu.net>
341 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
342 like mingw that lack mkstemp.
343 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
344 avoid compilation warning on mingw.
346 2006-07-25 Bruno Haible <bruno@clisp.org>
348 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
349 <stdarg.h> or config.h.
351 2006-07-24 Bruno Haible <bruno@clisp.org>
353 * clean-temp.h: New file, from GNU gettext.
354 * clean-temp.c: New file, from GNU gettext.
356 2006-07-24 Bruno Haible <bruno@clisp.org>
358 * tmpdir.h: New file, from GNU gettext.
359 * tmpdir.c: New file, from GNU gettext.
361 2006-07-23 Bruno Haible <bruno@clisp.org>
363 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
364 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
365 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
366 gl_linked_remove_at): Use it.
368 2006-07-23 Eric Blake <ebb9@byu.net>
370 * tmpfile-safer.c: New file.
371 * stdio-safer.h (fopen_safer): Add prototype.
372 * stdio--.h (tmpfile): Make safer.
374 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
376 * close-stream.c, close-stream.h: New files.
378 2006-07-22 Bruno Haible <bruno@clisp.org>
380 Merge from GNU gettext 0.15.
382 2005-07-05 Bruno Haible <bruno@clisp.org>
384 * printf-args.c (printf_fetchargs): Work around broken
385 definition of wint_t on mingw.
387 2005-02-12 Bruno Haible <bruno@clisp.org>
389 * xallocsa.h: Add extern "C" for C++.
391 2006-05-17 Bruno Haible <bruno@clisp.org>
394 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
396 2006-04-30 Bruno Haible <bruno@clisp.org>
398 * progreloc.c: Include <mach-o/dyld.h> if available.
399 (find_executable): Use _NSGetExecutablePath when possible.
401 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
403 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
406 2005-12-29 Bruno Haible <bruno@clisp.org>
408 * progreloc.c (set_program_name_and_installdir): Fix
411 2005-12-04 Bruno Haible <bruno@clisp.org>
414 * progreloc.c: Include <windows.h> also on Cygwin.
415 (find_executable): Add support for Cygwin.
416 (set_program_name_and_installdir): Handle also platforms with
419 2006-07-11 Bruno Haible <bruno@clisp.org>
421 * javacomp.c: Fix a comment.
422 Reported by Jim Meyering.
424 2006-04-30 Bruno Haible <bruno@clisp.org>
426 * javacomp.h (compile_java_class): Add source_version,
427 target_version arguments.
428 * javacomp.c: Rewritten to choose only a compiler that
429 respects the specified source_version and target_version.
431 2006-06-27 Bruno Haible <bruno@clisp.org>
433 Assume correct S_ISDIR macro.
434 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
436 2006-07-22 Bruno Haible <bruno@clisp.org>
438 * javaversion.h: New file, from GNU gettext.
439 * javaversion.c: New file, from GNU gettext.
440 * javaversion.java: New file, from GNU gettext.
441 * javaversion.class: New file, from GNU gettext.
443 2006-05-17 Bruno Haible <bruno@clisp.org>
446 * javaexec.c (execute_java_class): Test for jview program
449 2006-04-09 Bruno Haible <bruno@clisp.org>
451 * fatal-signal.c: Don't include string.h.
452 (at_fatal_signal): Use a copying loop instead of memcpy.
454 2005-12-04 Bruno Haible <bruno@clisp.org>
456 * csharpexec.c: Add support for 'clix' launcher (untested).
457 (execute_csharp_using_sscli): New function.
458 (execute_csharp_program): Call it.
460 2006-06-21 Bruno Haible <bruno@clisp.org>
462 Avoid warnings from recent versions of mcs.
463 * csharpcomp.c (compile_csharp_using_mono): Don't use options
464 -o, -L, -r any more. Use options documented since mcs-1.0
465 instead. Similarly for -g.
467 2005-07-09 Bruno Haible <bruno@clisp.org>
469 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
471 Reported by Mark Junker <mjscod@gmx.de>.
473 2006-06-17 Bruno Haible <bruno@clisp.org>
475 * config.charset: Update for NetBSD 3.0.
477 2006-05-17 Bruno Haible <bruno@clisp.org>
480 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
482 2006-05-16 Bruno Haible <bruno@clisp.org>
484 * localcharset.c [CYGWIN]: Include <windows.h>.
485 (get_charset_aliases): For Cygwin, return the same CPxxx
486 aliases list as under WIN32.
487 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
488 the environment variables. Fall back to GetACP().
490 2006-04-05 Bruno Haible <bruno@clisp.org>
492 * config.charset: Update Juan Manuel Guerrero's address.
494 2005-02-12 Bruno Haible <bruno@clisp.org>
496 * allocsa.h: Add extern "C" for C++.
498 2005-02-10 Bruno Haible <bruno@clisp.org>
500 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
501 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
503 2006-07-22 Bruno Haible <bruno@clisp.org>
505 * gettext.h: Update to GNU gettext-0.15.
507 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
508 and Simon Josefsson <jas@extundo.com>
510 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
512 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
514 2006-07-21 Eric Blake <ebb9@byu.net>
516 * stdlib-safer.h: New file from coreutils, required by
519 2006-07-19 Derek R. Price <derek@ximbiot.com>
521 * getaddrinfo.h: Don't define unimplemented AI_* flags.
522 Reindent and repaginate.
524 2006-07-17 Bruno Haible <bruno@clisp.org>
526 * gl_list.h: New file.
527 * gl_list.c: New file.
528 * gl_array_list.h: New file.
529 * gl_array_list.c: New file.
530 * gl_carray_list.h: New file.
531 * gl_carray_list.c: New file.
532 * gl_linked_list.h: New file.
533 * gl_linked_list.c: New file.
534 * gl_anylinked_list1.h: New file.
535 * gl_anylinked_list2.h: New file.
536 * gl_avltree_list.h: New file.
537 * gl_avltree_list.c: New file.
538 * gl_anyavltree_list1.h: New file.
539 * gl_anyavltree_list2.h: New file.
540 * gl_rbtree_list.h: New file.
541 * gl_rbtree_list.c: New file.
542 * gl_anyrbtree_list1.h: New file.
543 * gl_anyrbtree_list2.h: New file.
544 * gl_anytree_list1.h: New file.
545 * gl_anytree_list2.h: New file.
546 * gl_linkedhash_list.h: New file.
547 * gl_linkedhash_list.c: New file.
548 * gl_anyhash_list1.h: New file.
549 * gl_anyhash_list2.h: New file.
550 * gl_avltreehash_list.h: New file.
551 * gl_avltreehash_list.c: New file.
552 * gl_rbtreehash_list.h: New file.
553 * gl_rbtreehash_list.c: New file.
554 * gl_anytreehash_list1.h: New file.
555 * gl_anytreehash_list2.h: New file.
557 * gl_oset.h: New file.
558 * gl_oset.c: New file.
559 * gl_array_oset.h: New file.
560 * gl_array_oset.c: New file.
561 * gl_avltree_oset.h: New file.
562 * gl_avltree_oset.c: New file.
563 * gl_rbtree_oset.h: New file.
564 * gl_rbtree_oset.c: New file.
565 * gl_anytree_oset.h: New file.
567 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
569 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
571 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
572 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
573 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
574 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
575 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
576 callers changed. Revamp internals significantly, by not
577 attempting to create directories that are temporarily more
578 permissive than the final results. Do not attempt to use
579 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
580 This removes some race conditions, fixes some bugs, and simplifies
581 things. Use new dirchownmod function to do owner and mode changes.
582 * mkdir-p.h: Likewise.
583 * modechange.c (octal_to_mode): New function.
584 (struct mode_change): New member mentioned.
585 (make_node_op_equals): New arg mentioned. All callers changed.
586 (mode_compile): Keep track of which mode bits the user has explicitly
588 (mode_adjust): New arg DIR, so that we implement the X op correctly.
589 New arg PMODE_BITS, to keep track of which mode bits the user
590 mentioned; it treats S_ISUID and S_ISGID speciall.
592 * modechange.h: Likewise.
594 2006-07-11 Derek R. Price <derek@ximbiot.com>
596 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
598 2006-07-10 Derek R. Price <derek@ximbiot.com>
600 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
601 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
602 macros into the GNU _D_EXACT_NAMLEN.
603 * savedir.c: Likewise.
604 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
606 2006-07-09 Jim Meyering <jim@meyering.net>
608 * argp-pv.c: Remove a doubled word in a comment.
609 * check-version.c (check_version): Likewise.
610 * javacomp.c (compile_java_class): Likewise.
612 2006-07-08 Jim Meyering <jim@meyering.net>
614 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
616 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
618 * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
619 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
620 brackets. Other minor changes to suppress some compiler
623 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
625 * getloadavg.c: Use __VMS, not VMS.
626 * getopt.c: Likewise.
627 * getpagesize.h: Likewise.
628 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
629 probably does not work.
631 2006-07-06 Derek R. Price <derek@ximbiot.com>
632 and Paul Eggert <eggert@cs.ucla.edu>
634 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
635 Don't worry about this obsolete case any more.
636 (HAVE_DIR): Remove. All uses removed; we now assume you can read
638 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
639 worry about this obsolete case any more.
641 * getcwd.c: Likewise.
643 * savedir.c: Likewise.
645 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
647 * .cppi-disable: Add wcwidth.
648 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
649 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
650 (ISGRAPH): Remove. All uses changed to isgraph.
651 (FOLD) [!defined _LIBC]: Remove special case.
652 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
653 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
655 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
657 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
659 * strtod.c (strtod): cast the argument of tolower to unsigned char.
661 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
663 * memcasecmp.c: Include <limits.h>.
664 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
665 * strtod.c (strtod): Don't assume isspace works on negative chars.
666 Don't assume isdigit succeeds only on '0' through '9'.
668 2006-07-05 Derek R. Price <derek@ximbiot.com>
670 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
671 All uses of is_space replaced by isspace.
672 * exit.h: Don't talk about STDC_HEADERS.
673 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
674 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
675 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
676 replaced by isprint etc.
677 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
678 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
679 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
680 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
681 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
682 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
684 2006-07-05 Eric Blake <ebb9@byu.net>
686 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
687 missing from netdb.h.
688 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
690 2006-06-27 Bruno Haible <bruno@clisp.org>
692 Assume ANSI C header files and <ctype.h> functions.
693 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
694 (mbsnwidth): Use isprint, iscntrl instead.
696 2006-07-03 Jim Meyering <jim@meyering.net>
698 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
699 macro is used before the first cycle_check call.
701 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
703 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
704 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
705 reported by Mark D. Baushke, one in
706 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
708 Merge from coreutils.
710 * .cppi-disable: Add stdint_.h.
711 * .cvsignore: Add stdint.h.
713 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
715 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
716 both double and long double versions.
717 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
718 * xstrtold.c: New file.
719 * xstrtod.h (xstrtold): New decl.
721 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
723 * filemode.c (setst): Remove.
724 (strmode): Rewrite to avoid setst. This makes the code shorter,
725 (arguably) clearer, and the generated code is a bit smaller on my
726 Debian GNU/Linux stable x86 host.
728 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
730 * filemode.c: Include "filemode.h" first, to test the interface.
731 Assume that filemode.h includes sys/types.h and sys/stat.h.
732 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
733 (ftypelet): Reorder to put common cases first, for efficiency.
734 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
736 (strmode): Renamed from mode_string, and now stores 12 bytes instead
737 of 10, for compatibility with FreeBSD. All callers changed.
738 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
739 that can't be deduced solely from st_mode. First arg is now a const
741 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
742 (strmode): Renamed from mode_string.
743 (filemodestring): New decl.
744 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
745 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
746 (S_ISPORT, S_ISWHT): New macros, if not already defined.
748 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
750 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
751 fsusage.h now does that. Include fsusage.h first, to test interface.
752 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
753 at most one method (the old code could have generated decls that
754 didn't conform to C89, not that this was ever exercised).
755 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
757 2006-03-19 Jim Meyering <jim@meyering.net>
759 Work even in a chroot where d_ino values for entries in "/"
760 don't match the stat.st_ino values for the same names.
761 * getcwd.c (__getcwd): When no d_ino value matches the target inode
762 number, iterate through all entries again, using lstat instead.
763 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
764 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
766 * getcwd.c (__getcwd): Clarify a comment.
767 Use memcpy in place of a call to strcpy.
769 2006-03-12 Jim Meyering <jim@meyering.net>
771 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
772 that of the current directory (which we're about to chdir ".." out of),
773 then save the dev-ino of the parent, instead.
775 * same-inode.h (SAME_INODE): New file/macro.
776 * chdir-safer.c (SAME_INODE): Remove definition.
777 Include "same-inode.h", instead.
779 * cycle-check.h: Include "same-inode.h".
780 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
781 * cycle-check.c (SAME_INODE): Remove definition.
782 * root-dev-ino.h: Include "same-inode.h".
784 2006-03-11 Eric Blake <ebb9@byu.net>
786 * same.c (same_name): s/base_name/last_component/
787 * backupfile.c (check_extension, numbered_backup): Likewise.
788 * filenamecat.c (file_name_concat): Likewise.
790 2006-03-11 Eric Blake <ebb9@byu.net>,
791 Paul Eggert <eggert@cs.ucla.edu>
793 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
794 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
796 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
797 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
798 (last_component): New method.
799 * dirname.c (dir_len): Determine when drive letters need a
800 subsequent slash. Preserve // when it is special.
801 (dir_name): Don't append dot when drive letter is absolute.
802 [TEST_DIRNAME]: Move into a full-blown gnulib test.
803 * basename.c (base_name): New semantics - malloc the result.
804 Preserve // when it is special. Preserve relative files that look
806 (base_len): Preserve // when it is special.
807 (last_component): New method, similar to old base_name semantics.
808 * stripslash.c (strip_trailing_slashes): Use last_component, not
809 base_name. Strip redundant slashes from ///.
811 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
813 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
814 both are 64 bits, since this seems to be the tradition, and this
815 prevents gcc -Wformat from warning about usages with PRIuMAX. If
816 we ever run into a host that prefers long long to long in this
817 case, we'll need another configure-time test. Problem reported by
820 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
822 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
823 possible collision with system files.
824 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
825 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
826 WCHAR_MIN and WCHAR_MAX in this case.
827 (<stddef.h>): Do not include; no longer needed.
828 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
829 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
830 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
831 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
832 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
833 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
834 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
835 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
836 !defined(__c99))]: Include in this case too, since it's harmless
838 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
840 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
841 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
842 (_STDINT_MIN, _STDINT_MAX): New macros.
843 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
844 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
845 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
846 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
847 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
848 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
849 macros, not typedefs; this simplifies things quite a bit.
850 Use long int for all types narrower than int64_t.
851 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
852 Define in terms of long long int or int64_t or long int,
853 not int64_t or int32_t. This saves some compile-time testing.
854 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
855 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
856 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
857 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
858 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
859 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
860 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
861 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
862 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
863 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
864 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
865 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
866 undef any previous version and define our own version, for
867 simplicity and consistency with the new macros for types.
868 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
869 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
870 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
871 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
872 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
873 @WINT_T_SUFFIX@ to keep things simple here.
874 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
875 Simplify by assuming typical 8/16/32/64 host, since we're
876 already doing that elsewhere anyway.
877 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
878 and assume long long int is 64 bits if available. This
879 speeds up 'configure'.
881 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
883 * getaddrinfo.c: fixed typo
885 2006-06-29 Eric Blake <ebb9@byu.net>
887 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
888 unused static function.
890 2006-06-29 Eric Blake <ebb9@byu.net>
894 2006-06-29 Derek R. Price <derek@ximbiot.com>
896 * strftime.c: Assume strftime() exists.
898 2006-06-28 Bruno Haible <bruno@clisp.org>
900 * getaddrinfo.h: Fix POSIX URL.
901 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
902 (use_win32_p): Make static.
903 (getaddrinfo): Reject service name if it is empty or does not consist
904 solely of decimal digits, or if its value is > 65535.
905 (getnameinfo): Remove useless casts.
907 2006-06-28 Derek R. Price <derek@ximbiot.com>
909 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
910 Autoconf 2.60 says this stuff was obsolete.
912 2006-05-12 Bruno Haible <bruno@clisp.org>
914 * mkdtemp.c [MINGW]: Include <io.h>.
915 (mkdir): Define using _mkdir.
917 2006-06-28 Bruno Haible <bruno@clisp.org>
919 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
920 declaration for wcwidth.
921 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
923 2006-06-28 Eric Blake <ebb9@byu.net>
925 * xvasprintf.h: Fix comments.
927 2006-06-28 Eric Blake <ebb9@byu.net>
929 * mbchar.h (wcwidth): Include wcwidth.h.
930 * mbswidth.c (wcwidth): Move from here...
931 * wcwidth.h: ...to this new file.
933 2006-06-28 Simon Josefsson <jas@extundo.com>
935 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
936 functions there. It will succeed on Windows XP, but on Windows
937 2000 and (presumably) earlier, it will fail, and use the internal
939 (use_win32_p): New function.
940 (getaddrinfo): Use strtoul on servname, to support numeric ports.
941 Support AI_NUMERICSERV to disable getservbyname.
942 (getnameinfo): New function, only supports
943 NI_NUMERICHOST|NI_NUMERICSERV for now.
945 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
946 only have some of them. Add AI_NUMERICSERV. Add prototype for
949 2006-06-27 Bruno Haible <bruno@clisp.org>
951 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
953 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
955 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
956 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
957 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
959 2006-06-26 Bruno Haible <bruno@clisp.org>
961 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
963 Reported by Mark D. Baushke and Larry Jones.
965 2006-06-26 Bruno Haible <bruno@clisp.org>
967 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
969 Suggested by Mark D. Baushke and Larry Jones.
971 2006-06-23 Mark D. Baushke <mdb@gnu.org>
973 * stdint_.h: Treat BSD/OS like OpenBSD.
975 2006-06-23 Bruno Haible <bruno@clisp.org>
977 * stdint_.h: Treat IRIX like OpenBSD.
979 2006-06-23 Bruno Haible <bruno@clisp.org>
981 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
982 ISO C 99 Technical Corrigendum 1.
984 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
986 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
987 Some compiler complained about some of them. Problem reported by
989 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
991 2006-06-21 Simon Josefsson <jas@extundo.com>
993 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
996 * socket_.h: Don't define WINVER.
998 * inet_pton.h, inet_pton.c: New file, taken from glibc but
999 slightly modified to work in gnulib.
1001 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1003 * read-file.c (fread_file): Start with buffer allocation of
1004 0 bytes rather than 1 byte; this simplifies the code.
1005 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1006 code to free buffer and save/restore errno.
1007 (internal_read_file): Remove unused local.
1009 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1011 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1012 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1013 Problem reported by Denis Excoffier in
1014 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1016 2006-06-19 Simon Josefsson <jas@extundo.com>
1018 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1020 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1022 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1024 2006-06-17 Bruno Haible <bruno@clisp.org>
1026 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1028 2006-06-17 Bruno Haible <bruno@clisp.org>
1030 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1031 problem on Solaris 2.5.1.
1033 2006-06-16 Eric Blake <ebb9@byu.net>
1035 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1036 * unicodeio.c [!defined errno]: Likewise.
1037 * strtol.c [!defined errno]: Likewise.
1038 * strtod.c [!defined errno]: Likewise.
1040 2006-06-15 Bruno Haible <bruno@clisp.org>
1042 * stdint_.h: Rewritten to be fully auto-configured.
1043 Fixes bug on HP-UX/IA64.
1045 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1047 * getdate.y (__attribute__): Don't define if already defined.
1048 Problem reported by Larry Jones.
1049 * utimens.c (__attribute__): Likewise.
1051 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1053 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1054 reported by Andreas Schwab.
1056 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1057 Bruno Haible <bruno@clisp.org>
1059 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1061 2006-05-26 Martin Lambers <marlam@marlam.de>
1063 * getpass.c: Updates the test for the native W32 API, and adds
1064 missing includes, thus fixing compilation warnings.
1066 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1068 * tempname.c (small_open, large_open): New macros.
1069 (__open, __open64) [!_LIBC]: Remove.
1070 (__gen_tempname): Use small_open and large_open instead of __open
1071 and __open64. This fixes a portability bug on HP-UX 11.11i
1072 reported by Simon Wing-Tang in
1073 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1075 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1077 * exclude.c (exclude_fnmatch): New function.
1078 (excluded_file_name): Call exclude_fnmatch.
1079 * exclude.h (excluded_file_name): New prototype
1081 2006-05-24 Bruno Haible <bruno@clisp.org>
1083 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1084 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1085 Reported by Thorsten Maerz <torte@netztorte.de> via
1086 Aaron Stone <aaron@serendipity.cx>.
1088 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1090 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1091 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1092 (my_usleep): Don't mishandle maximum value.
1094 2006-05-19 Jim Meyering <jim@meyering.net>
1096 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1098 2006-05-17 Bruno Haible <bruno@clisp.org>
1101 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1103 2006-05-17 Bruno Haible <bruno@clisp.org>
1105 * stdint_.h: Fix recognition of Cygwin.
1107 2006-05-11 Jim Meyering <jim@meyering.net>
1109 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1111 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1113 * crc.c (crc32_update): Remove unnecessary L suffix.
1114 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1115 unwanted sign propagation, e.g., on hosts with 64-bit int.
1116 There still are some problems with reeelly weird theoretical hosts
1117 (e.g., 33-bit int) but it's not worth worrying about now.
1118 * sha1.c (rol): Likewise.
1119 (K1, K2, K3, K4): Remove unnecessary L suffix.
1121 2006-05-10 Bruno Haible <bruno@clisp.org>
1123 * des.c: Cast to avoid warnings.
1125 2006-05-10 Simon Josefsson <jas@extundo.com>
1127 * md4.c: Typo fix, update copyright years.
1128 (K1, K2): Don't use L because it turn computations into 64-bit on
1131 2006-05-09 Bruno Haible <bruno@clisp.org>
1133 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1134 (EOVERFLOW): Define fallback value.
1135 (xstrcat): New function.
1136 (xvasprintf): Recognize the special case of a string concatenation.
1138 2006-05-01 Bruno Haible <bruno@clisp.org>
1140 * stdint_.h: Shorter URL.
1141 * inttypes.h: Likewise.
1143 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1145 * verify.h: Document the internals better. Most of this change
1146 was written by Bruno Haible.
1148 2006-04-29 Bruno Haible <bruno@clisp.org>
1150 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1151 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1153 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1155 * getdate.y (get_date): When adding relative date, start with the
1156 initial time, not with the result of the first mktime call.
1158 2006-04-23 Bruno Haible <bruno@clisp.org>
1160 * copy-file.c: Include <unistd.h> unconditionally.
1161 * execute.c: Likewise.
1162 * fatal-signal.c: Likewise.
1163 * findprog.c: Likewise.
1164 * mkdtemp.c: Likewise.
1167 * wait-process.h: Likewise.
1169 2006-04-23 Bruno Haible <bruno@clisp.org>
1171 * fwriteerror.c (fwriteerror): Call fclose also when an error
1172 condition was already detected.
1173 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1175 2006-04-19 Derek Price <derek@ximbiot.com>
1176 Eric Blake <ebb9@byu.net>
1178 * inttypes.h: Correct grammar in comment.
1180 2006-04-18 Derek Price <derek@ximbiot.com>
1181 Paul Eggert <eggert@cs.ucla.edu>
1183 * inttypes.h: New file.
1184 * strtoimax.c: Assume <inttypes.h>.
1186 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1188 * utimens.c (futimens): glibc futimesat messes up if /proc
1189 isn't mounted. Problem reported by Kir Kolyshkin.
1191 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1193 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1194 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1195 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1197 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1199 Merge regex changes from libc, removing some of our
1200 POSIX-conformance changes that were rejected and redoing them in a
1203 * regcomp.c (re_compile_internal, init_dfa):
1204 Length arg is now size_t, not Idx. All uses changed.
1205 (peek_token): Forward decl now says internal_function.
1206 (__re_error_msgid, __re_error_msgid_idx):
1207 Now static rather than extern with attribute_hidden.
1208 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1209 For some reason libc prefers K&R style defns for external functions.
1210 (regerror) [!defined _LIBC]: Likewise.
1211 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1212 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1213 (build_range_exp, build_collating_symbol):
1215 (re_compile_fastmap): Use '\0' to memset, not 0.
1216 (utf8_sb_map): Make the calculations more obvious.
1217 (init_dfa, parse_bracket_exp, build_charclass_op):
1218 Call calloc and cast result, as glibc does.
1219 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1220 (build_range_exp, build_collating_symbol):
1221 Now internal functions.
1223 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1225 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1226 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1227 Don't depend on VMS; depend on __VMS instead, for POSIX
1228 namespace cleanness.
1229 (regoff_t): Define to ssize_t, not long int.
1231 Remove the REG_ macros named below. Instead, make the old names
1232 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1234 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1235 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1236 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1237 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1238 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1239 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1240 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1241 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1242 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1243 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1244 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1245 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1246 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1247 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1248 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1249 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1250 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1252 Remove. All uses replaced by the old RE_* names.
1253 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1254 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1255 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1256 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1257 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1258 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1259 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1260 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1261 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1262 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1263 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1264 Don't bother having these macros be independent of each others'
1265 values, since they no longer exist in the POSIX name space.
1267 Rename the following member names back to their old names,
1268 unless !__USE_GNU_REGEX. All uses changed back.
1269 (buffer): Renamed from re_buffer.
1270 (allocated): Renamed from re_allocated.
1271 (used): Renamed from re_used.
1272 (syntax): Renamed from re_syntax.
1273 (fastmap): Renamed from re_fastmap.
1274 (translate): Renamed from re_translate.
1275 (can_be_null): Renamed from re_can_be_null.
1276 (regs_allocated): Renamed from re_regs_allocated.
1277 (fastmap_accurate): Renamed from re_fastmap_accurate.
1278 (no_sub): Renamed from re_no_sub.
1279 (not_bol): Renamed from re_not_bol.
1280 (not_eol): Renamed from re_not_eol.
1281 (newline_anchor): Renamed from re_newline_anchor.
1282 (num_regs): Renamed from rm_num_regs.
1283 (start): Renamed from rm_start.
1284 (end): Renamed from rm_end.
1286 (free_state): Move up a bit.
1288 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1289 #define to be empty.
1290 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1291 when that is what is intended.
1292 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1293 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1295 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1296 All uses changed back to re_malloc, etc. It's now the caller's
1297 responsibility to check for overflow; all callers changed.
1298 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1299 (re_x2nrealloc): Remove.
1300 (free_state): Remove decl.
1302 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1303 (re_set_registers, re_exec):
1306 2006-01-31 Roland McGrath <roland@redhat.com>
1308 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1309 Reported by Mike Frysinger <vapier@gentoo.org>.
1311 2006-01-15 Andreas Jaeger <aj@suse.de>
1314 * regex_internal.c (re_string_reconstruct): Adjust for
1315 build_wcs_upper_buffer change.
1316 (build_wcs_upper_buffer): Change return type.
1318 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1320 * regex_internal.h: Include <stdint.h> if available.
1322 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1324 * regex_internal.h (SIZE_MAX): Provide a default definition.
1326 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1328 * regcomp.c: Adjust for changed secondary hash function.
1330 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1332 * regex.h: Pretty printing.
1333 Clean up namespace a bit.
1335 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1337 * regexec.c (update_cur_sifted_state, check_arrival,
1338 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1340 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1341 Ulrich Drepper <drepper@redhat.com>
1344 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1345 (bitset_word_t): Renamed from bitset_word. All uses changed.
1347 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1350 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1351 * regcomp.c: Remove unnecessary uses of
1352 unsigned RE_TRANSLATE_TYPE.
1353 * regex_internal.h: Likewise.
1354 * regex_internal.c: Likewise.
1355 * regexec.c: Likewise.
1356 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1358 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1360 * regexec.c (find_recover_state): Remove unnecessary
1362 (transit_state_bkref): Make DFA a const pointer.
1363 (get_subexp): Likewise.
1364 (check_arrival): Likewise.
1365 (update_cur_sifted_state): Likewise.
1366 (re_search_internal): Likewise.
1367 (prune_impossible_nodes): Likewise.
1368 (acquire_init_state_context): Likewise.
1369 (proceed_next_node): Likewise.
1370 (set_regs): Likewise.
1371 (free_fail_stack_return): Likewise.
1372 (check_arrival_expand_ecl): Mark DFA parameter as const.
1373 (check_arrival_expand_ecl_sub): Likewise.
1374 (check_subexp_limits): Likewise.
1375 (sub_epsilon_src_nodes): Likewise.
1376 (add_epsilon_src_nodes): Likewise.
1377 (merge_state_array): Likewise.
1378 (update_regs): Likewise.
1379 (build_trtable): Likewise.
1380 (sift_states_backward): Mark MCTX parameter as const.
1381 (build_sifted_states): Likewise.
1382 (update_cur_sifted_state): Likewise.
1383 (sift_states_mkref): Likewise.
1384 (check_arrival_expand_ecl): Mark eclosure as const.
1385 (check_dst_limits_calc_pos_1): Likewise.
1386 * regex_internal.h (re_match_context_t): Make dfa a const
1389 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1391 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1392 (transit_state_sb): Likewise.
1393 (transit_state_mb): Likewise.
1394 (sift_states_iter_mb): Likewise.
1395 (check_arrival_add_next_nodes): Likewise.
1396 (check_node_accept_bytes): Change first parameter to pointer-to-const.
1397 [_LIBC] (re_search_2_stub): Use mempcpy.
1399 * regex_internal.c (re_string_reconstruct): Avoid calling
1400 mbrtowc for very simple UTF-8 case.
1402 * regex_internal.c (re_acquire_state): Make DFA pointer arg
1404 (re_acquire_state_context): Likewise.
1405 * regex_internal.h: Adjust prototypes.
1407 * regex.c: Prevent using C++ compilers.
1409 * regex_internal.c (re_acquire_state): Minor code rearrangement.
1410 (re_acquire_state_context): Likewise.
1412 2006-03-29 Mark D. Baushke <mdb@gnu.org>
1413 Bruno Haible <bruno@clisp.org>
1415 * stdint_.h: On OpenBSD, don't redefine types already included in
1416 <sys/types.h> and <inttypes.h>.
1418 2006-03-24 Eric Blake <ebb9@byu.net>
1420 * time_r.c (copy_string_result): Remove, as it is no longer used.
1422 2006-03-24 Simon Josefsson <jas@extundo.com>
1424 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1425 including some doc fixes.
1426 (base64_encode_alloc): Fix +1 bug on allocation failures.
1428 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1430 * base64.c (base64_encode): Do not read past end of array with
1431 unsanitized input on systems with CHAR_BIT > 8.
1433 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1435 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1436 Typedef to long int, not to off_, as POSIX will likely change
1439 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
1441 * argp-help.c (validate_uparams): Fix typo
1442 * argp-parse.c (argp_default_options): Consistently begin help
1443 messages with a lowercase letter.
1445 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
1447 * time_r.h (asctime_r, ctime_r): Remove. These functions can
1448 overrun buffers and shouldn't be used (much as gets shouldn't be
1450 * time_r.c (asctime_r, ctime_r): Likewise.
1452 2006-03-08 Simon Josefsson <jas@extundo.com>
1454 * gc-gnulib.c (randomize): Don't open files called 'no', they
1455 signal that configure disabled the device.
1457 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
1459 * c-stack.c: Include unistd.h unconditionally, since we now assume
1461 * getlogin_r.c: Likewise.
1462 * getlogin_r.h: Likewise.
1464 * pagealign_alloc.c: Likewise.
1465 * unistd_.h: Remove; no longer needed.
1467 2006-03-07 Simon Josefsson <jas@extundo.com>
1469 * unistd_.h: New file.
1471 2006-03-07 Simon Josefsson <jas@extundo.com>
1473 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1475 2006-03-01 Simon Josefsson <jas@extundo.com>
1477 * readline.c: Fix typo, tiny patch from Stepan Kasal
1480 2006-02-28 Simon Josefsson <jas@extundo.com>
1482 * getopt.c: Protect #include of unistd.h, for MSVS.
1484 2006-02-27 Simon Josefsson <jas@extundo.com>
1486 * base64.h: Indent #define's. From Jim Meyering
1489 2006-02-27 Jim Meyering <jim@meyering.net>
1491 Revert the change of 2006-02-24, so these files can continue
1492 to be sync'd from gettext.
1493 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1496 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
1498 * glob.c: Say "invalid" rather than "illegal" in comments.
1500 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1502 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1504 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
1506 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1507 AT_FDCWD exceeds INT_MAX.
1508 * openat.h (AT_FDCWD): Likewise.
1510 2006-02-14 Jim Meyering <jim@meyering.net>
1512 Sync from coreutils.
1514 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1515 failure on deficient systems, and simplify gnulib lgpl dependencies.
1516 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1517 xmalloc/lstat combination. Based on a patch from Bruno Haible.
1519 * xalloc-die.c: Remove unused definition of N_.
1521 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
1523 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1525 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
1527 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1528 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1530 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
1532 * argp-namefrob.h: Restore changes accidentally lost during the
1533 "autoupdate" on 2005-12-12.
1535 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1537 * fnmatch.c (L_): Renamed from L, to work around a bug in
1538 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1539 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1542 2006-01-26 Simon Josefsson <jas@extundo.com>
1544 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1545 prototype is visible on mingw32.
1547 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1550 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1553 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
1555 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
1556 attempt to open for write; this always fails, at least on POSIX
1557 hosts. This reinstates the 2006-01-09 change, which was
1558 inadvertently removed.
1560 2006-01-26 Bruno Haible <bruno@clisp.org>
1561 Paul Eggert <eggert@cs.ucla.edu>
1563 * stdbool_.h (_Bool)
1564 [(! (defined __cplusplus || defined __BEOS__)
1565 && !defined __GNUC__
1566 && !(defined __HP_cc || defined __xlc__
1567 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1568 || defined __sgi))]:
1569 #define to signed char in these cases too; this simplifies
1570 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1571 etc., separately) and makes it more conservative.
1573 2006-01-21 Jim Meyering <jim@meyering.net>
1575 Sync from the stable (b5) branch of coreutils:
1577 * fts.c (fts_children): Don't let close() clobber errno from
1580 * fts.c (fts_stat): When following a symlink-to-directory,
1581 don't necessarily interpret stat-fails+lstat-succeeds as indicating
1582 a dangling symlink. That can also happen at least for ELOOP.
1583 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1584 FYI, this bug predates the inclusion of fts.c in coreutils.
1586 * fts.c (fts_open): Put new maxarglen declaration and uses
1587 in their own block, so pre-c99 compilers don't object.
1589 Avoid the double-free (first in fts_read, second in fts_close) that
1590 would occur when an `active' directory is made inaccessible (e.g.,
1591 via chmod a-x) during a traversal.
1592 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1593 before returning. Reproduce this failure by
1594 mkdir -p a/b; cd a; chmod a-x . b
1595 Reported by Stavros Passas.
1597 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
1599 * argp-namefrob.h: Bugfix. Remove stray #
1601 2006-01-25 Bruno Haible <bruno@clisp.org>
1603 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1605 Reported by Paul Eggert.
1607 2006-01-25 Jim Meyering <jim@meyering.net>
1609 * fileblocks.c: Remove more useless parentheses.
1610 * readutmp.h: Likewise.
1612 2006-01-24 Bruno Haible <bruno@clisp.org>
1614 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1616 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
1619 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1620 to avoid problems with the built-in _Bool type.
1621 Reported by Paul Eggert on 2005-11-26.
1623 2006-01-24 Jim Meyering <jim@meyering.net>
1625 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1627 2006-01-24 Simon Josefsson <jas@extundo.com>
1629 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1632 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1634 Work around porting bugs reported by Dieter in
1635 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1636 * getopt.c (_NOPROTO): Remove; no longer needed.
1637 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1638 Include "getopt.h" first, to check interface.
1639 (getenv): Declare only if defined HAVE_DECL_GETENV &&
1641 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1642 (__strndup): Revert to K&R-style function dfns, the glibc style.
1643 * strnlen.c: Don't claim it's taken from glibc; it's not.
1644 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1645 Include strnlen.h first, to get prototype properly.
1646 (strnlen): Renamed from __strnlen.
1649 2006-01-23 Ulrich Drepper <drepper@redhat.com>
1651 These changes imported from libc.
1652 * getopt.c: Use __fxprintf instead of inline stream orientation
1653 test and two separate function calls.
1654 * strndup.c (__strndup): Add libc_hidden_def.
1656 2006-01-22 Bruno Haible <bruno@clisp.org>
1658 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1659 temporary buffer for sprintf, take into account the precision also
1660 for 'd', 'i', 'u', 'o', 'x', 'X'.
1662 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1664 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1665 to pacify gcc -Wswitch-default.
1667 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
1669 * argp-help.c (usage_long_opt): Do not print DOC options.
1670 (__argp_base_name): Removed
1671 * argp-namefrob.h (__argp_basename): Removed definition. Was a
1673 (__argp_base_name): Provide macro definition or extern declaration
1674 depending on the configuration
1676 2006-01-20 Simon Josefsson <jas@extundo.com>
1678 * inet_ntop.h: Unconditionally include sys/socket.h.
1680 2006-01-19 Simon Josefsson <jas@extundo.com>
1682 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1684 2006-01-12 Simon Josefsson <jas@extundo.com>
1686 * base64.c: Fix warning, reported by Bruno Haible
1687 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1689 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
1691 Sync from coreutils.
1692 * md5.c: Fix commentary typos.
1693 (alignof, UNALIGNED_P): No need for a GCC-specific version.
1694 * md5.h (__attribute__): Remove; unused.
1695 * sha1.c: Fix commentary to match md5 better.
1696 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1697 so that we don't need to worry about alignment. All uses changed.
1698 This merges the 2005-10-28 md5 change into sha1.
1700 2006-01-11 Jim Meyering <jim@meyering.net>
1702 Sync from coreutils.
1703 * md5.c (OP): Fix spacing.
1705 2006-01-11 Simon Josefsson <jas@extundo.com>
1707 * stdint_.h (SIZE_MAX): Add missing (.
1709 2006-01-10 Bruno Haible <bruno@clisp.org>
1711 * argp.h (__const): Remove macro. Use const instead.
1712 * argp-fmtstream.h (__const): Likewise.
1713 * glob_.h (__const): Remove macro.
1714 * glob-libc.h: Use const instead of __const.
1716 2006-01-10 Jim Meyering <jim@meyering.net>
1718 Avoid the double-free (first in fts_read, second in fts_close) that
1719 would occur when an `active' directory is made inaccessible (e.g.,
1720 via chmod a-x) during a traversal.
1721 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1722 before returning. Reproduce this failure by
1723 mkdir -p a/b; cd a; chmod a-x . b
1724 Reported by Stavros Passas.
1726 Sync from coreutils.
1727 * sha1.c: Tweak grammar in a comment.
1729 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
1731 * regex_internal.h (BITSET_WORD_BITS):
1732 Work around a bug in 64-bit PGC (before version 6.1-2), where the
1733 preprocessor mishandles large unsigned values as if they were signed.
1734 Problem reported by Claudio Fontana in
1735 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1737 2006-01-10 Simon Josefsson <jas@extundo.com>
1739 * socket_.h: New file.
1741 2006-01-10 Bruno Haible <bruno@clisp.org>
1743 * localcharset.c: Update from GNU gettext.
1745 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
1747 Sync from coreutils.
1748 * chdir-long.c (cdb_free): Don't bother trying to open directory
1749 for write access: POSIX says that must fail.
1750 * fts.c (diropen): Likewise.
1751 * save-cwd.c (save_cwd): Likewise.
1752 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1753 well, for minor improvements on hosts that lack O_DIRECTORY.
1754 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1755 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1756 Fall back on chown if open failed with EACCES.
1758 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1759 Report an error at compile-time if only a 1-second nominal clock
1760 resolution is found.
1762 * lchmod.h: New file.
1763 * mkdir-p.c: Include lchmod.h, lchown.h.
1764 (make_dir_parents): Use lchown rather than chown, and
1765 lchmod rather than chmod.
1767 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1768 too. Problem with "none" reported by Bob Proulx. Problem with
1769 "proc" reported by n0dalus.
1771 * mountlist.c: Include <limits.h>.
1772 (dev_from_mount_options)
1773 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1774 New function. It no longer assumes "dev=" has the System V meaning
1775 on Linux (since it doesn't). It also parses "dev=" more carefully.
1776 (read_file_system_list)
1777 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1778 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1781 * posixtm.h (PDS_PRE_2000): New macro.
1782 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1783 All usages changed. Reject dates outside the range 1969-1999 if
1784 PDS_PRE_2000 is used.
1786 2006-01-09 Jim Meyering <jim@meyering.net>
1788 Sync from coreutils.
1790 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1792 * chdir-safer.h, chdir-safer.c: New files.
1794 * modechange.c (mode_compile): Reject an invalid mode string
1795 that starts with an octal digit. From Andreas Gruenbacher.
1797 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1798 and dup to open_safer and dup_safer, respectively.
1799 (openat_permissive): Fix typo in comment.
1801 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1802 "gettext.h"; either no longer needed or are guaranteed by openat.h.
1803 (_): Remove; no longer needed.
1804 (openat): Renamed from rpl_openat; no need for rpl_openat
1805 since openat.h renames openat for us.
1806 Replace most of the body with a call to openat_permissive,
1807 to avoid duplicate code.
1808 Port to (probably hypothetical) environments were mode_t is
1810 (openat_permissive): Require mode arg, so that we can check
1811 types better. Put it just after flags. Change cwd failure
1812 indicator from pointer-to-bool to pointer-to-errno-value.
1813 All callers changed.
1814 Invoke openat_save_fail and/or openat_restore_fail if
1815 cwd_errno is null, so that openat can call us.
1816 (openat_permissive, fdopendir, fstatat, unlinkat):
1817 Simplify errno handling to avoid some duplicate code,
1818 as it's OK to set errno on success.
1819 * openat.h: Revamp code so that function macros depend on
1820 __OPENAT_PREFIX only, not also on AT_FDCWD.
1821 (openat_ro): Remove. Caller changed to use openat_permissive.
1822 (openat_permissive): Now a macro, if not a function.
1823 (openat_restore_fail, openat_save_fail): Now always functions,
1824 since mkdirat needs them even if __OPENAT_PREFIX is defined.
1826 * openat-priv.h: New file, defining macros used by mkdirat.c
1828 * mkdirat.c: Include openat-priv.h.
1829 Remove definitions of macros defined therein.
1830 * openat.c: Likewise.
1832 * mkdirat.c (mkdirat): New file and function.
1833 * openat.h (mkdirat): Declare.
1835 * openat.c (fdopendir): Don't change errno when returning non-NULL.
1837 * openat.h (openat_permissive): Declare.
1838 (openat_ro): Define.
1840 * openat.c (EXPECTED_ERRNO): New macro.
1841 (openat_permissive): New function -- used in remove.c rewrite.
1842 (all functions): Set errno just before returning, only if there
1843 was an actual failure.
1844 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1846 Emulate openat-family functions using Linux's procfs, if possible.
1847 Idea and some code based on Ulrich Drepper's glibc changes.
1849 * openat.c: (BUILD_PROC_NAME): New macro.
1850 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1851 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1852 before falling back on save_cwd and restore_cwd.
1853 (fdopendir, fstatat, unlinkat): Likewise.
1855 * openat.c (fstatat, unlinkat): Perform the syscall directly,
1856 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1858 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1859 as second argument to va_arg. Otherwise, some versions of gcc
1860 warn that `if this code is reached, the program will abort'.
1862 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
1864 Sync from coreutils.
1866 Add POSIX ACL support
1867 * acl.h (copy_acl, set_acl): Add declarations.
1868 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1869 systems other than Linux.
1870 (chmod_or_fchmod): New function: use fchmod when possible,
1871 and chmod otherwise.
1872 (file_has_acl): Add a POSIX ACL implementation, with a
1873 Linux-specific subcase.
1874 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1875 S_ISVTX from one file to another. Fall back to fchmod/chmod when
1876 acls are unsupported.
1877 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1878 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
1881 2006-01-09 Bruno Haible <bruno@clisp.org>
1883 * sysexit_.h (EX_OK): New macro.
1884 Suggested by Martin Lambers <marlam@marlam.de>.
1886 2006-01-09 Bruno Haible <bruno@clisp.org>
1888 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1889 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1890 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1891 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1893 2006-01-09 Bruno Haible <bruno@clisp.org>
1895 * stdint_.h (SIZE_MAX): Write the value without involving negative
1898 2005-10-16 Bruno Haible <bruno@clisp.org>
1900 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1901 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1903 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
1905 * strftime.c (tzname): Don't declare if it is already #defined.
1906 Problem reported for Mingw by Mark Junker.
1908 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1910 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1911 long int, not int, for nanosecond counts, so that people who are
1912 used to POSIX struct timespec won't be surprised. Reported by Jim
1915 2005-12-16 Jim Meyering <jim@meyering.net>
1917 * fprintftime.c, fprintftime.h: New files.
1919 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
1921 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1922 * argp-help.c (fill_in_uparams): Check if the constructed
1923 struct uparams is valid. Fall back to the default values if it is
1926 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
1928 * argp-help.c (__argp_base_name): New function
1929 (__argp_short_program_name): Rewrite using __argp_base_name
1930 * argp-namefrob.h: Define program_invocation_name and
1931 program_invocation_short_name if requested
1932 (__argp_base_name): Add prototype
1933 * argp-parse.c (argp_def): Use gettext wrappers
1934 (argp_default_parser): Use __argp_base_name
1935 * argp-pin.c: New file. Defines program_invocation_name and
1936 program_invocation_short_name on systems that lack them.
1938 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
1940 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1941 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1942 porting problem reported by Georg Schwarz in
1943 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1945 2005-07-09 Bruno Haible <bruno@clisp.org>
1947 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1948 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1949 Reported by Mark Junker <mjscod@gmx.de>.
1951 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
1953 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1954 (uintmax_t) [defined uintmax_t]: Do not declare.
1955 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1956 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1957 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
1958 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1959 sake of portability to weird hosts that C allows (though we don't
1960 know of any practical examples).
1962 * savedir.h (fdsavedir): New decl.
1963 * savedir.c (fdsavedir, savedirstream): New functions; the latter
1964 contains most of the former guts of savedir.
1965 (savedir): Use savedirstream.
1968 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
1970 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1971 coreutils no longer futzes with rounding modes.
1973 2005-11-14 Jim Meyering <jim@meyering.net>
1975 * mkstemp-safer.c: Include <config.h>, required for possible
1976 replacement of mkstemp.
1978 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
1980 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1982 (gethrxtime) [! (HAVE_NANOUPTIME
1983 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1984 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1985 our own approximation.
1987 2005-11-10 Simon Josefsson <jas@extundo.com>
1989 * readline.c: Remove EOL.
1991 2005-11-08 Eric Blake <ebb9@byu.net>
1993 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1995 2005-11-08 Eric Blake <ebb9@byu.net>
1997 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1999 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2001 Fix porting problem reported by Theodoros V. Kalamatianos.
2002 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2003 Don't assume that futimes failing means we must fail.
2005 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2007 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2008 leave errno alone. Problem reported by Dmitry V. Levin.
2010 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2012 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2013 errno alone. Problem reported by Frederic Jolliton.
2015 2005-10-28 Simon Josefsson <jas@extundo.com>
2017 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2018 "restrict" keywords, as per POSIX. Protect the function
2019 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2020 Don't use K&R prototypes. Check the sprintf return values.
2021 Re-define EAFNOSUPPORT if not present. Indent.
2023 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2024 suggested by Bruno Haible <bruno@clisp.org>.
2026 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2028 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2030 * gc-libgcrypt.c: Add MD2 (which is not available through
2033 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2035 * md2.h, md2.c: New files.
2037 2005-10-24 Simon Josefsson <jas@extundo.com>
2039 * md4.h: Shrink buffer size, now that we changed the type.
2041 2005-10-22 Simon Josefsson <jas@extundo.com>
2043 * arcfour.h, arcfour.c: Use fixed size indices in the
2044 arcfour_context struct (simplify test vector testing in GNU
2047 2005-10-22 Simon Josefsson <jas@extundo.com>
2049 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2050 suggested by Bruno Haible <bruno@clisp.org>.
2052 2005-10-22 Simon Josefsson <jas@extundo.com>
2054 * crc.h: Include stddef.h, for size_t.
2056 2005-10-21 Simon Josefsson <jas@extundo.com>
2058 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2059 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2061 2005-10-21 Simon Josefsson <jas@extundo.com>
2063 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2066 2005-10-21 Simon Josefsson <jas@extundo.com>
2068 * gc-gnulib.c: Support ARCTWO in CBC mode.
2070 2005-10-21 Simon Josefsson <jas@extundo.com>
2072 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2075 * hmac-sha1.c (hmac_sha1): Likewise.
2077 * crc.c (crc32_update): Actually use crc parameter, suggested by
2078 Bruno Haible <bruno@clisp.org>.
2080 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2083 2005-10-21 Simon Josefsson <jas@extundo.com>
2085 * des.h, des.c: New files.
2087 * gc-gnulib.c: Support DES.c
2089 2005-10-21 Simon Josefsson <jas@extundo.com>
2091 * arctwo.h, arctwo.c: New files.
2093 * gc-gnulib.c: Support ARCTWO.
2095 2005-10-21 Simon Josefsson <jas@extundo.com>
2097 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2099 2005-10-19 Simon Josefsson <jas@extundo.com>
2101 * gc-gnulib.c: Support ARCFOUR.
2103 2005-10-19 Simon Josefsson <jas@extundo.com>
2105 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2108 * gc.h: Add ECB enum type.
2110 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2112 2005-10-19 Simon Josefsson <jas@extundo.com>
2114 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2116 2005-10-18 Simon Josefsson <jas@extundo.com>
2118 * md4.h, md4.c: New files, based on md5.?.
2120 2005-10-17 Simon Josefsson <jas@extundo.com>
2122 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2124 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2126 2005-10-17 Simon Josefsson <jas@extundo.com>
2128 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2130 2005-10-17 Simon Josefsson <jas@extundo.com>
2132 * gc.h, gc-libgcrypt.c: Add ciphers.
2134 2005-10-17 Simon Josefsson <jas@extundo.com>
2136 * sha1.c: Use uint32_t instead of md5_uint32.t
2138 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2141 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2143 * md5.h: Use stdint.h and uint32_t. Doc fix.
2145 2005-10-15 Simon Josefsson <jas@extundo.com>
2147 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2149 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2151 2005-10-14 Simon Josefsson <jas@extundo.com>
2153 * arcfour.h, arcfour.c: New files.
2155 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2157 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2158 include <wchar.h>; no longer needed.
2160 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2161 and Ulrich Drepper <drepper@redhat.com>
2164 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2165 instead of inline stream orientation test and two separate
2166 function calls. Pay no attention to USE_IN_LIBIO.
2168 2005-10-14 Roland McGrath <roland@redhat.com>
2170 Import from libc. [BZ #1331]
2171 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2173 Reported by Matej Vela <vela@debian.org>.
2175 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2177 * mkdir-p.c (make_dir_parents): Don't report an error if an
2178 intermediate directory is in a read-only file system. Problem
2179 reported by Eric Blake.
2181 2005-10-13 Simon Josefsson <jas@extundo.com>
2183 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2184 Move memory allocation outside of loop.
2186 2005-10-12 Simon Josefsson <jas@extundo.com>
2188 * gc-pbkdf2-sha1.c: New file.
2190 * gc.h: Add gc_pbkdf2_sha1 prototype.
2192 2005-10-12 Simon Josefsson <jas@extundo.com>
2194 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2195 suggested by Bruno Haible <bruno@clisp.org>.
2197 2005-10-12 Simon Josefsson <jas@extundo.com>
2199 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2201 * gc-gnulib.c (gc_hmac_sha1): New function.
2203 2005-10-12 Simon Josefsson <jas@extundo.com>
2205 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2207 2005-10-12 Simon Josefsson <jas@extundo.com>
2209 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2210 GC_USE_HMAC_MD5, respectively.
2212 * gc-libgcrypt.c (gc_md5): Fix assert call.
2215 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2217 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2219 * gc-gnulib.c (gc_hash_buffer): Ditto.
2221 2005-10-11 Bruno Haible <bruno@clisp.org>
2223 * c-strcasestr.h: New file, from GNU gettext.
2224 * c-strcasestr.c: New file, from GNU gettext.
2226 2005-10-11 Bruno Haible <bruno@clisp.org>
2228 * c-strcase.h: New file, from GNU gettext.
2229 * c-strcasecmp.c: New file, from GNU gettext.
2230 * c-strncasecmp.c: New file, from GNU gettext.
2232 2005-10-11 Simon Josefsson <jas@extundo.com>
2234 * crc.h, crc.c: New files.
2236 * gc.h (gc_hash_buffer): Add doc.
2238 2005-10-08 Simon Josefsson <jas@extundo.com>
2240 * gc.h: Add gc_hash and gc_hash_buffer.
2242 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2244 * gc-libgcrypt.c (gc_hash_buffer): Add.
2246 2005-10-11 Bruno Haible <bruno@clisp.org>
2248 * strcasecmp.c: Include limits.h.
2249 (strcasecmp): Avoid integer overflow on exotic platforms.
2250 * strncasecmp.c: Include limits.h.
2251 (strncasecmp): Avoid integer overflow on exotic platforms.
2252 Reported by Paul Eggert.
2254 2005-10-06 Simon Josefsson <jas@extundo.com>
2256 * hmac-md5.c: New file.
2260 2005-10-06 Simon Josefsson <jas@extundo.com>
2262 * memxor.c (memxor): Avoid casts and warnings.
2264 2005-10-05 Derek Price <derek@ximbiot.com>
2266 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2268 2005-10-05 Simon Josefsson <jas@extundo.com>
2270 * memxor.c (memxor): Fix compiler error.
2272 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2273 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2275 * memxor.h, memxor.c: New files.
2277 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2278 we assume all systems have it, suggested by Jim Meyering
2279 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2280 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2281 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2284 2005-10-04 Bruno Haible <bruno@clisp.org>
2286 * verify.h (verify_true): Provide alternative definition for C++.
2288 2005-10-04 Simon Josefsson <jas@extundo.com>
2290 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2291 D. Baushke" <mdb@gnu.org>.
2293 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2295 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2296 (SSIZE_MAX): New macro, if not already defined.
2297 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2300 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2302 * exclude.c: Include verify.h.
2303 (verify): Remove. All callers changed to use verify.h's version.
2304 * strtoimax.c: Likewise.
2305 * utimecmp.c: Likewis.e
2307 Sync from coreutils.
2308 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2309 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2310 * .cvsignore: Add fts.h, search.h, t-fpending.
2311 * settime.c (settime): Fix { typo in previous patch. Also, don't
2312 bother returning ENOSYS if settimeofday or stime fails; just let
2313 them return whatever errno they want to return.
2314 * utimens.c: Include unistd.h, for dup2.
2315 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2316 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2318 2005-10-02 Jim Meyering <jim@meyering.net>
2320 Sync from coreutils.
2321 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2322 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2323 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2324 Remove AT_FDCWD test.
2325 Do not consume the fd unless successful.
2326 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2327 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2328 block, so that we don't even try to compile it if settimeofday is
2329 available. This works around a compilation failure on OSF1 V5.1,
2330 due to stime requiring a `long int*' while tv_sec is `int'.
2332 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2334 * getdelim.c (getdelim): Remove unused variables.
2336 2005-10-01 Simon Josefsson <jas@extundo.com>
2338 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2339 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2340 AI_* and EAI_* definitions. Protect function declarations.
2342 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2344 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2345 so that the code works even with ancient cpp. Portability problem
2346 with GCC 2.7.2.1 reported by Thomas M.Ott.
2348 2005-09-27 Jim Meyering <jim@meyering.net>
2350 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2352 * intprops.h (signed_type_or_expr__): Define.
2353 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2356 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2358 * verify.h (verify_expr): Remove, replacing with:
2359 (verify_true): New macro that returns true instead of void.
2360 (verify_type__): Remove.
2361 (verify): Use verify_true rather than verify_type__.
2363 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2365 * utimens.c (ENOSYS): Define if not already defined.
2366 (futimens): Support having a null PATH if the file descriptor
2369 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2371 (__attribute): Define to empty unless GCC 3.1 or later.
2372 This works around a core dump on OpenBSD 3.4, which has GCC
2373 2.95.3, which dumps core when given __attribute__(()). It also
2374 simplifies other tests, since we really don't want to bother with
2375 worrying about which ancient version of GCC supported what.
2376 Original problem reported by Yoann Vandoorselaere, with part of
2377 the fix suggested by Derek Price.
2379 2005-09-24 Jim Meyering <jim@meyering.net>
2381 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2382 so we can once again use a positive bitfield width of 1 -- now we
2383 don't have to explain why we were using a bitfield width of 2.
2385 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2387 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2388 Problem reported by Eric Blake.
2389 (getaddrinfo): Initialize se so that it's not garbage.
2390 Redo internal storage allocation so that it doesn't make unportable
2391 assumptions about alignment.
2394 * utimens.c (futimens): Use futimesat if available.
2395 Prefer it to futimes since it doesn't have the futimes bug.
2397 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2398 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2399 Instead, declare a function that returns a pointer to an array,
2400 and use verify_type__ to declare the size of the array.
2401 Problem and germ of a solution reported by Bruno Haible.
2402 (verify_type__): Use 2, not 1, for bitfield size, to avoid
2403 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
2405 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
2407 Sync from coreutils.
2409 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2411 * argmatch.h: Include verify.h
2412 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2413 (ARGMATCH_ASSERT): Remove; unused.
2414 * canonicalize.c: Assume STDC_HEADERS.
2415 * exclude.c: Include "strcase.h".
2416 * regex_internal.h [!defined _LIBC]: Likewise.
2417 * getusershell.c: Include stdio--.h rather than stdio.h
2419 (getusershell): Call fopen, not fopen_safer.
2420 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2421 Do not include unistd-safer.h.
2422 (save_cwd): Don't call fd_safer; no longer needed
2423 now that we include fcntl--.h.
2425 * getdate.y (relative_time): New type.
2426 (RELATIVE_TIME_0): New constant.
2427 (parser_control): Use relative_time instead of doing it ourselves.
2428 (%union): Add new relative_time rel member.
2429 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2431 (relunit, relunit_snumber): Now of type rel.
2432 (zone, rel, relunit, get_date): Adjust to above changes.
2434 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2435 Do not include unistd-safer.h.
2436 (getloadavg): Don't call fd_safer; no longer needed
2437 now that we include fcntl--.h.
2439 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2440 (make_dir_parents): Treat ENOSYS like EEXIST.
2442 Improve quality of diagnostics on restore_cwd failure.
2443 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
2444 (make_dir_parents): Last arg is now int * (for errno), not bool *.
2445 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2446 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2447 each time through the loop. Do not diagnose restore_cwd failure;
2448 that is the caller's job (and perhaps the caller does not care).
2450 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2451 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2452 If the file already exists but is not a directory, don't bother
2453 to try to make its parents.
2454 Close potential file descriptor leak if we can't chdir("/") (!).
2455 Don't always return true if chdir($PWD) fails; return true only
2456 if the requested action was done successfully (except for the
2458 Don't log final directory unless we actually made it.
2459 Refactor to avoid duplicate code to fix up permissions.
2460 Don't attempt to fix up parent permissions if chdir($PWD) fails.
2462 * strftime.c (my_strftime): Rewrite the previous change slightly,
2463 to make it a bit faster and (I hope) clearer.
2464 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2465 Fix bug in formats like %2N.
2467 * verify.h: New file.
2469 2005-09-22 Jim Meyering <jim@meyering.net>
2471 Sync from coreutils.
2473 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2475 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2476 the .tm_year member, since otherwise gcc-4.0 would now warn about
2477 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2479 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2480 order to avoid an unsuppressible warning from gcc on 64-bit systems.
2482 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2483 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2484 when run in a time zone for which daylight savings time is in effect
2485 for the starting date.
2487 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2488 stop us from restricting permissions of just-created absolute-named
2490 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2491 to restore initial working directory.
2492 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2493 to tell caller if/when we change the working directory and are
2494 unable to return to the initial one.
2495 * mkdir-p.h (make_dir_parents): Update prototype.
2496 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2497 `return false'. This fixes a bug introduced on 2004-07-30.
2499 * openat.c (fdopendir): Be sure to close the supplied
2500 file descriptor before returning. This makes our replacement
2501 implementation a little closer to Solaris's, where fdopendir
2502 ties the file descriptor to the returned DIR* pointer.
2503 * openat.c (unlinkat): New function.
2504 * openat.h (unlinkat): Add prototype.
2505 * openat-die.c (openat_save_fail): Rename from openat_save_die.
2506 (openat_restore_fail): Rename from openat_restore_die.
2507 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2509 Provide an alternative to exiting immediately upon save_cwd or
2510 restore_cwd failure. Now, an application can arrange e.g.,
2511 to perform a longjump in that case.
2512 * openat.c: Include dirname.h.
2513 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2514 (rpl_openat, fdopendir, fstatat): Call openat_save_die
2515 and openat_restore_die rather than calling error directly.
2516 Don't include "error.h" or "exitfail.h"; they're no longer needed.
2518 * openat-die.c (openat_save_die, openat_restore_die): New file.
2519 * openat.h (openat_save_die, openat_restore_die): Declare and define.
2521 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2522 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2523 int utc, int nanoseconds);
2525 date should not have to allocate a megabyte of virtual memory to
2526 handle a format argument like +%1048575T. When implemented with
2527 strftime, it must allocate such a buffer, use strftime to fill it
2528 in, print it, then free it.
2529 With fprintftime, it simply prints everything and exits.
2530 With no need for memory allocation, that's one fewer way to fail.
2531 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2532 optional field width, not before, so we accept %9:z, not %:9z.
2533 (my_strftime): Be sure to use L_('x') for literals.
2535 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2536 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2537 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2538 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2539 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2540 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2541 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2542 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2543 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2545 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2546 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2547 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2548 and don't include <sys/file.h>).
2550 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
2552 Sync from coreutils.
2554 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2555 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2556 [!LDAV_DONE]: Avoid unused variable warning.
2558 2005-09-21 Bruno Haible <bruno@clisp.org>
2560 * unicodeio.h (unicode_to_mb): New declaration.
2562 2005-09-20 Derek Price <derek@ximbiot.com>
2564 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2566 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2568 Use a consistent style for including <config.h>.
2569 * __fpending.c, acl.c, argmatch.c,
2570 argp-help.c, argp-parse.c,
2571 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2572 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2573 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2574 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2575 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2576 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2577 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2578 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2579 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2580 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2581 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2582 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2583 modechange.c, mountlist.c, open-safer.c, physmem.c,
2584 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2585 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2586 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2587 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2588 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2589 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2590 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2591 userspec.c, utimecmp.c, version-etc-fsf.c,
2592 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2593 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2594 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2595 Standardize inclusion of config.h.
2596 * __fpending.h, dirfd.h, getdate.h, human.h,
2597 inttostr.h: Removed inclusion of config.h from header files.
2598 * inttostr.c: Adjusted in-tree users.
2599 * timespec.h: Remove superfluous warning to include config.h.
2600 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2601 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2602 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2603 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2605 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
2607 * stat-time.h: New file.
2608 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2609 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
2611 (timespec_cmp): New function.
2612 * utimecmp.c: Include stat-time.h.
2613 (SYSCALL_RESOLUTION): Depend on whether various struct stat
2614 members exist, not on the obsolescent ST_MTIM_NSEC.
2615 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2617 2005-09-15 Derek Price <derek@ximbiot.com>
2618 Paul Eggert <eggert@cs.ucla.edu>
2620 * regcomp.c, regexec.c, regex_internal.c: Back out previous
2621 changes, consolidating in...
2622 * regex_internal.h: ...this file.
2624 2005-09-15 Derek Price <derek@ximbiot.com>
2626 * regex_internal.h: Blank `pure' for GNUC < 3.
2627 * regex_internal.c: Ditto, using this...
2628 (__GNUC_PREREQ): ...new macro.
2629 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2630 (__GNUC_PREREQ): ...this new macro.
2632 * strstr.h: Include string.h. Define strstr as a macro here.
2634 2005-09-13 Derek Price <derek@ximbiot.com>
2636 * canon-host.c (canon_host_r): Set *cherror on memory allocation
2638 Reported by Jim Meyering <jim@meyering.net>.
2640 2005-09-13 Jim Meyering <jim@meyering.net>
2642 * canon-host.c: Filter through gnu indent and reword comments slightly.
2643 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2645 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2647 * lib/base64.c: Typo.
2648 (base64_encode): Put b64str in initialized data section.
2650 2005-09-12 Derek Price <derek@ximbiot.com>
2652 Return usable errors from canon-host.
2653 * canon-host.h: New file.
2654 * canon-host.c (canon_host): Wrap...
2655 (canon_host_r): ...this new function, which now relies exclusively on
2657 (ch_strerror): New function.
2658 (last_cherror): New global.
2659 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2660 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
2662 (freeaddrinfo): Free ai->ai_canonname when set.
2664 2005-09-12 Derek Price <derek@ximbiot.com>
2665 Paul Eggert <eggert@cs.ucla.edu>
2667 * glob-libc.h: Renamed from glob_.h. The new version is
2668 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2669 protecting things that should be done only in gnulib contexts.
2670 * glob_.h: New file, containing only the glob things needed for
2672 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
2673 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2674 (glob, globfree, glob_pattern_p): Now defined simply in terms of
2675 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2676 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2677 and to respect the namespace rules better.
2679 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
2681 Merge glibc and coreutils changes into gnulib, plus a few
2683 * md5.c: Use #error rather than a string.
2684 (CYCLIC): New macro, from glibc source. Use it instead of rol.
2685 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2686 (__attribute__): Define to empty for non recent-GCC.
2687 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2688 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2689 Renamed from their non-__ counterparts, with new macros replacing
2690 them if not _LIBC. Add __THROW attribute.
2692 (struct md5_ctx): Align buffer if using GCC.
2693 * sha1.h (struct sha1_ctx): Likewise.
2694 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
2695 The old name was backwards.
2696 (NOTSWAP): Remove; not used.
2697 (rol): New macro, moved here from md5.h.
2698 (sha1_process_block): Remove a FIXME that doesn't make sense.
2700 2005-09-12 Derek Price <derek@ximbiot.com>
2702 * gai_strerror.c: Include config.h when available. Include
2703 getaddrinfo.h before other headers to test interface.
2704 Reported by Larry Jones <lawrence.jones@ugs.com>.
2706 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
2708 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2709 definitions, since that's the preferred style in glibc.
2710 Fix a minor spacing issue, and update copyright notice to match glibc's.
2712 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
2714 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2716 2005-09-06 Simon Josefsson <jas@extundo.com>
2718 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2719 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
2721 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
2723 Change bitset word type from unsigned int to unsigned long int,
2724 as this has better performance on typical 64-bit hosts.
2725 Port bitset code to hosts with unusual word sizes.
2726 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2727 (build_collating_symbol):
2728 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2729 argument is a bitset. This is merely a style issue, but it makes
2730 it clearer that an entire array is expected.
2731 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2732 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2733 Port to the case where bitset_word is not the same as unsigned int.
2734 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2735 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2737 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2738 (build_trtable, group_nodes_into_DFAstates):
2740 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2741 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2742 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2743 * regexec.c (group_nodes_into_DFAstates): Likewise.
2744 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2745 * regcomp.c (optimize_subexps, lower_subexp):
2746 Work even if bitset_word has holes in its bitwise representation.
2747 * regex_internal.h (BITSET_WORD_BITS): Likewise.
2748 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2750 * regex_internal.c (re_string_reconstruct):
2751 Don't assume UCHAR_MAX == 255.
2752 * regex_internal.h (bitset_set_all): Likewise.
2753 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2755 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
2756 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2758 (BITSET_WORD_MAX): New macro.
2759 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2760 (bitset_set_all, bitset_copy): Now inline functions, not macros.
2761 (bitset_empty, bitset_copy):
2762 Prefer sizeof (bitset) to multiplying it out ourselves.
2763 (bitset_not_merge): Remove; unused.
2764 (bitset_contain): Return bool, not unsigned int with one bit on.
2765 All callers changed.
2766 * regexec.c (build_trtable): Don't assume bitset has no stricter
2767 alignment than re_node_set; do this by defining a new internal
2768 type struct dests_alloc and using it to allocate memory.
2770 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
2772 Check for arithmetic overflow when calculating sizes, to prevent
2773 some buffer-overflow issues. These patches are conservative, in the
2774 sense that when I couldn't determine whether an overflow was possible,
2775 I inserted a run-time check.
2776 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2777 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2778 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2779 (re_xnrealloc, re_x2nrealloc): New inline functions.
2780 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2781 (build_equiv_class, build_charclass): Check for arithmetic overflow
2782 in size expression calculations.
2783 * lib/regex_internal.c (re_string_realloc_buffers):
2784 (build_wcs_upper_buffer, re_node_set_add_intersect):
2785 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2786 (re_dfa_add_node, register_state): Likewise.
2787 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2788 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2789 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2790 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2792 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
2794 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2795 to avoid a collision with bits/local_lim.h in glibc.
2796 All uses changed. Problem reported by Dmitry V. Levin in
2797 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2799 * regex_internal.c (build_wcs_upper_buffer): Fix portability
2800 bugs in int versus size_t comparisons.
2801 (re_string_context_at): Fix bug where the code assumed that
2804 Use bool where appropriate.
2805 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2806 All callers changed.
2807 (calc_eclosure_iter): Likewise, for ROOT arg.
2808 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2809 (build_charclass_op): Likewise, for NON_MATCH arg.
2810 * regex_internal.c (re_string_allocate, re_string_construct):
2811 (re_string_construct_common): Likewise, for ICASE arg.
2812 * regexec.c (re_search_2_stub, re_search_stub):
2813 Likewise, for RET_LEN arg.
2814 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2815 (set_regs): Likewise, for FL_BACKTRACK arg.
2816 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2817 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2818 (calc_eclosure_iter, parse_bracket_exp):
2819 Use bool for internal variables that are booleans.
2820 * regexec.c (re_search_internal, check_matching, proceed_next_node):
2821 (set_regs, build_sifted_states, sift_states_bkref):
2822 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2823 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2824 (find_collation_sequence_value):
2826 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2827 (re_node_set_compare):
2828 Return bool, not int. All callers changed.
2829 * regexec.c (check_halt_node_context, check_dst_limits):
2830 (build_trtable, check_node_accept): Likewise.
2831 * regex_internal.h: Include stdbool.h.
2833 Fix bugs uncovered when converting to bool.
2834 * regcomp.c (calc_eclosure_iter): Check for storage allocation
2835 failure instead of charging ahead blindly.
2836 * regex_internal.c (register_state): Likewise.
2837 * regexec.c (re_search_2_stub): Use simpler method than boolean
2838 for freeing internal storage.
2839 (group_nodes_into_DFA_states): Use unsigned int, not int, for
2840 bitset pieces used as boolean, to avoid undefined behavior
2841 on hosts that do int overflow checking.
2843 2005-08-31 Derek Price <derek@ximbiot.com>
2845 * getdelim.c (getdelim): Return EOF on EOF.
2846 Reported by Larry Jones <lawrence.jones@ugs.com>.
2848 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2850 * regex_internal.c (re_string_reconstruct): Don't assume buffer
2851 lengths fit in regoff_t; this isn't true if regoff_t is the same
2853 * regex.c (re_search_internal): 5th arg is LAST_START
2854 (= START + RANGE) instead of RANGE. This avoids overflow
2855 problems when regoff_t is the same width as size_t.
2856 All callers changed.
2857 (re_search_2_stub): Check for overflow when adding the
2858 sizes of the two strings.
2859 (re_search_stub): Check for overflow when adding START
2860 to RANGE; if it occurs, substitute the extreme value.
2862 2005-08-31 Jim Meyering <jim@meyering.net>
2864 * regcomp.c (search_duplicated_node): Make first pointer arg
2866 * regex_internal.c (create_ci_newstate, create_cd_newstate):
2867 (register_state): Likewise.
2868 * regexec.c (search_cur_bkref_entry, check_dst_limits):
2869 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2870 (group_nodes_into_DFAstates): Likewise.
2872 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2874 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2875 old glibc regex code mishandles strings longer than 2**31 bytes.
2876 This patch fixes this when the regex code is used in gnulib
2877 (i.e., outside glibc).
2879 This patch should not affect the use of the regex code inside
2880 glibc. No doubt this problem also needs to be handled for glibc
2881 as well, but the result will be an incompatible change to the
2882 glibc ABI, and the old ABI will have to be supported too. That
2883 can be the the subject for another patch.
2885 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2886 governing whether the rest of this patch is active. By default,
2887 the macro is disabled and the patch has no effect.
2888 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2889 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2890 (struct re_pattern_buffer, re_search, re_search_2, re_match):
2891 (re_match_2, re_set_registers): Use the new types.
2892 * regex_internal.h (Idx, re_hashval_t): New types.
2893 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2895 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2896 (re_string_context_at, bin_tree_t, re_dfastate_t):
2897 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2898 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2899 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2900 (re_string_char_size_at, re_string_wchar_at):
2901 (re_string_elem_size_at):
2902 Use the new types and macros to port to 64-bit hosts.
2903 Use unsigned types for internal values, so that the code
2904 mostly works even for arrays larger than SSIZE_MAX.
2905 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2906 (search_duplicated_node, calc_eclosure_iter, fetch_number):
2907 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2908 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2909 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2910 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2911 (calc_inveclosure, parse_dup_op, build_range_exp):
2912 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2913 (fetch_number, create_token_tree, mark_opt_subexp):
2915 * regex_internal.c (re_string_construct_common, create_ci_newstate):
2916 (create_cd_newstate, re_string_allocate, re_string_construct):
2917 (re_string_realloc_buffers, build_wcs_upper_buffer):
2918 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2919 (re_string_reconstruct, re_string_peek_byte_case):
2920 (re_string_fetch_byte_case, re_string_context_at):
2921 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2922 (re_node_set_init_copy, re_node_set_add_intersect):
2923 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2924 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2925 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2926 (re_acquire_state, re_acquire_state_context, register_state):
2928 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2929 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2930 (re_search_internal, re_search_2_stub, re_search_stub)
2931 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2932 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2933 (update_cur_sifted_state, check_dst_limits):
2934 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2935 (check_subexp_limits, sift_states_bkref, merge_state_array):
2936 (check_subexp_matching_top, get_subexp, get_subexp_sub):
2937 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2938 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2939 (expand_bkref_cache, check_node_accept_bytes):
2940 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2941 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2942 (acquire_init_state_context, check_halt_node_context):
2943 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2944 (sift_states_backward, clean_state_log_if_needed):
2945 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2946 (find_recover_state, transit_state_sb, transit_state_mb):
2947 (transit_state_bkref, build_trtable, match_ctx_clean):
2949 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2950 to work around an assumption that REG_MISSING is negative.
2952 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2953 (seek_collating_symbol_entry) [defined _LIBC]:
2954 (lookup_collation_sequence_value) [defined _LIBC]:
2955 (build_range_exp, build_collating_symbol) [defined _LIBC]:
2956 Use prototypes rather than old-style function definitions.
2957 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2958 (transit_state_sb) [0]:
2959 (find_collation_sequence_value) [defined _LIBC]: Likewise.
2961 * regexec.c (re_search_internal): Simplify update of rm_so and
2964 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2965 (optimize_subexps, lower_subexp):
2966 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2967 since the signed shift might overflow. Use 1u<<31 instead.
2968 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2969 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2972 * regcomp.c (optimize_subexps, lower_subexp):
2973 Use CHAR_BIT rather than 8, for clarity.
2974 * regexec.c (check_dst_limits_calc_pos_1):
2975 (check_subexp_matching_top): Likewise.
2976 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2977 have to worry about portability issues when shifting it left.
2978 Remove no-longer-needed test for table_size > 0.
2979 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2980 in a word, as the resulting behavior is undefined.
2981 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2982 in one case, a <= should have been an <, and in another case the
2983 whole test was missing.
2984 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
2985 the standard name CHAR_BIT.
2986 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2987 this is not true on one's complement and signed-magnitude hosts.
2989 * regex_internal.h (re_sub_match_top_t): Remove unused member
2991 (struct re_dfa_t): Remove unused member states_alloc.
2992 * regcomp.c (init_dfa): Don't initialize unused members.
2994 2005-08-31 Bruno Haible <bruno@clisp.org>
2996 * strstr.c: Include <stddef.h>, for NULL.
2997 * strcasestr.c: Likewise.
2998 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3000 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3002 * iconvme.h: Add prototype for iconv_alloc.
3004 2005-08-29 Simon Josefsson <jas@extundo.com>
3006 * iconvme.c: Fix errno.
3008 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3010 * iconvme.c: Split iconv_string into iconv_alloc.
3012 2005-08-27 Jim Meyering <jim@meyering.net>
3014 * fopen-safer.c: Merge minor changes from coreutils.
3015 * dup-safer.c: Likewise.
3016 * fd-safer.c: Likewise.
3018 Merge from coreutils.
3019 * stdio--.h: New file.
3020 * stdlib--.h: New file.
3021 * mkstemp-safer.c: New file.
3023 GNU tar needs these.
3024 * pipe-safer.c: New file.
3025 * creat-safer.c: New file.
3026 * fcntl--.h (creat): Define to creat_safer.
3027 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3028 * unistd--.h (pipe): Define to pipe_safer.
3029 * unistd-safer.h: Declare pipe_safer.
3031 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3033 * regex_internal.h: Remove all references to
3034 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3036 (bitset_not, bitset_merge, bitset_not_merge):
3037 (bitset_mask, re_string_allocate, re_string_construct):
3038 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3039 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3040 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3041 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3042 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3043 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3044 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3045 (re_acquire_state_context):
3046 Remove unnecessary forward decls.
3047 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3048 Put __attribute at function definition,
3049 now that the function decl has been removed.
3050 * lib/regex_internal.c (re_string_peek_byte_case):
3051 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3054 2005-08-26 Simon Josefsson <jas@extundo.com>
3056 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3057 Haible <bruno@clisp.org>.
3059 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3061 * regexec.c (set_regs): Don't alloca with an unbounded size.
3063 alloca modernization/simplification for regex.
3064 * regex.c: Remove portability cruft for alloca. This no longer
3065 needs to be at the start of the file, and can be moved into
3066 regex_internal.h and simplified.
3067 * regex_internal.h: Include <alloca.h>.
3068 (__libc_use_alloca) [!defined _LIBC]: New macro.
3069 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3070 now works outside glibc.
3072 2005-08-24 Simon Josefsson <jas@extundo.com>
3074 * getpass.c: Add WIN32 implementation. Conditionalize use of
3075 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3076 GLIBC specific code.
3078 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3080 Make regex safe for g++. This fixes one real bug (an "err"
3081 that should have been "*err"). g++ problem reported by
3083 * regex_internal.h (re_calloc): New macro, consistent with
3084 re_malloc etc. All callers of calloc changed to use re_calloc.
3085 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3086 not int. All callers changed.
3087 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3088 just use an array of size MB_LEN_MAX.
3089 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3090 (find_recover_state): Change "err" to "*err"; this fixes what
3091 appears to be a real bug.
3092 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3095 2005-08-25 Jim Meyering <jim@meyering.net>
3097 * open-safer.c: Include <config.h>.
3098 Otherwise, we'd lose LARGEFILE support in any file using
3101 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3103 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3104 * regex.h (regerror): Likewise.
3106 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3107 requires this. (The code never needed it.)
3109 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3110 All uses of recently-renamed identifiers changed to use the new,
3111 POSIX-compliant names. The code will build and run just fine
3112 without these changes, but it's better to eat our own dog food
3113 and use the standard-conforming names.
3115 * regex.h: Fix a multitude of POSIX name space violations.
3116 These changes have an effect only for programs that define
3117 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3118 do not change anything for programs compiled in the normal way.
3119 Also, there is no effect on the ABI.
3121 (_REGEX_SOURCE): New macro.
3122 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3123 defined and _GNU_SOURCE is not; this fixes a name space violation.
3125 Rename the following macros to obey POSIX requirements.
3126 The old names are still visible as macros if _REGEX_SOURCE is defined.
3127 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3128 RE_BACKSLASH_ESCAPE_IN_LISTS.
3129 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3130 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3131 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3132 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3133 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3134 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3135 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3136 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3137 (REG_INTERVALS): renamed from RE_INTERVALS.
3138 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3139 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3140 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3141 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3142 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3143 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3144 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3145 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3146 RE_UNMATCHED_RIGHT_PAREN_ORD.
3147 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3148 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3149 (REG_DEBUG): renamed from RE_DEBUG.
3150 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3151 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3152 unusual, since we can't clash with the POSIX REG_ICASE.
3153 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3154 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3155 (REG_NO_SUB): renamed from RE_NO_SUB.
3156 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3157 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3158 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3159 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3160 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3161 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3162 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3163 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3164 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3165 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3166 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3167 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3168 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3169 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3170 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3171 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3172 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3173 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3174 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3175 (REG_FIXED): Renamed from REGS_FIXED.
3176 (REG_NREGS): Renamed from RE_NREGS.
3178 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3179 of other REG_* macros, since POSIX says the user is allowed to
3180 #undef these macros selectively.
3182 (reg_errcode_t): Update comment stating what other tables need
3185 Rename the following enum values to obey POSIX requirements.
3186 The old names are still visible as macros.
3187 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3188 is not defined, since GNU is supposed to be a superset of POSIX as
3189 much as possible, and since we want reg_errcode_t to be a signed
3190 type for implementation consistency.
3191 (_REG_NOERROR): Renamed from REG_NOERROR.
3192 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3193 (_REG_BADPAT): Renamed from REG_BADPAT.
3194 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3195 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3196 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3197 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3198 (_REG_EBRACK): Renamed from REG_EBRACK.
3199 (_REG_EPAREN): Renamed from REG_EPAREN.
3200 (_REG_EBRACE): Renamed from REG_EBRACE.
3201 (_REG_BADBR): Renamed from REG_BADBR.
3202 (_REG_ERANGE): Renamed from REG_ERANGE.
3203 (_REG_ESPACE): Renamed from REG_ESPACE.
3204 (_REG_BADRPT): Renamed from REG_BADRPT.
3205 (_REG_EEND): Renamed from REG_EEND.
3206 (_REG_ESIZE): Renamed from REG_ESIZE.
3207 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3208 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3209 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3210 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3211 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3213 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3214 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3215 changed. But support the old name if the new one is not defined
3216 and if _REGEX_SOURCE.
3218 Change the following member names in struct re_pattern_buffer.
3219 The old names are still supported if !_REGEX_SOURCE.
3220 The new names are always supported, regardless of _REGEX_SOURCE.
3221 (re_buffer): Renamed from buffer.
3222 (re_allocated): Renamed from allocated.
3223 (re_used): Renamed from used.
3224 (re_syntax): Renamed from syntax.
3225 (re_fastmap): Renamed from fastmap.
3226 (re_translate): Renamed from translate.
3227 (re_can_be_null): Renamed from can_be_null.
3228 (re_regs_allocated): Renamed from regs_allocated.
3229 (re_fastmap_accurate): Renamed from fastmap_accurate.
3230 (re_no_sub): Renamed from no_sub.
3231 (re_not_bol): Renamed from not_bol.
3232 (re_not_eol): Renamed from not_eol.
3233 (re_newline_anchor): Renamed from newline_anchor.
3235 Change the following member names in struct re_registers.
3236 The old names are still supported if !_REGEX_SOURCE.
3237 The new names are always supported, regardless of _REGEX_SOURCE.
3238 (rm_num_regs): Renamed from num_regs.
3239 (rm_start): Renamed from start.
3240 (rm_end): Renamed from end.
3242 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3243 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3244 Prepend __ to parameter names.
3246 Undo yesterday's changes.
3248 2005-08-24 Jim Meyering <jim@meyering.net>
3250 Sync from coreutils.
3251 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3253 2005-08-21 Bruno Haible <bruno@clisp.org>
3255 * lock.h: Add multiple inclusion guard.
3256 * tls.h: Add multiple inclusion guard.
3258 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3260 * regex.h (REG_NOSYS)
3261 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3262 Define, since POSIX requires it as of 2001.
3263 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3264 New private symbol, used to keep the enum signed in all cases.
3265 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3266 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3268 * regex_internal.c (re_string_skip_chars, register_state):
3270 Remove forward decls; no longer needed now that we use prototypes.
3271 * regexec.c (acquire_init_state_context, check_halt_node_context):
3272 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3273 (clean_state_log_if_needed): Likewise.
3275 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3277 Fix problems reported by Sam Steingold in
3278 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3279 * regexec.c (sift_states_bkref): Fix portability bug: the code
3280 assumed that reg_errcode_t is a signed type, which is not
3281 necessarily true if _XOPEN_SOURCE is not defined.
3282 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3283 some compilers warn about it otherwise.
3285 2005-08-20 Jim Meyering <jim@meyering.net>
3287 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3288 of unused local, dfa.
3290 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3292 * regcomp.c (create_initial_state): Remove duplicate decl.
3293 (init_word_char, create_initial_state, duplicate_node_closure):
3294 (fetch_token, peek_token_bracket, build_range_exp):
3295 (build_collating_symbol): Remove forward decls; no longer needed
3296 now that we use prototypes.
3299 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3300 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3301 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3302 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3303 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3304 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3305 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3306 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3307 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3308 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3309 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3310 (build_charclass, build_charclass_op, fetch_number, create_tree):
3311 (create_token_tree, mark_opt_subexp, duplicate_tree):
3312 Use prototypes rather than old-style definitions.
3315 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3316 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3317 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3318 (re_string_reconstruct, re_string_peek_byte_case):
3319 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3320 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3321 (re_node_set_init_copy, re_node_set_add_intersect):
3322 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3323 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3324 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3325 (re_acquire_state, re_acquire_state_context, register_state):
3326 (create_ci_newstate, create_cd_newstate, free_state):
3328 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3329 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3330 (re_search_internal, prune_impossible_nodes):
3331 (acquire_init_state_context, check_matching, static):
3332 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3333 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3334 (update_regs, sift_states_backward, build_sifted_states):
3335 (clean_state_log_if_needed, merge_state_array):
3336 (update_cur_sifted_state, add_epsilon_src_nodes):
3337 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3338 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3339 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3340 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3341 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3342 (check_arrival, check_arrival_add_next_nodes):
3343 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3344 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3345 (check_node_accept_bytes, check_node_accept, extend_buffers):
3346 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3347 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3352 (re_string_allocate, re_string_construct, re_string_reconstruct):
3353 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3354 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3355 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3356 (re_string_context_at, re_string_peek_byte_case):
3357 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3358 is defined, since we now use prototypes always.
3360 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3361 C89 or better. All uses removed.
3363 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3365 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3366 [defined lint]: Suppress bogus uninitialized-variable warnings.
3368 * regcomp.c (duplicate_node): Return new index, not an error code,
3369 and let the caller return REG_ESPACE if out of space. This
3370 removes an uninitialied-variable warning with GCC 4.0.1, and also
3371 avoids taking the address of a local variable. All callers
3374 2005-08-19 Jim Meyering <jim@meyering.net>
3376 * regexec.c (proceed_next_node): Redo local variables to
3377 avoid GCC shadowing warnings.
3379 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3381 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3382 (re_node_set_insert_last, re_dfa_add_node):
3383 Rename local variables to avoid GCC shadowing warnings.
3385 2005-08-18 Bruno Haible <bruno@clisp.org>
3387 * strstr.c (strstr): Fix return value in multibyte case.
3388 * strcasestr.c (strcasestr): Likewise.
3390 2005-08-17 Jim Meyering <jim@meyering.net>
3392 Make the %s format (seconds since the epoch) work for a negative
3393 number and when used with a zero-padded field width, e.g. %015s.
3395 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3396 label so that it precedes the code to set `digits'. Otherwise,
3397 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
3398 print `00-22'. Now, it prints `-0022', as it should.
3400 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
3402 * regex.h: Remove useless space-before-tab. From coreutils.
3404 2005-08-17 Bruno Haible <bruno@clisp.org>
3406 * strcasestr.h: New file.
3407 * strcasestr.c: New file.
3409 2005-08-17 Bruno Haible <bruno@clisp.org>
3411 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3412 * strstr.c: Completely rewritten, with multibyte locale support.
3414 2005-08-17 Bruno Haible <bruno@clisp.org>
3416 * strcasecmp.c: Use mbuiter.h.
3418 2005-08-17 Bruno Haible <bruno@clisp.org>
3420 * mbuiter.h: New file.
3422 2005-08-16 Bruno Haible <bruno@clisp.org>
3424 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3426 (mbi_avail, mbi_advance): Let the iteration end before the terminating
3427 NUL byte, not after it.
3429 2005-08-16 Bruno Haible <bruno@clisp.org>
3431 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3432 the valid ones. Makes the comparison operations transitive:
3433 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3434 * strcasecmp.c (strcasecmp): Use mb_casecmp.
3436 2005-08-16 Bruno Haible <bruno@clisp.org>
3438 * strcase.h (strcasecmp): Add note in comments.
3439 * strncasecmp.c: Use code from strcasecmp.c.
3440 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3441 (strcasecmp): Work correctly in multibyte locales.
3443 2005-08-16 Bruno Haible <bruno@clisp.org>
3445 * strnlen1.h: New file.
3446 * strnlen1.c: New file.
3448 2005-08-16 Bruno Haible <bruno@clisp.org>
3450 * mbfile.h: New file.
3452 2005-08-16 Bruno Haible <bruno@clisp.org>
3454 * mbiter.h: New file.
3456 2005-08-16 Bruno Haible <bruno@clisp.org>
3458 * mbchar.h: New file.
3459 * mbchar.c: New file.
3461 2005-08-16 Bruno Haible <bruno@clisp.org>
3463 * tls.h: New file, from GNU gettext.
3464 * tls.c: New file, from GNU gettext.
3466 2005-08-15 Bruno Haible <bruno@clisp.org>
3468 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3471 2005-08-14 Jim Meyering <jim@meyering.net>
3473 Sync from coreutils.
3475 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3476 Use the hash-table-based cycle-detection code not just when
3477 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3478 Reported by James Youngman in
3479 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3480 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3481 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3482 This lets us compile with -DFTS_DEBUG, once again.
3483 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3484 * fts.c (fd_safer): Remove decl.
3485 Include fcntl--.h rather than unistd-safer.h
3486 (fts_safe_changedir): Don't call fd_safer; no longer needed
3487 now that we include fcntl--.h.
3489 2005-08-11 Simon Josefsson <jas@extundo.com>
3491 * readline.h, readline.c: New file.
3493 2005-08-11 Bruno Haible <bruno@clisp.org>
3495 * strnlen.h (strnlen): Change parameter name to match comment.
3497 2005-08-10 Simon Josefsson <jas@extundo.com>
3499 * strndup.c: Use strnlen.h.
3501 * strnlen.h: New file.
3503 2005-08-02 Simon Josefsson <jas@extundo.com>
3505 * getline.h, getline.c: Rewrite.
3507 * getdelim.h, getdelim.c: New files, ported from glibc.
3509 2005-07-31 Bruno Haible <bruno@clisp.org>
3511 * lock.h (gl_lock_initializer): New macro.
3512 (gl_lock_define_initialized): Use it.
3513 (gl_rwlock_initializer): New macro.
3514 (gl_rwlock_define_initialized): Use it.
3515 (gl_recursive_lock_initializer): New macro.
3516 (gl_recursive_lock_define_initialized): Use it.
3518 2005-07-26 Bruno Haible <bruno@clisp.org>
3520 * lock.h: Update from GNU gettext.
3521 * lock.c: Update from GNU gettext.
3523 2005-07-18 Bruno Haible <bruno@clisp.org>
3525 * lock.h (gl_once_t): New type.
3526 (gl_once_define, gl_once): New macros.
3527 * lock.c (fresh_once): New variable.
3528 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3531 2005-07-18 Simon Josefsson <jas@extundo.com>
3533 * check-version.c (check_version): Accept identical versions too.
3535 2005-07-18 Bruno Haible <bruno@clisp.org>
3537 * lock.h: New file, from GNU gettext.
3538 * lock.c: New file, from GNU gettext.
3540 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
3542 * quotearg.c: Add translator comment suggested by Bruno Haible,
3543 with a minor change.
3545 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3547 * version-etc-fsf.c (version_etc_copyright): Parameterize the
3548 copyright symbol and the year.
3549 * version-etc.c (COPYRIGHT_YEAR): New constant.
3550 (version_etc_va): Use parameterized copyright notice.
3551 Reword to conform to the current GNU coding standards.
3553 2005-07-11 Simon Josefsson <jas@extundo.com>
3555 * size_max.h: New file.
3557 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
3559 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3562 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
3563 and Paul Eggert <eggert@cs.ucla.edu>
3565 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3566 in wint_t, not wchar_t. Remove now-unnecessary cast.
3568 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3570 * regex.c, regex.h: Sync from libc.
3571 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3572 New files, synced from libc, except that regex_internal.h
3573 currently has a small porting fix.
3575 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
3577 Remove the dependency of the strftime module on the tzset module.
3578 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3579 Copy the input structure, to work around some of the bug with
3580 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
3581 Solaris releases, you should also use the tzset module, but we won't
3582 require it as a dependency any more since we don't want LGPLed code
3583 to depend on GPLed code.
3585 2005-07-02 Jim Meyering <jim@meyering.net>
3587 * backupfile.c (backup_args): Change a `0' to NULL.
3589 2005-07-01 Jim Meyering <jim@meyering.net>
3591 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3592 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3593 * save-cwd.c, tempname.c:
3594 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3595 and don't include <sys/file.h>).
3597 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
3599 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3600 declares only 'struct timespec;' (!).
3602 2005-06-29 Jim Meyering <jim@meyering.net>
3604 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3605 type name. Use the variable name instead.
3606 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3608 2005-06-28 Simon Josefsson <jas@extundo.com>
3610 * check-version.h, check-version.c: New files.
3612 2005-06-28 Simon Josefsson <jas@extundo.com>
3614 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
3615 collision with global variable. Better indentation. Don't
3616 increment buffer pointer beyond buffer end. Based on comments
3617 from Paul Eggert <eggert@cs.ucla.edu>.
3621 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
3623 * canon-host.c (canon-host): Append trailing "," to 0 in
3624 initializer of struct addrinfo, as an indication that we don't
3625 care how many members the structure has.
3627 2005-06-24 Derek Price <derek@ximbiot.com>
3628 and Bruno Haible <bruno@clisp.org>
3630 Remove stat module & update lstat.
3631 * stat.c: Remove this file...
3632 (slash_aware_lstat): ...moving this content and its support...
3633 * lstat.c (rpl_lstat): ...into here.
3634 * lstat.h: New file.
3636 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
3638 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
3639 (ranged_convert): Don't save conversion in a temporary struct.
3640 This causes a warning with GCC 4.0.0, and anyway in the typical
3641 case it's not worth the extra 100 bytes or so of code.
3642 (ranged_convert, __mktime_internal): When calling a function via a
3643 pointer P, use P () rather than (*P) (), as we now assume C89 or
3646 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
3648 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3649 "who -r" failed to give output. Problem reported by Tim Waugh.
3651 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3652 (xcalloc): Use it to avoid needless tests.
3653 Problem reported by Jim Meyering.
3655 2005-06-16 Jim Meyering <jim@meyering.net>
3657 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3658 when either N or S is zero.
3660 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3662 * argp.h (__option_is_short): Check upper limit of
3663 __key. Isprint() requires its argument to have the value
3664 of an unsigned char or EOF.
3666 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
3668 * fnmatch.c (fnmatch): If there is an encoding error in a
3669 multibyte string or pattern, fall back on unibyte matching.
3670 Problem reported by James Youngman.
3672 2005-06-08 Bruno Haible <bruno@clisp.org>
3674 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3677 2005-06-08 Bruno Haible <bruno@clisp.org>
3679 * csharpcomp.h: New file, from GNU gettext.
3680 * csharpcomp.c: New file, from GNU gettext.
3681 * csharpcomp.sh.in: New file, from GNU gettext.
3683 2005-06-07 Derek Price <derek@ximbiot.com>
3686 * glob_.h: Indent nested #ifdef.
3688 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
3690 Sync from coreutils.
3691 Use "file name" when talking about file names, instead of "filename"
3692 or "path", as per the GNU coding standards.
3693 * mkdir-p.c: Renamed from makepath.c.
3694 (make_dir_parents): Renamed from make_path. All callers changed.
3695 * mkdir-p.h: Likewise. All includers changed.
3696 * filenamecat.c: Renamed from path-concat.c.
3697 (file_name_concat): Renamed from path_concat. All callers changed.
3698 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3699 * filenamecat.h: Likewise. All includers changed.
3700 * acl.c: Don't use "path" or "filename" to mean "file name"
3701 in comments or local variable names.
3702 * basename.c: Likewise.
3703 * canonicalize.c, canonicalize.h: Likewise.
3704 * dirname.c, dirname.h: Likewise.
3705 * euidaccess.c: Likewise.
3706 * exclude.c: Likewise
3707 * fnmatch_.h, fnmatch_loop.c: Likewise.
3708 * fsusage.c, fsuage.h: Likewise.
3709 * fts.c, fts_.h: Likewise.
3710 * getcwd.c: Likewise.
3711 * getloadavg.c: Likewise.
3712 * mkstemp.c: Likewise.
3713 * mountlist.c, mountlist.h: Likewise.
3714 * openat.c, openat.h: Likewise.
3715 * readlink-stub.c: Likewise.
3716 * readutmp.c, readutmp.h: Likewise.
3717 * rename.c: Likewise.
3718 * rmdir.c: Likewise.
3720 * savedir.c: Likewise.
3721 * stripslash.c: Likewise.
3722 * tempname.c: Likewise.
3723 * xreadlink.c: Likewise.
3724 * exclude.c (excluded_file_name): Renamed from excluded_filename.
3726 * exclude.h: Likewise.
3728 * euidaccess.c (getuid, getgid, getuid, getegid)
3729 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3730 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3731 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3732 * pathmax.h: Include <limits.h> unconditionally, since other
3733 files have been getting away with it for years (MORE/BSD 4.3
3735 * userspec.c (getpwnam, getgrnam, getgrgid)
3736 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3738 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3739 Define to 256, not 255, as per modern POSIX.
3741 2005-06-01 Bruno Haible <bruno@clisp.org>
3743 * csharpexec.h: New file, from GNU gettext.
3744 * csharpexec.c: New file, from GNU gettext.
3745 * csharpexec.sh.in: New file, from GNU gettext.
3747 2005-05-31 Derek Price <derek@ximbiot.com>
3748 Paul Eggert <eggert@cs.ucla.edu>
3751 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3753 2005-05-29 Derek Price <derek@ximbiot.com>
3754 Paul Eggert <eggert@cs.ucla.edu>
3756 * glob_.h, glob.c: New files.
3758 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
3760 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3762 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3763 the configuration hassle isn't worth it.
3764 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3765 (LONGEST_MODIFIER, PRIuMAX): Remove.
3767 2005-05-27 Bruno Haible <bruno@clisp.org>
3769 * getlogin_r.h: Remove second include of <stddef.h>.
3771 2005-05-25 Bruno Haible <bruno@clisp.org>
3772 Derek Price <derek@ximbiot.com>
3774 * getlogin_r.h: Simplify API documentation.
3776 2005-05-25 Derek Price <derek@ximbiot.com>
3777 Paul Eggert <eggert@cs.ucla.edu>
3779 * getlogin_r.c, getlogin_r.h: New files.
3781 2005-05-22 Bruno Haible <bruno@clisp.org>
3783 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3784 Also include <sys/param.h> if it defines MIN, MAX.
3785 Based on a patch by Derek Price <derek@ximbiot.com>.
3787 2005-05-22 Bruno Haible <bruno@clisp.org>
3789 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3790 (INT64_MIN): Fix definition.
3791 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3793 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3794 NEED_SIGNED_INT_TYPES.
3796 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3797 HAVE_SYSTEM_INTTYPES.
3799 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
3801 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3802 so that unistd-safer.h (GPL'ed code) need not be included.
3804 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
3807 * fts.c: Don't include "cycle-check.h" or "hash.h".
3808 (setup_dir, free_dir): New functions.
3809 (enter_dir, leave_dir): Define trivial
3810 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
3811 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
3812 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3813 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3814 Move to fts-cycle.c.
3815 (fts_open): Use setup_dir.
3816 (fts_close): Use free_dir.
3817 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3818 This adds a label and some gotos, but the alternatives were messier.
3819 Check for memory allocation failure when entering a dir.
3820 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3821 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3822 (FTS): New member fts_cycle, that is a union that contains the
3823 old active_dir_ht and cycle_state. All uses changed to mention
3824 fts_cycle.ht and fts_cycle.state.
3825 * fts-cycle.c: New file, containing GPL'ed code migrated out of
3826 fts.c, with the following changes:
3827 (setup_dir, free_dir): New functions.
3828 (enter_dir): Now returns bool. Return true if successful, false
3829 if memory exhausted. All callers changed.
3830 Do not bother partly cleaning up on
3831 memory allocation failure; that is free_dir's job.
3832 However, free ad if hash_insert fails, to avoid memory leak.
3833 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3834 fts->fts_options to see which union member to use.
3836 2005-05-20 Jim Meyering <jim@meyering.net>
3838 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3839 Now a macro, to pacify GCC.
3841 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
3843 * chown.c (rpl_chown): Return -1 on failure.
3845 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
3847 * canonicalize.c: Include canonicalize.h first, to test interface.
3848 Include <stddef.h> unconditionally, since we assume C89 now.
3849 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3850 * fts.c: Include fts_.h first, to check interface.
3851 Do not include intprops.h; no longer needed.
3852 Include cycle-check.h and hash.h, since fts_.h no longer does.
3853 Remove unnecessary casts of closedir to void.
3854 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3855 decide whether to decrement nlinks.
3856 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3857 (FTS): Use struct hash_table * instead of Hash_table, so that
3858 we no longer need to include hash.h here.
3860 2005-05-17 Jim Meyering <jim@meyering.net>
3862 * fts.c, fts_.h: New files, from coreutils.
3864 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
3866 Sync from coreutils.
3867 * unlinkdir.c, unlinkdir.h: New files.
3868 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3869 regex.h, unlocked-io.h, xtime.h:
3870 White space changes only.
3871 * makepath.c (make_path): Port to hosts where leading "//" is special.
3872 * yesno.c: Include getline.h, not ctype.h.
3873 (yesno): Don't remove leading white space; POSIX doesn't allow it.
3874 Use getline to remove arbitrary restriction on response length.
3876 2005-05-13 Bruno Haible <bruno@clisp.org>
3878 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3879 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3880 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3881 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3882 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3883 Add support for 64-bit integers in the MSVC compiler.
3885 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
3887 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3888 Change the initial comment to refer to GPL, not LGPL.
3889 gnulib-tool will change it to LGPL as needed.
3891 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3892 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3893 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3894 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3895 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3896 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3897 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3898 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3899 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3900 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3901 concatpath.c, config.charset, copy-file.c, copy-file.h,
3902 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3903 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3904 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3905 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3906 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3907 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3908 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3909 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3910 full-read.c, full-read.h, full-write.c, full-write.h,
3911 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3912 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3913 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3914 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3915 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3916 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3917 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3918 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3919 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3920 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3921 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3922 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3923 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3924 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3925 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3926 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3927 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3928 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3929 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3930 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3931 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3932 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3933 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3934 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3935 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3936 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3937 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3938 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3939 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3940 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3941 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3942 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3943 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3944 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3945 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3946 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3947 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3948 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3949 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3950 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3951 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3952 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3953 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3954 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3955 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3956 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3957 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3958 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3959 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3960 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3961 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3962 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3963 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3964 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3965 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3966 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3967 Update FSF postal mail address.
3969 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3971 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3972 specified in ai_socktype. Fix invalid ai_protocol
3973 check. ai_protocol is usually set to 0 or depending on
3974 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
3975 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
3976 ai_socktype / ai_protocol in the returned addrinfo structure.
3978 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3979 Bruno Haible <bruno@clisp.org>
3981 * inet_ntop.h: New file.
3982 * inet_ntop.c: New file, from glibc with modifications.
3984 2005-05-08 Jim Meyering <jim@meyering.net>
3986 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3988 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
3990 Merge from coreutils. Among other things,
3991 add bulletproofing for cases where stdin, stdout, or stderr are closed.
3992 * fd-safer.c: New file.
3993 * fcntl-safer.h, open-safer.c: Remove.
3994 * chdir-long.c: Fix comment "fetish" -> "coreutils".
3995 * dup-safer.c: Include unistd-safer.h first.
3996 Don't include errno.h.
3997 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3998 * file-type.h: Don't assume invoker included sys/stat.h first.
3999 * file-type.c: Rely on file-type.h change.
4000 * getloadavg.c: Include unistd-safer.h.
4001 (getloadavg): Use safer open.
4002 * getusershell.c: Include "stdio-safer.h".
4003 (getusershell): Use safer fopen.
4004 * long-options.c (long_options): Use NULL rather than 0.
4005 * modechange.h (mode_free): Remove; all callers changed to invoke
4007 * modechange.c: Likewise.
4008 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4009 (MODE_DONE): New constant.
4010 (struct mode_change): Remove 'next' member.
4011 (make_node_op_equals): New function; like the old one of the
4012 same name, except it allocates an array.
4013 (mode_compile, mode_create_from_ref): Use it.
4014 (mode_compile): Allocate result as an array, not a linked list.
4015 Parse octal string ourself, so that we catch mistakes like "+0".
4016 (mode_adjust): Arg is an array, not a linked list.
4017 * modechange.c: Include stat-macros.h, xalloc.h.
4018 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4019 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4020 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4021 Remove. This is now stat-macros.h's job.
4022 (talloc): Remove. All callers replaced by xalloc, so that
4023 our invokers don't have to worry about reporting memory failures.
4024 (make_node_op_equals): Remove.
4025 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4027 (struct mode_change): Moved here from modechange.h.
4028 (mode_append_entry): Remove.
4029 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4030 apps to have incorrect behavior. Use simpler algorithm for head
4031 and tail. Don't futz with umask; that's now the job of mode_adjust.
4032 Detect more invalid usages rather than having somewhat-random behavior.
4033 Don't insert an "a=" action, as that leads to incorrect behavior.
4034 (mode_compile, mode_create_from_ref): Return NULL on error instead
4035 of an enum, since now there's only one way to have an error. All
4037 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4038 at the correct time. Simplify calculation of "+u" and its ilk.
4039 Don't mishandle "+X".
4040 (mode_free): Remove "register" and localize decls.
4041 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4042 (struct mode_change): Move to modechange.c; callers don't
4043 need to see this stuff.
4044 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4045 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4046 (mode_change, mode_adjust): Reflect the new signatures noted above.
4047 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4048 that might redefine system include files.
4049 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4050 (my_usleep): Use NULL rather than (void *) 0.
4051 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4052 Use siginterrupt to specify that system calls should be interrupted.
4053 (rpl_nanosleep): Move initialization of suspended closer to call of
4055 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4056 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4057 (desirable_utmp_entry): New function.
4058 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4059 using x2nrealloc, to simplify logic.
4060 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4061 size calculation. Do not assume utmp file is a regular file.
4062 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4063 (READ_UTMP_CHECK_PIDS): New constant.
4064 * save-cwd.c: Include unistd-safer.h.
4065 (save_cwd): Use fd_safer.
4066 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4067 [!_LIBC] Include "stat-macros.h" instead.
4068 * unistd-safer.h (fd_safer): New decl.
4070 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4072 * byteswap_.h: New file.
4074 2005-04-25 Albert Chin <china@thewrittenword.com>
4076 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4079 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4081 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4082 that "UTC +1 second" continues to work. Problem reported
4084 (relunit_snumber): New rule.
4087 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4089 * getdate.y (universal_time_zone_table): New constant.
4090 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4091 universal_time_zone_table.
4092 (lookup_zone): Prefer universal_time_zone_table to
4093 local_time_zone_table, so that "GMT" time stamps are allowed in
4094 London during the summer. Problem reported by Ian Abbott.
4096 2005-04-12 Jim Meyering <jim@meyering.net>
4098 * human.c (humblock): Set *options even when returning due to
4099 xstrtoumax conversion failure. Thanks to a used-uninitialized
4102 2005-04-09 Jim Meyering <jim@meyering.net>
4104 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4105 -Wuninitialized: initialize tm0.tm_year.
4107 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4109 * getdate.y (parser_control): rels_seen is now a boolean, not a
4110 count, since there's no maximum. All uses changed.
4111 Add member dsts_seen.
4112 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4114 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4115 Use pc_rels_seen to decide whther a date is absolute.
4117 * getdate.y (number): Don't overwrite year.
4118 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4121 2005-04-02 Simon Josefsson <jas@extundo.com>
4123 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4124 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4126 2005-03-27 Jim Meyering <jim@meyering.net>
4128 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4130 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4132 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4133 "one's complement" -> "ones' complement" in comment, as per Knuth.
4134 "value of type" -> "type or expression" in comment.
4135 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4137 2005-03-26 Jim Meyering <jim@meyering.net>
4140 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4141 Correct typos: s/or/of/.
4143 2005-03-23 Jim Meyering <jim@meyering.net>
4145 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4147 2005-03-21 Jim Meyering <jim@meyering.net>
4149 Changes imported from coreutils.
4151 * cycle-check.c: Don't include xalloc.h.
4153 * path-concat.c: Don't include assert.h.
4154 (path_concat): Remove assertion that would have triggered
4155 for ABASE starting with more than one slash.
4156 Reported by Andreas Schwab.
4158 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4159 properly when ABASE is an absolute file name.
4160 Correct the description of this function.
4162 Add an assertion and a test driver.
4163 This fixes a bug introduced on 2004-07-02.
4164 Andreas Schwab reported the resulting failure of cp --parents:
4165 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4167 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4169 * strftime.c (my_strftime): If the underlying strftime returns 0
4170 (which shouldn't happen), generate nothing instead of returning 0
4171 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4173 2005-03-16 Bruno Haible <bruno@clisp.org>
4175 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4177 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4179 * strftime.c (my_strftime): Prepend space to format so that we can
4180 reliably distinguish strftime failure from empty output on POSIX
4183 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4185 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4186 (iconv_string): Don't guess a size-zero buffer, as that might cause
4187 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4188 result would be 'too large', where 'too large' is (heuristically)
4189 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4190 overflow concerns. This will prevent some unwanted malloc failures
4191 when the inputs are very large.
4193 2005-03-15 Bruno Haible <bruno@clisp.org>
4195 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4198 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4201 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4203 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4205 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4206 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4208 * strtol.c: Likewise.
4210 2005-03-14 Simon Josefsson <jas@extundo.com>
4212 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4215 2005-03-14 Jim Meyering <jim@meyering.net>
4217 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4218 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4219 to be nonzero so that we (and caller) can detect the difference
4220 between a valid zero-length expansion and an error return, even
4221 when the underlying strftime fails before writing anything into
4224 2005-03-10 Jim Meyering <jim@meyering.net>
4226 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4227 so that this module works on systems without fchdir.
4229 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4231 Factor int-properties macros into a single file, except for
4232 glibc-related files.
4233 * intprops.h: New file.
4234 * getloadavg.c: Include it instead of limits.h.
4235 (INT_STRLEN_BOUND): Remove.
4236 * human.c: Include intprops.h.
4237 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4238 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4239 * inttostr.h: Include intprops.h instead of limits.h.
4240 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4241 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4242 for consistency with intprops.h.
4243 (time_t_is_integer, twos_complement_arithmetic): Use them.
4244 * sig2str.h: Include <signal.h>, intprops.h.
4245 (INT_STRLEN_BOUND): Remove.
4246 * strftime.c (TYPE_SIGNED): Remove.
4247 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4248 * strtol.c: Adjust comments to match intprops.h.
4249 * userspec.c: Include intprops.h.
4250 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4251 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4252 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4253 instead of rolling our own expressions.
4254 * xstrtol.c: Include xstrtol.h first, to test interface.
4256 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4258 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4259 the right thing even if adding 1900 would overflow. Similarly
4260 for tm_mon + 1 and tm_yday + 1.
4261 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4262 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4263 (DO_SIGNED_NUMBER): New macro.
4264 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4266 2005-03-07 Bruno Haible <bruno@clisp.org>
4268 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4270 2005-03-03 Derek R. Price <derek@ximbiot.com>
4271 Bruno Haible <bruno@clisp.org>
4273 * pagealign_alloc.h: New file.
4274 * pagealign_alloc.c: New file.
4276 2005-01-28 Bruno Haible <bruno@clisp.org>
4278 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4281 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4283 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4284 The workaround isn't strictly needed for POSIX conformance, and
4285 it's too much of a pain to configure and maintain. We'll ask
4286 people to fix their kernels instead.
4287 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4288 (NANOSLEEP_BUG_WORKAROUND): Remove.
4289 (xnanosleep): Remove the workaround.
4291 2005-02-12 Bruno Haible <bruno@clisp.org>
4293 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4295 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4297 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4298 * timespec.h (gettime): Return void, since it always
4299 succeeds now. All uses changed.
4300 * gettime.c (gettime) Likewise.
4301 [HAVE_NANOTIME]: Prefer nanotime.
4302 Assume gettimeofday succeeds, as POSIX requires.
4303 Assime time () succeeds, since other code already does.
4304 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4305 (timespec_subtract): Remove.
4306 (NANOSLEEP_BUG_WORKAROUND): New constant.
4307 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4308 things considerably. Use it only on GNU/Linux hosts, since the
4309 workaround shouldn't be needed elsewhere.
4311 2005-02-24 Bruno Haible <bruno@clisp.org>
4313 * gettext.h: Update from GNU gettext 0.14.2.
4315 2005-02-24 Bruno Haible <bruno@clisp.org>
4317 * localcharset.c: Update from GNU gettext 0.14.2.
4318 * config.charset: Update from GNU gettext 0.14.2.
4320 2005-02-22 Simon Josefsson <jas@extundo.com>
4322 * iconvme.h, iconvme.c: New files, from libc.
4324 2005-02-20 Neil Conway <neilc@samurai.com>
4326 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4327 returned by OSX/Darwin if the specified buffer is not large
4328 enough for the hostname.
4330 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4332 * memrchr.h: New file.
4333 * chdir-long.c: Include it.
4334 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4335 Don't bother including stddef.h.
4337 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4339 * argp-help.c (__argp_help): Create a fake struct argp_state and
4340 pass it to _help, otherwise the latter coredumps trying to
4341 dereference state.root_argp.
4343 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4345 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4347 Include <sys/types.h>, for dev_t.
4348 (ME_DUMMY, ME_REMOTE): Move from here....
4349 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4350 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4352 Include mountlist.h first, to test the interface.
4354 2005-01-29 Bruno Haible <bruno@clisp.org>
4356 * progname.c (program_name): Initialize.
4357 Needed when linking statically on MacOS X.
4359 2005-01-28 Bruno Haible <bruno@clisp.org>
4361 * javacomp.sh.in: New file, from GNU gettext.
4362 * javacomp.h: New file, from GNU gettext.
4363 * javacomp.c: New file, from GNU gettext.
4365 2005-01-26 Bruno Haible <bruno@clisp.org>
4367 * javaexec.sh.in: New file, from GNU gettext.
4368 * javaexec.h: New file, from GNU gettext.
4369 * javaexec.c: New file, from GNU gettext.
4371 2005-01-26 Simon Josefsson <jas@extundo.com>
4373 * gai_strerror.c: Use GPL in header.
4375 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4377 * argp-help.c (hol_entry_help): Avoid using non-constant
4378 initializers for struct pentry_state.
4379 (__argp_error): Check return value of __asprintf
4380 (__argp_failure): Translate error message
4382 * argp-parse.c: Removed braces around the expansion of N_()
4384 2005-01-21 Jim Meyering <jim@meyering.net>
4386 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4387 same value as for Solaris 9.
4389 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4390 component length. This included changing the parameter to be
4391 of type `char *' rather than `char const *'.
4392 * chdir-long.h (chdir_long): Update prototype.
4394 * openat.c (fdopendir, fstatat): New functions.
4395 * openat.h: Include headers required for use of DIR and struct stat.
4396 [AT_SYMLINK_NOFOLLOW]: Define.
4397 (fdopendir, fstatat): Add prototypes.
4399 2005-01-21 Bruno Haible <bruno@clisp.org>
4401 * classpath.h: New file, from GNU gettext.
4402 * classpath.c: New file, from GNU gettext.
4404 2005-01-20 Simon Josefsson <jas@extundo.com>
4406 * version-etc-fsf.c: New file, with version_etc_copyright.
4407 * version-etc.c: Remove version_etc_copyright.
4408 * version-etc.h (version_etc_copyright): Use [] instead of * in
4409 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4411 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
4413 * save-cwd.c (save_cwd): Remove code to support the case
4414 where fchdir is missing or flaky.
4416 2005-01-20 Simon Josefsson <jas@extundo.com>
4418 * base64.h (isbase64): Add.
4420 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4421 using a unsigned prototype, don't inline.
4422 (base64_decode): Use it.
4424 2005-01-19 Bruno Haible <bruno@clisp.org>
4426 * sh-quote.h: New file, from GNU gettext.
4427 * sh-quote.c: New file, from GNU gettext.
4429 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
4431 Merge changes from coreutils, as described below in several
4432 changelogs dated today.
4434 * save-cwd.c: Include "save-cwd.h" before other include files.
4435 (O_DIRECTORY): Remove; not needed here, since "." must be
4436 a directory. All uses removed.
4437 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
4438 universal on Suns, and we also need to test for IRIX.
4439 Revamp code to use 'if' rather than '#if'.
4440 Avoid unnecessary comparison of cwd->desc to 0.
4442 * utimens.c (futimens): Robustify the previous patch, by checking
4443 for known valid error numbers rather than observed invalid ones.
4445 2005-01-18 Jim Meyering <jim@meyering.net>
4447 * version-etc.c (version_etc_copyright): Update copyright date.
4449 * utimens.c (futimens): Account for the fact that futimes
4450 can also fail with errno == ENOSYS or errno == ENOENT.
4451 Patch from Dmitry V. Levin.
4453 Change the name of the robust chdir function from chdir to chdir_long.
4454 * save-cwd.c: Include chdir-long.h rather than chdir.h.
4455 (restore_cwd): Use chdir_long, not chdir.
4456 * chdir-long.c: Renamed from chdir.c.
4457 * chdir-long.h: Renamed from chdir.h.
4458 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4461 2005-01-18 Bob Proulx <bob@proulx.com>
4463 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4464 offsetof() macro construct to avoid compile failure with native HP-UX
4465 11.0 ANSI C compiler.
4467 2005-01-06 Bruno Haible <bruno@clisp.org>
4469 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4470 because stpncpy.m4 takes care of it.
4472 2004-01-24 Bruno Haible <bruno@clisp.org>
4474 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4476 2003-10-09 Bruno Haible <bruno@clisp.org>
4478 * progreloc.c: Include xalloc.h instead of xmalloc.h.
4480 2005-01-06 Bruno Haible <bruno@clisp.org>
4482 * fwriteerror.h (fwriteerror): Change specification to include fclose.
4483 * fwriteerror.c: Include <stdbool.h>.
4484 (fwriteerror): At the end, close the file stream. Record whether
4485 stdout was already closed.
4487 2004-05-27 Bruno Haible <bruno@clisp.org>
4489 * execute.c (environ): Declare if needed.
4490 * pipe.c (environ): Likewise.
4491 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4493 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
4495 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4496 definitions to be after all include files, to avoid collisions.
4497 Problem reported by Bob Proulx.
4499 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
4501 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4502 not needed. This removes a dependency on the gettext module.
4503 [defined _LIBC]: Do not include <libintl.h>; not needed.
4505 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
4507 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4510 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
4512 * argp-parse.c: Include <stddef.h>.
4513 (alignof, alignto): New macros.
4514 (parser_init): Don't assume that void * is aligned sufficiently
4517 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4518 need to extend the stack.
4519 (YYINITDEPTH): New macro, so that the initial stack isn't overly
4522 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4524 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4526 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4528 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4529 Remove now-obsolete comment about AIX.
4530 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4531 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4532 (YYMAXDEPTH): New macro.
4534 2004-12-18 Bruno Haible <bruno@clisp.org>
4536 * fatal-signal.c (fatal_signals): Make non-const.
4537 (init_fatal_signals): New function.
4538 (uninstall_handlers, install_handlers): Ignore signals that were set to
4540 (at_fatal_signal): Call init_fatal_signals.
4541 (init_fatal_signal_set): Likewise. Ignore signals that were set to
4543 Reported by Paul Eggert.
4545 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4547 * getdate.y (textint): New member "negative".
4548 (time_zone_hhmm): New function.
4549 Expect 14 shift-reduce conflicts, not 13.
4550 (o_colon_minutes): New rule.
4551 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4552 (yylex): Set the "negative" member of signed numbers.
4554 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
4556 Changes imported from coreutils.
4557 * hard-locale.c: Assume <locale.h> exists.
4559 (GLIBC_VERSION): New macro.
4560 (hard_locale): Assume setlocale exists.
4561 Rewrite to avoid #ifdef.
4562 Use strdup rather than malloc + strcpy.
4563 * human.c: Assume <locale.h> exists.
4564 (human_readable): Assume localeconv exists.
4566 2004-12-01 Jakub Jelinek <jakub@redhat.com>
4568 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4569 convert T2, not T. (Imported from libc.)
4571 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
4573 * getcwd.c (is_ENAMETOOLONG): New macro.
4574 (__getcwd.c): Don't restore errno; glibc doesn't.
4575 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4576 first, falling back to our code only if its results look suspicious.
4577 Ensure that the resulting buffer is only as large as necessary.
4579 * readutmp.c: Include readutmp.h first.
4580 Include <errno.h>, since readutmp.h no longer does that.
4581 * readutmp.h: Don't include <errno.h>,
4582 <sys/param.h>, <time.h>; not needed to establish interface.
4583 (errno): Remove decl.
4584 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4585 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4586 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4588 2004-11-28 Simon Josefsson <jas@extundo.com>
4590 * base64.h, base64.c: New file.
4592 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
4594 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4596 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
4598 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4599 HP's ANSI C compiler.
4600 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4601 Declaring int functions causes warnings on some modern systems and
4602 shouldn't be needed to compile on ancient ones.
4603 * same.c (MIN) [defined MIN]: Don't define, since it's already
4606 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4607 with the following changes.
4608 (__set_errno): Parenthesize properly.
4609 Include <stdbool.h>.
4610 (MIN, MAX, MATCHING_INO): New macros.
4611 (__getcwd): Define with prototype, not K&R form.
4612 Use heuristics to allocate default buffer on stack if possible.
4613 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4614 behavior, and to avoid the PATH_MAX limit when computing
4616 Use MATCHING_INO to compare inode number to file.
4617 Check for arithmetic overflow in size calculations.
4618 Fix bug in reallocation of dot array that caused getcwd to fail
4619 on directories nested deeper than 75.
4620 Be more careful about saving errno on error.
4621 Do not use realloc; use only free+malloc, as this is a bit
4622 more flexible and avoids a needless copy operation.
4623 Do not inspect st_dev and st_ino for symbolic links; POSIX
4624 doesn't specify the latter.
4625 Check for closedir errors.
4626 Avoid needless casts.
4627 Use "#ifdef weak_alias" around weak_alias, to be like other
4629 The following changes to getcwd.c have effect only when used in
4630 gnulib; they have no effect inside glibc proper.
4631 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4632 as alloca isn't used.
4633 (alloca, __alloca): Likewise.
4634 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4635 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4636 unconditionally, as gnulib assumes C89 or better.
4637 Do not include <sys/param.h>.
4638 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4639 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4641 (NULL) [!defined NULL]: Remove; we assume C89 or better.
4642 Include <dirent.h> in a way that is compatible with modern Autoconf.
4643 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4644 New macros, if not already defined.
4645 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4646 Use "_LIBC", not "defined _LIBC", for consistency.
4647 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4649 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4650 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
4651 * xgetcwd.c: David MacKenzie's old code was removed, so give
4652 credit only to Jim Meyering and adjust the copyright dates.
4653 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4654 <stdlib.h>, <unistd.h>, "pathmax.h".
4655 Instead, include "xgetcwd.h" (first) and "getcwd.h".
4656 (INITIAL_BUFFER_SIZE): Remove.
4657 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4659 2004-11-23 Jim Meyering <jim@meyering.net>
4661 * getopt_.h: Remove trailing blanks.
4663 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
4665 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4666 (futimens): New function, which uses futimes if available.
4667 (futimens, utimens): Support timespec==NULL, with same semantics
4668 as utime and utimens.
4669 * utimens.h (futimens): New decl.
4671 2004-11-23 Jim Meyering <jim@meyering.net>
4673 * __fpending.c: Add comment.
4675 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4677 * getopt_.h: Re-addition of __getopt_argv_const caused
4678 redefinition warnings. To avoid them, include the defines
4679 in `#if !defined __need_getopt ... #endif'. The only place
4680 where __getopt_argv_const is used is in definitions
4681 of getopt_long and getopt_long_only below, which are as well
4682 protected by `#ifndef __need_getopt'.
4683 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4684 __need_getopt after including <stdio.h> and <unistd.h> These
4685 headers might have defined it.
4687 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
4689 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4691 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4692 optopt): Use them instead of invoking ## directly; otherwise, the
4693 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4695 2004-11-19 Bruno Haible <bruno@clisp.org>
4697 * strtok_r.c: Move comments from here...
4698 * strtok_r.h: ... to here.
4700 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
4702 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4703 might fail. Problem reported by Yoann Vandoorselaere.
4704 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4705 that mishandle size_t overflow.
4707 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
4709 * canon-host.c: Include "strdup.h".
4710 (canon_host): Use getaddrinfo if available, so that IPv6 works.
4711 Use strdup instead of malloc/strcpy to duplicate strings.
4713 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4714 (human_space_before_unit): New constant.
4715 * human.c (human_readable): Support it.
4717 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4718 (xgetcwd): Set errno correctly when failing.
4719 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4720 the failure is actually due to a PATH_MAX problem.
4722 Further getopt changes to make it more likely that glibc will
4723 buy the changes back.
4724 * getopt.c (POSIXLY_CORRECT): New constant.
4725 (getopt): Use it, so to preserve glibc semantic
4726 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4727 when compiling for libc.
4728 * getopt_.h (__getopt_argv_const): Bring it back.
4729 (getopt_long, getopt_long_only): Use it.
4731 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4732 New arg POSIXLY_CORRECT. All callers changed.
4733 (getopt): Argv is now char * const *, as per standard.
4734 (_getopt_internal_r, _getopt_internal): Argv is now char **,
4735 not char *__getopt_argv_const *.
4736 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4737 _getopt_long_only_r): Likewise.
4738 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4739 * getopt_int.h (_getopt_internal, _getopt_internal_r,
4740 _getopt_long_r, _getopt_long_only_r): Likewise.
4741 * getopt_.h (__getopt_argv_const): Remove.
4742 (getopt): Argv is now char * const *, as per standard.
4744 * getdate.y (tORDINAL): New token.
4745 (day, relunit): Allow it for relative times.
4746 (relative_time_table): Use tORDINAL for ordinals.
4748 2004-11-15 Jim Meyering <jim@meyering.net>
4750 * closeout.c: Include "__fpending.h" once again.
4751 Include <stdbool.h>.
4752 (close_stdout): Don't fail just because stdout was closed initially,
4753 since some programs don't write to stdout in the normal course of
4754 operation (other than --version and --help), and we don't want this
4755 function to make e.g. `touch file >&-' fail.
4756 But do fail if it was closed and someone has tried to write to it.
4757 E.g., `printf foo >&-' must fail.
4759 2004-11-11 Simon Josefsson <jas@extundo.com>
4761 * strtok_r.h, strtok_r.c: New file.
4763 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
4765 * getopt_.h (__getopt_argv_const): New macro, to be used so that
4766 we can stop lying to compilers about the constness of argv when we
4767 are compiled outside glibc.
4768 (getopt, getopt_long, getopt_long_only): Use it.
4769 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4771 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4772 _getopt_long_only_r): Likewise.
4773 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4774 _getopt_long_only_r): Likewise.
4776 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4777 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4778 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4779 the other external symbols.
4780 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4781 declaration, since the above renaming now works around collisions.
4783 2004-11-11 Jim Meyering <jim@meyering.net>
4785 * linebreak.c: Remove trailing blanks.
4786 * alloca_.h: Likewise.
4787 * acosl.c: Likewise.
4788 * euidaccess.c: Likewise.
4789 * allocsa.h: Likewise.
4791 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
4793 * mktime.c (SHR): New macro, which is a portable
4794 substitute for >> that should work even on Crays.
4795 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4796 Problem reported by Mark D. Baushke in
4797 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4798 * getdate.y (SHR): Likewise.
4800 * strftime.c (SHR): Likewise.
4802 * quotearg.c (struct quoting_options): Use unsigned int for
4803 quote_these_too, so that right shifts are well defined. All uses
4806 2004-11-10 Simon Josefsson <jas@extundo.com>
4808 * getaddrinfo.h, getaddrinfo.c: New files.
4810 2004-11-10 Jim Meyering <jim@meyering.net>
4812 Ensure that no close failure goes unreported.
4813 * closeout.c (close_stdout): Always close stdout. I.e., don't
4814 return early when it seems there's nothing to flush.
4815 Don't include __fpending.h.
4817 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
4819 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4821 2004-11-05 Bruno Haible <bruno@clisp.org>
4823 * readlink.c: Include stddef.h, needed for size_t on Woe32.
4824 Reported by Mark D. Baushke <mdb@cvshome.org>.
4826 2004-11-04 Bruno Haible <bruno@clisp.org>
4828 2004-09-11 Bruno Haible <bruno@clisp.org>
4829 * allocsa.valgrind: New file.
4830 2004-02-06 Bruno Haible <bruno@clisp.org>
4831 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4832 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4833 Reported by Christopher Seip <chris.seip@hp.com>.
4835 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
4837 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4838 with errno == ERANGE if the buffer is too small.
4839 Problem reported by Mark D. Baushke.
4841 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
4843 * xreadlink.c (MAXSIZE): New macro.
4844 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
4845 size does not exceed MAXSIZE. Avoid cast.
4846 As suggested by Mark D. Baushke in
4847 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4848 if readlink fails with buffer size just under MAXSIZE, try again
4851 2004-11-02 Derek R. Price <derek@ximbiot.com>
4852 and Paul Eggert <eggert@cs.ucla.edu>
4854 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4855 (get_date): Overparenthesize to avoid GCC warning.
4857 2004-11-02 Bruno Haible <bruno@clisp.org>
4859 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4860 function returns void.
4862 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
4864 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4865 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4868 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
4870 * getdate.y: Add support for TZ="foo" within a date string.
4871 Fix some bugs near time_t boundaries. Reject dates with
4872 out-of-range components, e.g., "Sept 31".
4873 Include <stdlib.h>, "setenv.h", "xalloc.h".
4874 (ISDIGIT_LOCALE): Remove; unused.
4875 Note that the TZ and time functions used here are not reentrant.
4876 (mktime_ok, get_tz): New functions.
4877 (TZBUFSIZE): New constant.
4878 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
4879 This requires that we sometimes generate our own TZ="XXX..." setting.
4881 2004-10-27 Derek R. Price <derek@ximbiot.com>
4883 * mktime.c (not_equal_tm): Remove redundant check.
4885 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
4887 * getdate.y: Use Bison 1.875 features, and some minor
4888 code cleanups. This change does not affect semantics.
4889 Don't include <stdlib.h>; no longer needed.
4890 Don't include unlocked-io.h; only the "#if TEST" code uses
4891 stdio, and performance isn't crucial there.
4892 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4893 Bison 1.875 features as described below.
4894 All uses of "PC." replaced by "pc->".
4895 (YYSTYPE): Add a forward declaration.
4896 (yylex, yyerror): Use full prototypes in forward decls.
4897 Use "%pure-parser" rather than obsolescent "%pure_parser".
4898 Use %parse-param and %lex-param instead of obsolescent
4899 YYPARSE_PARAM and YYLEX_PARAM.
4900 (meridian_table, month_and_day_table, time_units_table,
4901 relative_time_table, time_zone_table, military_table,
4902 lookup_zone, lookup_word, get_date):
4903 Use NULL instead of 0 where appropriate.
4904 (to_hour): Avoid abort (), to avoid a dependency on
4906 (yyerror, yylex): Now accepts parser_control * arg.
4907 (main) [TEST]: Use '\0' rather than 0 for char.
4909 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
4911 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4912 It's now the caller's responsibility to handle the case where
4913 !HAVE_GETPAGESIZE && !defined getpagesize.
4915 * mktime.c (leapyear): Arg is long int, not int.
4917 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
4919 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4921 2004-10-12 Simon Josefsson <jas@extundo.com>
4923 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4924 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4927 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
4929 * vsnprintf.h: New file.
4930 * vsnprintf.c: New file.
4932 2004-10-07 Bruno Haible <bruno@clisp.org>
4934 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4935 into the provided buffer.
4937 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
4939 * diacrit.c, diacrit.h: Add GPL notice.
4941 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4942 * atanl.c (atanl): Keep the code as similar to glibc as possible.
4943 * logl.c (logl): Keep the code as similar to glibc as possible.
4944 This avoids a potential constant-folding bug.
4946 2004-10-05 Bruno Haible <bruno@clisp.org>
4948 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4950 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4952 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
4953 * xmalloc.c (xmemdup): Likewise.
4954 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4955 XFREE): Remove these long-obsolescent macros.
4956 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4957 * xstrdup.c: Remove.
4959 * regex.c (re_comp): Cast gettext return value to char *,
4960 Problem reported by Martin Neitzel via Mark D. Baushke.
4962 2004-10-04 Simon Josefsson <jas@extundo.com>
4964 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4965 '#ifdef USE_UNLOCKED_IO'.
4967 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4969 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4970 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4971 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4972 regex.c, sha1.c, version-etc.c, yesno.c:
4973 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4974 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4975 the includer's responsibility.
4977 Sync from coreutils.
4979 * modechange.c (mode_compile): Don't decrement a pointer that
4980 points to the start of a string, as the C Standard says the
4981 resulting behavior is undefined.
4983 * backupfile.h (enum backuptype): Rename none -> no_backups,
4984 simple -> simple_backups, numbered_existing ->
4985 numbered_existing_backups, numbered -> numbered_backups
4986 to avoid shadowing problems. All uses changed.
4987 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4988 * backupfile.c (check_extension, numbered_backup):
4989 Rename locals to avoid shadowing 'basename'.
4990 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4993 * .cppi-disable: Add getopt_.h, getopt_int.h.
4994 * .cvsignore: Add getopt.h.
4996 2004-10-04 Simon Josefsson <jas@extundo.com>
4998 * memmem.h: New file.
4999 * memmem.c: New file, taken from glibc.
5001 2004-10-02 Jim Meyering <jim@meyering.net>
5003 * dirfd.h, getpagesize.h: Add copyright notice.
5005 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5007 * snprintf.c: Remove comments as to why each header is needed.
5009 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5011 * strsep.h: New file.
5012 * strsep.c: New file.
5014 2004-10-01 Simon Josefsson <jas@extundo.com>
5016 * snprintf.c (snprintf): Handle size==0.
5018 2004-10-01 Simon Josefsson <jas@extundo.com>
5019 Bruno Haible <bruno@clisp.org>
5021 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5022 (snprintf): Declare 'args'.
5024 2004-09-30 Simon Josefsson <jas@extundo.com>
5026 * snprintf.h, snprintf.c: New files.
5028 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5030 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5031 (hol_entry_help): Never translate an empty string.
5032 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5033 * argp.h (OPTION_NO_TRANS): New option.
5035 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5037 * xvasprintf.c: Include xalloc.h.
5038 (xvasprintf): Use xalloc_die, not xmalloc_die.
5040 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5042 * dummy.c: Change copyright notice to FSF, and license to GPL.
5044 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5046 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5047 Problem reported by Bruno Haible in:
5048 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5050 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5052 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5053 in case some system header has #define'd it. Problem reported by
5054 Soeren D. Schulze in
5055 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5057 2004-09-08 Bruno Haible <bruno@clisp.org>
5059 * stdint_.h: New file, taken from GNU clisp.
5061 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5063 * xvasprintf.h: New file.
5064 * xvasprintf.c: New file.
5065 * xasprintf.c: New file.
5067 2004-09-08 Bruno Haible <bruno@clisp.org>
5069 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5071 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5073 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5075 Import from coreutils.
5076 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5077 strings on unbounded length. alloca's performance benefits aren't
5078 that important here.
5080 (parse_with_separator): New function, with most of the internals
5081 of the old parse_user_spec. Allow user to omit both user and group,
5082 for compatibility with FreeBSD.
5083 Clone only the user name, not the entire spec.
5084 Do not set *uid, *gid unless entirely successful.
5085 Avoid memory leak in some failing cases.
5086 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5087 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5088 (parse_user_spec): Rewrite to use parse_with_separator.
5090 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5092 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5093 its complicated substitute.
5094 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5095 and program_invocation_name.
5096 (__argp_basename) [!_LIBC]: Remove; the only use was
5097 replaced by its body.
5098 (__argp_short_program_name): Change condition from
5099 !defined __argp_short_program_name to
5100 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5101 to match argp-namefrob.h.
5102 (__argp_failure): Don't assume strerror_r returns char *.
5103 * argp-parse.c (N_): Define unconditionally.
5104 (argp_default_options): Fill out initializers with 0 to avoid
5107 2004-08-12 Simon Josefsson <jas@extundo.com>
5109 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5110 * getopt_.h: Renamed from getopt.h.
5112 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5114 Merge from coreutils.
5116 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5117 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5118 for Reliant Unix 5.43.
5120 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5121 (union fooround): Use uintmax_t, not long int.
5122 The rest is a merge from libc:
5123 [defined _LIBC]: Include <shlib-compat.h>.
5124 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5126 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5128 * strverscmp.c: Convert to UTF-8.
5130 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5132 * obstack.h (obstack_empty_p):
5133 Don't assume that chunk->contents is suitably aligned.
5134 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5135 Likewise. Problem reported by Benno in
5136 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5138 * chown.c (rpl_chown): Work even if the file is writeable but not
5139 readable. This could be improved further but it'd take some work.
5141 2004-08-08 Simon Josefsson <jas@extundo.com>
5143 * xgethostname.c: Don't include error.h (not used).
5146 * getpass.c: Include getpass.h first.
5148 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5150 * xalloc-die.c: New files.
5151 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5153 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5154 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5155 (_, N_, xalloc_die): Move to xalloc-die.c.
5156 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5157 so that we needn't mess with xalloc_msg_memory_exhausted.
5159 * sha1.h: Renamed from sha.h.
5160 (SHA1_H): Renamed from _SHA_H.
5161 (sha1_ctx): Renamed from sha_ctx.
5162 (sha1_init_ctx): Renamed from sha_init_ctx.
5163 (sha1_process_block): Renamed from sha_process_block.
5164 (sha1_process_bytes): Renamed from sha_process_bytes.
5165 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5166 (sha1_read_ctx): Renamed from sha_read_ctx.
5167 (sha1_stream): Renamed from sha_stream.
5168 (sha1_buffer): Renamed from sha_buffer.
5169 * sha1.c: Likewise; renamed from sha.c.
5170 Do not include <sys/types.h>.
5171 Include <stddef.h> rather than <stdlib.h>.
5173 2004-08-08 Bruno Haible <bruno@clisp.org>
5175 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5176 FILESYSTEM_PREFIX_LEN.
5177 * progreloc.c: Likewise.
5178 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5180 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5183 * argp-help.c (make_hol, hol_append): Don't assume that
5184 SIZE_MAX is a valid preprocessor constant.
5185 (__argp_basename): Change from "#ifndef _LIBC"
5186 to "#ifndef __argp_short_program_name", so that
5187 we don't compile these functions for tar.
5189 More merges from coreutils.
5190 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5191 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5193 * addext.c: Remove; no longer needed.
5194 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5195 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5196 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5197 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5198 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5199 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5200 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5201 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5202 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5203 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5204 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5205 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5206 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5207 Import changes from coreutils.
5209 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5211 Merge from coreutils.
5213 * .gdb-history: Remove; this doesn't belong here.
5215 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5216 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5217 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5219 * dirname.h: Include <stdbool.h>.
5220 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5221 for consistency with POSIX terminology. All uses changed.
5222 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5223 (strip_trailing_slashes): Use bool for booleans.
5224 * stripslash.c (strip_trailing_slashes): Likewise.
5226 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5227 sometimes returns a positive errno value even when it succeeds.
5228 (print_errno_message) [!LIBC]: Fall back on strerror if
5231 * path-concat.c (mempcpy): Don't define if a system header defines it.
5232 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5233 (longest_relative_suffix): New function.
5234 (path_concat): Use it. Assume first argument is not NULL.
5235 Port to DOS. Omit redundant separators.
5236 Report an error instead of returning NULL.
5237 Use mempcpy instead of memcpy.
5238 (xpath_concat): Remove: not declared or used.
5240 * same.h: Include <stdbool.h>
5241 (same_name): Return bool, not int.
5242 * same.c (same_name): Likewise.
5243 (errno): Don't declare; we assume C89 or better now.
5245 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5246 if not already defined.
5248 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5249 * dup-safer.c (errno): Likewise.
5251 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5253 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5256 2004-08-03 Simon Josefsson <jas@extundo.com>
5258 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5259 * progname.h: Don't include stdbool.h.
5261 2004-08-02 Simon Josefsson <jas@extundo.com>
5263 * getsubopt.h: New file, with comments from Bruno Haible.
5264 * getsubopt.c: New file, from glibc, but slightly modified based on
5265 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5267 2004-08-01 Simon Josefsson <jas@extundo.com>
5269 * xgetdomainname.c: Include stdlib.h, for free().
5271 2004-07-16 Simon Josefsson <jas@extundo.com>
5273 * dummy.c: New file.
5275 2004-07-16 Bruno Haible <bruno@clisp.org>
5277 * backupfile.h: Add extern "C" for C++.
5278 * closeout.h: Likewise.
5279 * copy-file.h: Likewise.
5280 * findprog.h: Likewise.
5281 * full-write.h: Likewise.
5282 * pathname.h: Likewise.
5283 * progname.h: Likewise.
5284 * stpcpy.h: Likewise.
5285 * stpncpy.h: Likewise.
5286 * strcase.h: Likewise.
5287 * strstr.h: Likewise.
5288 * xalloc.h: Likewise.
5290 * mbswidth.h: Add extern "C" for C++.
5291 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5293 2004-07-09 Simon Josefsson <jas@extundo.com>
5295 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5296 failed without this.)
5298 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5300 * fchown-stub.c: New file.
5302 2004-06-24 Jim Meyering <jim@meyering.net>
5304 * obstack.h (obstack_base): Cast to (void *), per documentation.
5306 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5308 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5310 2004-06-01 Jim Meyering <jim@meyering.net>
5312 * calloc.c: New file.
5314 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5316 * getdate.y (yylex): Allow space between sign and number.
5317 Problem reported by Dan Jacobson.
5319 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5320 and Jim Meyering <jim@meyering.net>
5322 Merge from coreutils CVS.
5324 * stat-macros.h: New file, with contents from file-type.h
5325 and coreutils' system.h.
5326 * file-type.c: Include "stat-macros.h".
5327 * file-type.h (file_type): Move all macro definitions to new file,
5330 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5331 Wrap old code with this conditional.
5332 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5333 function that does not dereference symlinks.
5334 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5336 * xreadlink.c: Include xreadlink.h first, to catch .h file
5337 dependency problems.
5338 (xreadlink): Accept new arg SIZE, for efficiency.
5339 All decls and uses changed.
5340 * xreadlink.h: Include <stddef.h>, for size_t.
5342 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5343 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5345 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5347 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5349 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5350 macros to be defined.
5351 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5352 the allocator returns NULL because the requested size is zero.
5354 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5356 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5357 var. Add comment explaining why libc still defines it. This
5358 merges the following patch from glibc:
5359 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5361 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5363 * obstack.c (_obstack): Remove unused variable. It hasn't been
5364 present in glibc since revision 1.1 of this file.
5365 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5366 obstack_alignment_mask, obstack_alloc, obstack_base,
5367 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5368 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5369 obstack_grow0, obstack_init, obstack_int_grow,
5370 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5371 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5372 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5373 nonexistent functions.
5375 2004-05-17 Derek R. Price <derek@ximbiot.com>
5376 Paul Eggert <eggert@cs.ucla.edu>
5378 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5380 2004-05-14 Bruno Haible <bruno@clisp.org>
5382 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5383 that consists of a '.' followed by an empty digit string.
5384 Patch by Tor Lillqvist <tml@iki.fi>.
5386 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5388 Port obstack to the AS/400, where pointers are 16 bytes wide and
5389 you cannot cast an integer to a valid pointer. This patch is
5390 currently waiting to be integrated into glibc; see
5391 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5393 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5394 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5395 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5396 (struct obstack): temp member is now a union of a pointer and
5397 an integer, instead of an integer. All integer uses changed.
5398 This does not affect the physical layout of struct obstack,
5399 except on hosts (like the AS/400) where the size or alignment of
5400 void * is greater than that of ptrdiff_t.
5401 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5402 __STDC__)]: Store temporary in pointer member of union, not
5404 * obstack.c: Include <stddef.h>, for offsetof.
5405 (struct fooalign): Remove; it doesn't need a name.
5406 (union fooround): Change double to long double, and add void *.
5407 (DEFAULT_ALIGNMENT): Use offsetof to compute.
5408 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5409 not a macro. Hence the values are always int; so remove all
5410 casts-to-int in uses.
5412 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
5413 Derek Price <derek@ximbiot.com>
5415 * alloca.c: Include <alloca.h>, to get our interface.
5416 * alloca_.h: Use __alloca on AIX, so that we don't have to
5417 include <alloca.h> first. Use C89 prototype for alloca; this
5418 requires including <stddef.h> for size_t. Use extern "C" if C++.
5419 Use #elif for simplicity, since we can assume C89 now.
5420 Don't try to source the system alloca.h since it will not be found
5421 and to prevent recursively including its replacement.
5422 * fnmatch.c: Include <alloca.h> instead of opencoding.
5423 * regex.c: Likewise.
5425 2004-05-16 Derek Price <derek@ximbiot.com>
5426 Paul Eggert <eggert@cs.ucla.edu>
5428 getline cleanup. This changes the getndelim2 API: both order of
5429 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5432 * getline.c: Don't include stddef.h or stdio.h, since our
5433 interface does that.
5434 (getline): Always use getdelim, so that we don't have two
5435 copies of this code.
5436 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5438 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5439 (GETNDELIM2_MAXIMUM): New macro.
5440 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
5441 instead of the old practice of delim2==0. All callers changed.
5442 Return -1 on overflow, instead of returning junk.
5443 Do not set *linesize unless allocation succeeds.
5444 * getndelim2.h: Do not include stddef.h; no longer needed, now
5445 that we include sys/types.h.
5446 * getnline.h: Likewise.
5447 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5448 (getndelim2): Reorder arguments.
5449 * getnline.c (getnline, getndelim):
5450 Don't discard the NMAX argument.
5451 (getnline): Invoke getndelim, to avoid code duplication.
5452 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5453 of (size_t) -1 by callers of the getnline family.
5455 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
5457 * nanosleep.c (suspended): Change its type from int to
5458 sig_atomic_t volatile.
5459 (first_call): Make it private to rpl_nanosleep, and have it
5460 be zero initially as that's a bit faster.
5461 (my_usleep): Round up fractional times instead of truncating them,
5462 as this is the usual meaning for 'sleep'.
5464 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5466 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5467 (ENOSYS): Define if not defined.
5468 (settime): Fall back on stime if it exists and settimeofday fails.
5469 But don't bother with fallbacks if a method fails with errno == EPERM.
5471 2004-05-11 Jim Meyering <jim@meyering.net>
5473 Prior to this change, the save_cwd caller required read access to the
5474 current directory on most systems (ones with the fchdir function).
5476 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5477 fails, try write-only, and finally, resort to using xgetcwd.
5479 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5481 * obstack.c, obstack.h: Import changes from libc.
5483 2004-04-28 Bruno Haible <bruno@clisp.org>
5485 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5486 implicitly appends .exe to executables.
5487 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5488 accepts Windows pathnames.
5489 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5490 Cygwin like Windows, since it now accepts Windows pathnames.
5491 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5492 Cygwin like Windows, since it now accepts Windows pathnames.
5493 Reported by Derek Robert Price <derek@ximbiot.com>.
5495 2004-04-20 Jim Meyering <jim@meyering.net>
5497 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5499 2004-04-20 Jim Meyering <jim@meyering.net>
5500 Bruno Haible <bruno@clisp.org>
5502 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5503 memory when realloc fails.
5505 2004-04-18 Jim Meyering <jim@meyering.net>
5507 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5508 don't leak memory and do call END_UTMP_ENT.
5510 2004-04-11 Paul Eggert <eggert@twinsun.com>
5512 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5513 (CHAR_BIT): Remove, since we assume C89.
5514 Include <stdint.h> if available, as per current Autoconf CVS advice.
5516 2004-03-30 Paul Eggert <eggert@twinsun.com>
5518 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5519 not bool, to be more consistent with Unix conventions.
5520 Suggested by Bruno Haible.
5522 Merge from coreutils.
5524 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5527 * getdate.h: Include stdbool.h, and timespec.h instead of
5528 the usual <time.h> dance.
5529 (get_date): Change signature to support fractional time stamps.
5530 All callers changed.
5531 * getdate.y: Include "getdate.h" first, as we can now
5532 assume C89 and don't need to worry about 'const'.
5533 Similarly, include "unlocked-io.h" near start, not in middle.
5535 (textint.value): Use long int rather than int.
5536 (textint.digits): Use size_t rather than int.
5537 (BILLION, LOG10_BILLION): New constants.
5538 (parser_control): New member rel_ns. Members day_ordinal,
5539 time_zone, month, day, hour, minutes, rel_year, rel_month,
5540 rel_day, rel_hour, rel_minutes, rel_seconds
5541 are now long int, not int. Member seconds is now struct timespec,
5542 not int. New member timespec_seen. Members dates_seen, days_seen,
5543 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5545 (%union.intval): Now long int, not int.
5546 New member timespec.
5547 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5548 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5549 (spec): Now is a timespec or an item list.
5550 (timespec, items): New nonterminals.
5551 (time, rel, relunit, number, get_date):
5552 Add support for fractional seconds.
5553 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5554 (gmtime, localtime, mktime): Remove decls; not needed with C89.
5555 (to_hour): First arg is now long int, not int.
5556 (to_year): Returns long int, not int.
5557 Don't treat year -70 like 70.
5558 (tm_diff): Returns long int, not int.
5559 (lookup_word): Use bool instead of int when appropriate.
5560 (yylex): Use size_t for count, not int.
5561 Detect overflow when parsing large integer constants.
5562 Add support for fractions.
5563 (get_date): Make pointers 'const' if possible.
5564 Use more-portable code to detect integer overflow.
5565 (main) [TEST]: Adjust to above changes. Test for localtime failure.
5566 Don't use ctime; it's not reliable if the year has >4 digits.
5568 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5569 This is for compatibility with BSD.
5571 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5572 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5573 From coreutils' system.h.
5575 * userspec.c: Don't include "posixver.h".
5576 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5577 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5578 compatible extension. Simplify code by removing a boolean int
5579 that was always nonzero if a string was nonnull.
5581 2004-03-30 Jim Meyering <jim@meyering.net>
5583 Merge from coreutils.
5585 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5587 * readtokens.c (readtoken): Don't leak 64 bytes when reading
5588 an empty input stream.
5590 * readtokens.c: Include <stdbool.h>.
5591 (readtoken): Use `size_t' rather than int/long.
5592 All callers adjusted.
5593 Use `bool' rather than `int' where appropriate.
5594 Use memset rather than an explicit loop.
5595 Use x2nrealloc rather than xrealloc.
5596 Allow the use of `\0' as a delimiter.
5597 (readtokens): Likewise.
5598 * readtokens.h (readtoken, readtokens): Update prototypes.
5600 2004-03-30 Bruno Haible <bruno@clisp.org>
5602 * getloadavg.c (getloadavg): Don't assume setlocale returns
5605 2004-03-29 Paul Eggert <eggert@twinsun.com>
5607 Merge changes to getloadavg.c from coreutils and Emacs.
5609 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5610 Define to an expression, not to the empty string.
5611 Include cloexec.h and xalloc.h.
5612 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5613 Use set_cloexec_flag rather than rolling our own.
5614 * cloexec.c, cloexec.h: New files.
5616 2004-03-18 Paul Eggert <eggert@twinsun.com>
5618 * getopt.h: Sync with libc CVS.
5620 2004-03-18 Paul Eggert <eggert@twinsun.com>
5621 Bruno Haible <bruno@clisp.org>
5623 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5624 not on all platforms that have <wchar.h>.
5625 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5627 2004-03-09 Paul Eggert <eggert@twinsun.com>
5629 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5631 * getopt_int.h: New file, also synced from libc.
5633 2004-03-07 Paul Eggert <eggert@twinsun.com>
5635 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
5636 '#if' expressions. Unlike the code it replaces, it does not
5637 depend on (defined _SC_PAGESIZE). However, it does depend on
5638 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5639 first reported by Jason Andrade in
5640 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5642 2004-01-18 Simon Josefsson <jas@extundo.com>
5644 * strdup.h: New file.
5645 * strdup.c: Include it.
5646 * path-concat.c: Include strdup.h. Drop strdup declaration.
5647 * userspec.c: Include strdup.h. Drop strdup declaration.
5649 2004-02-06 Karl Berry <karl@gnu.org>
5651 * config.charset: update from gettext 0.14.1.
5653 2004-02-05 Paul Eggert <eggert@twinsun.com>
5655 Add comments and code, prompted by suggestions from Bruno Haible
5657 * quotearg.h (quotearg_alloc): New decl. Improve the comments
5658 describing the enum quoting_style values.
5659 * quotearg.c (quotearg_alloc): New function.
5660 (quotearg_buffer_restyled): Treat lone { and } as special.
5661 Treat = as special. Work around bug with older shells
5662 that "see" a '\' that is really the 2nd byte of a multibyte char.
5663 Quote empty string with shell_quoting_style.
5665 2004-02-03 Bruno Haible <bruno@clisp.org>
5667 * pipe.h: New file, from GNU gettext.
5668 * pipe.c: New file, from GNU gettext.
5670 2004-01-27 Bruno Haible <bruno@clisp.org>
5672 * execute.h: New file, from GNU gettext.
5673 * execute.c: New file, from GNU gettext.
5674 * w32spawn.h: New file, from GNU gettext.
5676 2004-01-23 Paul Eggert <eggert@twinsun.com>
5678 Exit-status fix from coreutils.
5680 Use exit_failure consistently in place of EXIT_FAILURE,
5681 so that program exit statuses are consistent on failure.
5683 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5684 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5685 * argmatch.h: Comment fix to match the above.
5686 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5687 Now a macro referring to exit_failure, instead of a separate
5688 variable. Include "exitfail.h" to get it.
5689 * xstrtol.h: Include "exitfail.h".
5690 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5692 * long-options.c (parse_long_options): Use prototype
5693 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
5696 2004-01-21 Jim Meyering <jim@meyering.net>
5698 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5699 so as not to conflict with a different-sized __mktime_internal
5700 function in GNU libc.
5701 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5702 Problem building statically-linked `ls' reported by Michael Brunnbauer.
5704 2004-01-18 Paul Eggert <eggert@twinsun.com>
5706 Merge from diffutils.
5708 * file-type.c (file_type): Add typed memory objects.
5709 * file-type.h (S_TYPEISTMO): New macro.
5711 * c-stack.h (c_stack_action): Remove argv argument.
5712 * c-stack.c (c_stack_action): Likewise. All uses changed.
5713 (die): Don't calculate message unless segv_action returns.
5714 (get_stack_location, min_address_from_argv, max_address_from_argv,
5715 volatile stack_base, volatile_stack_size): Remove.
5716 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5717 that every segmentation violation is a stack overflow. (Ouch!)
5718 See Debian bug 136249 (still outstanding) for more info about why
5719 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5721 2003-11-30 Bruno Haible <bruno@clisp.org>
5723 Safer stack allocation.
5724 * setenv.c: Include allocsa.h.
5725 (alloca): Remove fallback definition.
5726 (freea): Remove macro.
5727 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5730 2003-10-17 Bruno Haible <bruno@clisp.org>
5732 * binary-io.h: Avoid warnings on Cygwin.
5734 2003-12-28 Bruno Haible <bruno@clisp.org>
5736 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5737 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5739 2003-11-28 Bruno Haible <bruno@clisp.org>
5741 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5743 2003-11-27 Bruno Haible <bruno@clisp.org>
5745 * wait-process.c: On Windows, include windows.h. Needed on mingw.
5747 2003-11-17 Bruno Haible <bruno@clisp.org>
5749 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5751 2003-11-24 Bruno Haible <bruno@clisp.org>
5753 * xallocsa.h: New file, from GNU gettext.
5754 * xallocsa.c: New file, from GNU gettext.
5756 2003-11-24 Bruno Haible <bruno@clisp.org>
5758 * allocsa.h: New file, from GNU gettext.
5759 * allocsa.c: New file, from GNU gettext.
5761 2003-11-24 Bruno Haible <bruno@clisp.org>
5763 * eealloc.h: New file.
5765 2004-01-15 Jim Meyering <jim@meyering.net>
5767 Merge from coreutils.
5769 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
5770 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
5771 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5773 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5774 optional configure-time default.
5776 * version-etc.c (version_etc_copyright): Update copyright date.
5778 * xreadlink.c (xreadlink): Correct outdated comment.
5780 2004-01-15 Paul Eggert <eggert@twinsun.com>
5782 Merge from coreutils.
5784 * posixver.c: Include posixver.h.
5786 * same.c: Include <stdbool.h>, <limits.h>.
5787 (_POSIX_NAME_MAX): Define if not defined.
5789 (same_name): If file names are silently truncated, report
5790 that the file names are the same if they are the same after
5791 the silent truncation.
5793 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5794 conversion function.
5795 * xstrtod.c (xstrtod): Likewise. All callers changed to
5796 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
5799 2004-01-14 Paul Eggert <eggert@twinsun.com>
5801 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5802 with like-named macro in fnmatch.c.
5803 (EXT): Use an internal constant instead.
5805 Merge fnmatch patches from glibc.
5806 * fnmatch.c (mbsinit): Remove define.
5807 Add libc_hidden_ver (__fnmatch, fnmatch).
5808 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5809 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5811 2003-12-14 Karl Berry <karl@gnu.org>
5813 * config.charset: update from gettext-runtime.
5815 2003-12-03 Paul Eggert <eggert@twinsun.com>
5817 * getgroups.c (getgroups): xmalloc takes one argument, not two.
5818 Bug reported by Alfred M. Szmidt.
5820 2003-11-29 Karl Berry <karl@gnu.org>
5822 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5824 2003-11-23 Paul Eggert <eggert@twinsun.com>
5825 Bruno Haible <bruno@clisp.org>
5827 * printf-parse.h: Don't include sys/types.h.
5828 (ARG_NONE): New macro.
5829 (char_directive): Change type of *arg_index fields to size_t.
5830 * printf-parse.c: Don't include sys/types.h.
5831 (SSIZE_MAX): Remove macro.
5832 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5833 Remove unnecessary overflow check.
5834 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5837 2003-11-24 Paul Eggert <eggert@twinsun.com>
5839 * alloca.c: Remove dependency on xalloc module.
5840 (xalloc_die): Remove.
5841 (memory_full) [!defined emacs]: New macro.
5842 [!defined emacs]: Don't include xalloc.h.
5843 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5844 address arithmetic overflows. Change datatypes a bit to avoid
5847 2003-11-22 Jim Meyering <jim@meyering.net>
5849 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5851 2003-11-17 Bruno Haible <bruno@clisp.org>
5853 * vasnprintf.c (alloca): Remove fallback definition.
5854 (freea): Remove definition.
5855 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5856 Reported by Paul Eggert.
5858 2003-11-17 Jim Meyering <jim@meyering.net>
5860 On systems without utime and without a utimes function capable of
5861 dealing with a NULL struct utimbuf* argument, this utime replacement
5862 could -- in unusual circumstances -- leak a file descriptor.
5863 * utime.c: Include <unistd.h> and <errno.h>.
5864 (utime_null): Be sure to close `fd' and to preserve errno.
5865 Reported by Geoff Collyer via Arnold Robbins.
5867 2003-11-16 Paul Eggert <eggert@twinsun.com>
5868 Bruno Haible <bruno@clisp.org>
5870 Protect against address arithmetic overflow.
5871 * printf-args.h: Include stddef.h.
5872 (arguments): Change type of field 'count' to size_t.
5873 * printf-args.c (printf_fetchargs): Use size_t instead of
5874 'unsigned int' where appropriate.
5875 * printf-parse.h: Include sys/types.h.
5876 (char_directive): Change type of *arg_index fields to ssize_t.
5877 (char_directives): Change type of fields 'count', max_*_length to
5879 * printf-parse.c: Include sys/types.h and xsize.h.
5880 (SSIZE_MAX): Define fallback value.
5881 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5882 instead of 'int' where appropriate. Check a_allocated, d_allocated
5883 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5884 * vasnprintf.c: Include xsize.h.
5885 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5886 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5887 overflow. Avoid wraparound when converting a width or precision from
5890 2003-11-16 Bruno Haible <bruno@clisp.org>
5892 Update from GNU gettext.
5893 * printf-parse.c: Generalize to it can be compiled for wide strings.
5894 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5895 * vasnprintf.c: Generalize to it can be compiled for wide strings.
5896 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5897 SNPRINTF): New macros.
5898 Don't include <alloca.h> if the file is used inside libintl.
5899 (local_wcslen): New function, for Solaris 2.5.1.
5900 (VASNPRINTF): Use it instead of wcslen.
5902 2003-11-16 Bruno Haible <bruno@clisp.org>
5904 * xsize.h (xmax): New function.
5905 (xsum, xsum3, xsum4): Declare as "pure" functions.
5907 2003-11-12 Paul Eggert <eggert@twinsun.com>
5909 * xalloc.h: Do not include <limits.h> or <stdint.h>.
5910 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5911 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
5912 heuristic is just as accurate as far as we know, and it removes a
5913 dependency on size_max.m4 and ptrdiff_max.m4.
5915 2003-11-12 Paul Eggert <eggert@twinsun.com>
5917 * xstrtol.c (__xstrtol): Remove "break" immediately after
5918 "return", to pacify some unknown compiler. Problem reported
5921 2003-11-11 Bruno Haible <bruno@clisp.org>
5923 * xsize.h (SIZE_MAX): Remove fallback definition.
5924 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5927 2003-11-10 Paul Eggert <eggert@twinsun.com>
5929 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5930 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5931 rejected some allocations of exactly SIZE_MAX - 2 bytes.
5933 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5934 not (size_t) -1, since it's defined here.
5936 2003-11-06 Paul Eggert <eggert@twinsun.com>
5938 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5939 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5940 Reject sizes of exactly SIZE_MAX bytes.
5941 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5942 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5944 2003-11-05 Bruno Haible <bruno@clisp.org>
5946 * xsize.h: Include limits.h, to avoid a possible collision with
5947 SIZE_MAX defined in <limits.h> on Solaris.
5949 2003-11-04 Bruno Haible <bruno@clisp.org>
5951 * xsize.h: New file.
5952 * linebreak.c: Include xsize.h.
5953 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5954 argument for overflow.
5955 Suggested by Paul Eggert.
5957 2003-10-31 Bruno Haible <bruno@clisp.org>
5959 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5960 to avoid (extremely rare) race condition.
5961 Suggested by Paul Eggert.
5963 2003-11-03 Jim Meyering <jim@meyering.net>
5965 * userspec.c: Include "userspec.h".
5966 * userspec.h: New file.
5968 2003-10-31 Paul Eggert <eggert@twinsun.com>
5970 * mountlist.h (struct mount_entry.me_type_malloced): New member.
5971 * mountlist.c (SIZE_MAX): Define if not defined already.
5972 (read_filesystem_list): Set and use me_type_malloced.
5973 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5974 whatever the type happens to be), for brevity and consistency.
5975 Check for size calculation overflow on Alphas running OSF/1.
5977 2003-10-31 Jim Meyering <jim@meyering.net>
5979 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5981 * linebuffer.c: Include <string.h> for declaration of memset.
5983 2003-10-30 Paul Eggert <eggert@twinsun.com>
5984 Bruno Haible <bruno@clisp.org>
5986 * vasprintf.c: Include <limits.h>, <stdlib.h>.
5987 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5989 2003-10-29 Paul Eggert <eggert@twinsun.com>
5991 * xalloc.h (xalloc_oversized): Now a macro, not a function,
5992 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
5994 * quotearg.c (quotearg_n_options): Use it.
5995 * group-member.c: Include <stdbool.h>.
5996 (free_group_info): Arg is now const *; don't free arg.
5997 (get_group_info): Now returns bool and accepts struct group_info *,
5998 rather than returning a malloc'ed struct group_info *.
5999 All uses changed. Check for overflow in internal size calculation.
6001 * getusershell.c (readname): Simplify the code by using x2nrealloc
6002 rather than xmalloc/xrealloc.
6003 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6004 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6005 conformance bug: the old code used a pointer after freeing the
6006 storage that it addressed.
6007 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6008 rather than doing it by hand.
6009 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6010 the buffer preserved. Use free and xmalloc instead.
6011 * quotearg.c (quotearg_n_options): Likewise.
6012 Use a simpler test for size overflow. Don't use xalloc_oversized
6013 because unsigned int might be wider than size_t (!); this suggests
6014 that we should switch from unsigned int to size_t for slot numbers.
6016 2003-10-27 Bruno Haible <bruno@clisp.org>
6018 * stdbool_.h: Better support for BeOS.
6020 2003-10-27 Paul Eggert <eggert@twinsun.com>
6022 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6023 to allocate the returned structure. Do not allocate a subarray,
6024 as x2nrealloc will do that.
6025 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6026 instead of xnrealloc.
6027 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6029 2003-10-26 Paul Eggert <eggert@twinsun.com>
6031 * xalloc.h (xalloc_oversized): New static inline function, for
6032 callers that want to do their own size-overflow checking. Include
6033 <stdbool.h>, since xalloc_oversized returns bool.
6034 * xalloc.c (array_size_overflow): Remove. All callers changed
6035 to use xalloc_oversized.
6037 Add two functions x2realloc, x2nrealloc, for programs that grow
6038 arrays dynamically by doubling their sizes.
6039 * xalloc.h (x2realloc, x2nrealloc): New decls.
6040 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6043 Port to C99 semantics for 'inline' of external functions.
6044 Bug reported by Bruno Haible.
6045 * xmalloc.c (xnmalloc_inline): New static inline function,
6046 with the old contents of xnmalloc.
6047 (xnmalloc, xmalloc): Use it.
6048 (xnrealloc_inline): New static inline function,
6049 with the old contents of xnrealloc.
6050 (xnrealloc, xrealloc): Use it.
6052 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6054 2003-10-25 Paul Eggert <eggert@twinsun.com>
6056 Fix several address-calculation bugs in the hash modules,
6057 plus some minor code cleanup.
6059 * hash.h: Include <stdbool.h>, for bool.
6060 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6061 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6062 hash_get_n_entries, hash_get_max_bucket_length,
6063 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6064 hash_rehash): Use size_t rather than unsigned.
6065 * hash.c (struct hash_table, hash_get_n_buckets,
6066 hash_get_n_buckets_used, hash_get_n_entries,
6067 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6068 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6069 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6071 (SIZE_MAX): Define if not defined.
6072 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6073 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6075 Use const * when possible.
6076 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6077 (check_tuning): Fix bug: if tuning parameters were very close to
6078 0 or 1, rounding errors could have caused subscript violations.
6079 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6080 (hash_initialize): Add 'fail:' label
6081 to free table and return NULL, and use it to simplify code.
6082 Use calloc rather than clearing the storage ourself.
6083 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6084 buffer size calculations.
6085 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6086 Include <stddef.h>, for size_t.
6087 * hash-pjw.c (hash_pjw): Likewise.
6088 Switch to method described by Bruno Haible.
6089 Include <limits.h>, for CHAR_BIT.
6090 (SIZE_BITS): New macro.
6092 2003-10-21 Paul Eggert <eggert@twinsun.com>
6094 * getndelim2.c (getndelim2): When size calculation overflows,
6095 ceiling the allocation at NMAX bytes rather than silently
6096 discarding input bytes before NMAX is reached. This makes
6097 a difference only if NMAX exceeds SIZE_MAX / 2.
6099 * obstack.c: Merge from glibc.
6100 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6101 Add libc_hidden_def (_obstack_newchunk).
6102 (_obstack_free) [! defined _LIBC]: Remove.
6103 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6104 a clone of the function body.
6105 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6106 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6108 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6109 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6112 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6113 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6114 Don't use lvalue casts, as GCC plans to remove support for them
6115 in GCC 3.5. Reported by Joseph S. Myers. This bug
6116 was also present in the non-GCC version, indicating that this
6117 code had always been buggy and had never been widely used.
6118 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6119 Use the fast variant of each macro, rather than copying the
6120 definiens of the fast variant; that way, we'll be more likely to
6121 catch future bugs in the fast variants.
6123 2003-10-20 Bruno Haible <bruno@clisp.org>
6125 * wait-process.h: New file, from GNU gettext.
6126 * wait-process.c: New file, from GNU gettext.
6128 2003-10-19 Jim Meyering <jim@meyering.net>
6130 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6132 2003-10-16 Paul Eggert <eggert@twinsun.com>
6134 * getgroups.c: Include <errno.h>, <stdlib.h>.
6135 (getgroups): First arg is int, not size_t.
6136 Don't let 'free' mangle errno.
6138 2003-10-16 Jim Meyering <jim@meyering.net>
6140 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6142 2003-10-15 Paul Eggert <eggert@twinsun.com>
6144 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6146 (new_exclude, add_exclude_file): Initial size no longer needs to
6148 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6149 our own address arithmetic overflow checking.
6151 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6152 (fnmatch): Do not alloca more than 2000 wide characters;
6153 instead, use malloc for large buffers.
6154 Check for address arithmetic overflow, and return -1
6155 with errno set to ENOMEM in that case.
6156 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6157 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6158 instead, return -1. Check for address arithmetic overflow.
6160 2003-10-14 Paul Eggert <eggert@twinsun.com>
6162 Handle invalid suffixes and overflow independently, so that
6163 callers can treat them independently as needed. Fix some bugs in
6164 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6165 suffix for a human-readable blocksize. The major caller-visible
6166 change is the addition of a new
6167 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6168 that both overflow and suffix chars were found.
6170 * human.c (humblock): Don't check separately for invalid suffix
6171 char; that is xstrtoumax's job (now that its bug is fixed).
6172 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6173 INTMAX_MAX]: New macros.
6174 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6175 TYPE_MAXIMUM): New macros.
6176 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6177 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6178 if overflow occurs, as it's what __strtol does and it's more useful
6180 (__xstrtol): If __strtol reports some error other than ERANGE,
6181 reflect it to the caller as LONGINT_INVALID. If it reports
6182 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6183 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6184 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6186 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6187 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6188 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6189 [defined UINTMAX_MAX]: New macros.
6191 2003-10-14 Bruno Haible <bruno@clisp.org>
6193 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6194 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6195 Also use volatile where needed.
6197 2003-10-12 Paul Eggert <eggert@twinsun.com>
6199 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6200 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6201 and define in terms of the other primitives.
6202 * xmalloc.c: Include stdbool.h; do not include exit.h.
6203 (SIZE_MAX): Define if not already defined.
6204 (array_size_overflow): New function.
6205 (xalloc_die): Abort instead of exiting if 'error' returns.
6206 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6207 (xmalloc, xrealloc): Use them.
6208 (xcalloc): Check for address arithmetic overflow.
6209 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6210 a bit faster than strcpy.
6212 2003-10-08 Paul Eggert <eggert@twinsun.com>
6214 Merge getpass from libc, plus a few fixes.
6216 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6217 Include <stdbool.h>.
6218 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6219 __fsetlocking to empty.
6220 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6221 do include <bits/libc-lock.h>.
6222 Do not include <fcntl.h>; not needed.
6223 [_LIBC]: Include <wchar.h>.
6224 (NOTCANCEL_MODE): New macro.
6225 (flockfile, funlockfile) [_LIBC]: New macros.
6226 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6227 [!_LIBC]: New macros.
6228 (call_fclose): New function.
6229 (getpass): Use it. Save tty stream separately; this simplifies the
6230 code and makes it more reliable if stdin happens to equal stdout.
6231 Invoke __fsetlocking on tty.
6232 Handle thread cancellation if needed.
6233 Namespace cleanup (use __tcgetattr, __getline).
6234 Use bool for Booleans.
6235 [USE_IN_LIBIO]: Handle wide streams.
6236 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6237 stream might go where.
6239 * unlocked-io.h: Include <stdio.h>, so that the caller
6240 doesn't have to include <stdio.h> before us.
6241 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6242 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6243 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6244 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6245 if not declared, so that we can use getpass.c code from libc without
6247 (flockfile, ftrylockfile, funlockfile): New macros.
6249 2003-10-06 Bruno Haible <bruno@clisp.org>
6251 * version-etc-2.h: Remove file.
6252 * version-etc-2.c: Remove file.
6254 2003-09-25 Jim Meyering <jim@meyering.net>
6255 Bruno Haible <bruno@clisp.org>
6257 This lets translators provide better translations for the
6258 "Written by ..." part of --version output.
6259 * version-etc.h: Include stdarg.h.
6260 (version_etc_copyright): Declare as readonly.
6261 (version_etc): Make this function variadic with a NULL-terminated list
6262 of author name strings.
6263 (version_etc_va): New declaration.
6264 * version-etc.c: Include stdarg.h, stdlib.h.
6265 (version_etc_copyright): Declare as readonly.
6266 (version_etc_va): New function. Provide a different translatable string
6267 for each possible number of authors < 10. Abbreviate when there are 10
6269 (version_etc): Make this function variadic. Call version_etc_va.
6270 Suggestion from Gary V. Vaughan.
6272 * long-options.h (parse_long_options): Change prototype: the authors
6273 string is moved to the end and becomes variadic.
6274 * long-options.c: Include stdarg.h.
6275 (parse_long_options): Make this function variadic, too.
6276 Call version_etc_va, not version_etc.
6278 2003-10-06 Bruno Haible <bruno@clisp.org>
6280 * fatal-signal.h: New file, from GNU gettext.
6281 * fatal-signal.c: New file, from GNU gettext.
6283 2003-10-04 Karl Berry <karl@gnu.org>
6285 * argp*: update from libc.
6287 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6289 * getpass.c (getpass): Use a no-op fseek when switching from input to
6290 output mode on the same stream.
6292 2003-09-29 Paul Eggert <eggert@twinsun.com>
6294 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6295 Fix arg typo in previous patch.
6297 2003-09-28 Jim Meyering <jim@meyering.net>
6299 * error.c: Correct cpp indentation.
6301 2003-09-27 Paul Eggert <eggert@twinsun.com>
6303 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6304 Omit the special code that used __typeof__, since we worry that
6305 it could be more trouble than it's worth. See:
6306 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6307 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6311 2003-09-26 Jim Meyering <jim@meyering.net>
6313 * error.c (error_tail): Move some declarations
6314 into inner scope where the local variables are used.
6316 2003-09-26 Bruno Haible <bruno@clisp.org>
6318 * stpncpy.h (gnu_stpncpy): New declaration.
6319 (stpncpy): Define as alias for gnu_stpncpy.
6320 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6322 2003-09-26 Paul Eggert <eggert@twinsun.com>
6324 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6325 (error_tail): Do not loop, reallocating temporary buffer, since
6326 the output cannot contain more wide characters than the input
6327 contains bytes, the size must be big enough already. This avoids
6328 one potential size overflow calculation. Check for size overflow
6329 when calculating temporary buffer size. Free temporary buffer
6330 when done, if it was allocated with malloc; this plugs a memory
6331 leak. Remove casts from void * to pointers, that are no longer
6332 needed now that we're assuming C89 or better.
6334 Merge error changes from glibc.
6336 * error.c, error.h: Update copyright notice header to match glibc.
6337 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6338 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6339 Disable cancellation while printing error.
6340 * error.h: Prepend __ to parameter names.
6342 2003-09-25 Karl Berry <karl@gnu.org>
6344 * argp-fmtstream.c, argp-help.c: update from libc.
6346 2003-09-25 Bruno Haible <bruno@clisp.org>
6348 * version-etc-2.h: New file, from version-etc.h with modifications.
6349 * version-etc-2.c: New file, from version-etc.c with modifications.
6351 2003-09-25 Simon Josefsson <jas@extundo.com>
6353 * xgetdomainname.h: New file.
6354 * xgetdomainname.c: New file.
6356 2003-09-25 Simon Josefsson <jas@extundo.com>
6357 Bruno Haible <bruno@clisp.org>
6359 * getdomainname.h: New file.
6360 * getdomainname.c: New file.
6362 2003-09-24 Paul Eggert <eggert@twinsun.com>
6364 * linebuffer.c (freebuffer): Don't free the argument, just
6365 the buffer associated with the argument. Bug reported by
6368 2003-09-19 Karl Berry <karl@gnu.org>
6370 * argp.h: update from libc.
6372 2003-09-16 Paul Eggert <eggert@twinsun.com>
6374 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6375 input error, instead of returning NULL the next time we are called
6376 (and therefore losing track of errno).
6378 2003-09-15 Paul Eggert <eggert@twinsun.com>
6380 * getndelim2.c (getndelim2): Don't trash errno when a read
6381 fails, so that the caller gets the proper errno.
6383 * readutmp.c (read_utmp): Likewise.
6384 Check for fstat error. Close stream and free storage
6387 2003-09-14 Bruno Haible <bruno@clisp.org>
6389 * fwriteerror.h: New file.
6390 * fwriteerror.c: New file.
6392 2003-09-14 Jim Meyering <jim@meyering.net>
6394 * getloadavg.c: Correct cpp indentation.
6395 * strdup.c: Likewise.
6396 * vasnprintf.c: Likewise.
6398 2003-09-12 Paul Eggert <eggert@twinsun.com>
6400 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6401 * obstack.c [!defined _LIBC]: Likewise.
6402 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6403 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6404 * exitfail.c: Don't include stdlib.h; no longer needed.
6406 More changes to assume C89 or better.
6408 * error.c (error_tail): Assume vprintf.
6410 * argmatch.c (getenv): Remove decl.
6411 * progreloc.c (get_full_program_name): Define via prototype.
6412 * setenv.c (clearenv): Likewise.
6413 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6415 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6416 (malloc, memcpy): Remove decls.
6417 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6418 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6419 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6420 (memcpy): Remove macro.
6421 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6422 (__P): Remove. All uses removed.
6423 (PTR): Remove. All uses changed to void *.
6424 (CHAR_BIT, NULL): Remove.
6425 (spaces, zeros, memset_space, memset_zero)
6426 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6428 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6429 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6430 Define with prototype.
6431 Remove now-unnecessary prototype decl.
6432 (extra_args_spec): Assume ANSI C. All uses changed.
6433 (extra_args_spec_iso): Remove.
6434 (my_strftime, emacs_strftimeu): Define via prototype.
6435 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6437 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6438 * strtoimax.c: Include <stdlib.h> unconditionally.
6439 (strtoul, strtol): Remove decls.
6440 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6442 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6443 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
6444 (LOCALE_PARAM_PROTO): New macro.
6445 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6446 (INTERNAL (strtol), strtol): Define with a prototype.
6447 (PARAMS): Remove. All uses removed.
6448 * tempname.c: Include <string.h> unconditionally.
6449 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6450 * xgethostname.c (main): Define with a prototype.
6451 * xmalloc.c: Include "xalloc.h" first, to check interface.
6452 Include <stdlib.h> unconditionally.
6453 (calloc, malloc, realloc, free): Remove decls.
6454 * xstrtod.c: Include "xstrtod.h" first, to check interface.
6455 Include <stdlib.h> unconditionally. Sort include file names.
6457 (xstrtod): Define with a prototype.
6458 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6459 (strtol, strtoul): Remove decls.
6461 2003-09-11 Paul Eggert <eggert@twinsun.com>
6463 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6464 Include <stdlib.h>, <string.h> unconditionally.
6465 Remove now-unnecessary cast to char *.
6466 * strnlen.c: Include <string.h> unconditionally.
6467 * yesno.c (yesno): Define with a prototype.
6469 2003-09-10 Bruno Haible <bruno@clisp.org>
6471 * strcspn.c: Include <string.h> unconditionally.
6472 * strpbrk.c: Include <string.h> unconditionally.
6473 * strstr.c: Include <string.h> unconditionally.
6474 * unicodeio.c: Include <string.h> unconditionally.
6475 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6476 * unsetenv.c: Likewise.
6477 * xreadlink.c: Include <stdlib.h> unconditionally.
6478 * yesno.c: Include <stdlib.h> unconditionally.
6479 (rpmatch): Add prototype.
6481 2003-09-10 Jim Meyering <jim@meyering.net>
6483 * error.c: Correct indentation of cpp directives.
6485 2003-09-09 Paul Eggert <eggert@twinsun.com>
6489 * acosl.c (main): Use a prototype.
6490 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6493 * getloadavg.c (getloadavg, main): Define via prototypes.
6495 * getopt.h (struct option.name): Assume C89, and use 'const'.
6496 (getopt, etopt_long, getopt_long_only, _getopt_internal)
6497 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6499 * getopt.c (const): Remove macro.
6500 Include <string.h> unconditionally.
6501 (my_index): Remove; all uses changed to strchr.
6502 (strlen): Remove decl.
6503 (exchange): Remove forward decl; no longer needed.
6504 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6505 Define with prototype.
6506 * getopt1.c (const): Remove macro.
6507 (getopt_long, getopt_long_only, main): Define with prototype.
6509 * getugroups.c: Include <string.h> unconditionally.
6511 * getusershell.c: Include <stdlib.h> unconditionally.
6512 (getusershell, setusershell, endusershell, readname, main):
6513 Define with prototypes.
6515 * group-member.c: Include group-member.h first.
6516 Include <stdlib.h> unconditionally.
6518 * hard-locale.c: Include hard-locale.h first.
6519 Include <stdlib.h>, <string.h> unconditionally.
6521 * hash.c (free, malloc): Remove decls.
6522 Include <stdlib.h> unconditionally.
6524 * human.c: Include <stdlib.h>, <string.h> unconditionally.
6525 (getenv): Do not declare.
6527 * idcache.c: Include <string.h> unconditionally.
6529 * long-options.c: Include long-options.h first, to test interface.
6530 Include <stdlib.h> unconditionally.
6532 * makepath.c: Include makepath.h first, to test interface.
6533 Include <stdlib.h> and <string.h> unconditionally.
6535 * linebuffer.c: Include <stdlib.h>.
6536 (free): Remove decl.
6538 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6539 rpl_malloc returns void *, not char *.
6540 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
6542 * md5.h: Include <limits.h> unconditionally.
6543 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6544 (__P): Remove; all uses removed.
6545 * md5.c: Include "md5.h" first.
6546 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6547 md5_buffer, md5_process_bytes, md5_process_block):
6548 Define with prototypes.
6549 * sha.h (__P): Remove all uses. (It wasn't defined??)
6550 * sha.c: Include "sha.h" first.
6551 Include <stdlib.h>, <string.h> unconditionally.
6553 * memchr.c (__ptr_t): Remove; all uses changed to void *.
6554 * memcmp.c (__ptr_t): Likewise.
6555 * memrchr.c (__ptr_t): Likewise.
6556 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6557 Include <string.h> unconditionally.
6558 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6559 * memchr.c: Include <stdlib.h> unconditionally.
6560 * memchr.c (LONG_MAX): Remove.
6561 * memrchr.c (LONG_MAX): Likewise.
6562 * memchr.c (__memchr): Define via a prototype.
6563 * memrchr.c (__memrchr): Likewise.
6564 * memcmp.c (__P): Remove, and remove all uses.
6565 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6566 Remove forward decls; no longer needed.
6567 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6568 Use types required by C89 in prototype.
6570 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6571 * savedir.c: Likewise.
6572 * mkdir.c (free): Remove decl.
6573 * rmdir.c (rmdir): Define with a prototype.
6574 * savedir.c: Include savedir.h first, to test interface.
6576 * mktime.c (STDC_HEADERS): Remove.
6577 Include <stdlib.h>, <string.h> unconditionally.
6579 * modechange.c: Include <stdlib.h> unconditionally.
6580 (malloc): Remove decl.
6582 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6583 (free): Remove decl.
6585 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6586 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6587 (This type really should be intptr_t, but that's a C99ism.)
6588 (_obstack_memcpy): Remove: all uses changed to memcpy.
6589 Include <string.h> unconditionally.
6590 (struct obstack): Assume __STDC__ for types of members
6591 chunkfun, freefun, extra_arg.
6592 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6593 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6594 obstack_begin, obstack_specify_allocation,
6595 obstack_specify_allocation_with_arg, obstack_chunkfun,
6596 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6597 Remove unprototyped decls and the macros that use them.
6598 * obstack.c (POINTER): Remove. All uses changed to void *.
6599 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6600 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6601 (defined __STDC__ && __STDC__)]:
6602 Remove nonprototyped code.
6603 Include <stdlib.h> unconditionally.
6604 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6605 _obstack_allocated_p, _obstack_free, obstack_free,
6606 _obstack_memory_used, print_and_abort):
6607 Define using prototypes.
6608 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6609 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6610 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6611 obstack_next_free, obstack_object_size, obstack_room) [0]:
6612 Remove unused, unprototyped code.
6614 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6616 * physmem.c (physmem_total, physmem_available, main): Define
6619 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6620 (main): Define with a prototype.
6622 * posixver.c (getenv): Remove decl.
6624 * putenv.c (malloc): Returns void *, not char *.
6625 Include <string.h> unconditionally.
6626 (strchr, memcpy, NULL): Do not define.
6628 * readtokens.c: Include readtokens.h first, to test interface.
6629 Include <stdlib.h>, <string.h> unconditionally.
6630 (init_tokenbuffer): Define with a prototype.
6632 * regex.c (PARAMS): Remove. All uses removed.
6633 All uses of _RE_ARGS removed, too.
6634 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6636 (bzero): Assume memset exists.
6637 (memcmp, memcpy, NULL): Remove.
6638 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6639 char, or assignments to local vars of type signed char.
6640 (init_syntax_once, PREFIX(extract_number_and_incr),
6641 PREFIX(print_partial_compiled_pattern),
6642 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6643 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6644 PREFIX(regex_grow_registers), PREFIX(regex_compile),
6645 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6646 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6647 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6648 wcs_compile_range, byte_compile_range, truncate_wchar,
6649 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6650 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6651 count_mbs_length, wcs_re_match_2_internal,
6652 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6653 PREFIX(alt_match_null_string_p),
6654 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6655 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6656 regfree, PREFIX(extract_number)): Define with prototype. Remove
6657 now-unnecessary declaration, if any.
6658 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6660 Remove now-unnecessary casts among pointer types.
6661 * regex.h (_RE_ARGS): Remove. All uses removed.
6663 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6664 (free): Remove decl.
6666 * rpmatch.c: Include <stdlib.h> unconditionally.
6668 * same.c: Include <stdlib.h>, <string.h> unconditionally.
6669 (free): Remove decl.
6671 * save-cwd.c: Include <stdlib.h> unconditionally.
6672 * xgetcwd.c: Likewise.
6674 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6675 (free): Remove decl.
6677 * strchrnul.c (strchrnul): Define with a prototype.
6678 Fix bug: c_in was not converted to char before searching.
6680 The following changes are not K&R related:
6682 * group-member.h: Include <sys/types.h>, so that this file is
6684 * makepath.h: Likewise.
6686 * getusershell.c (readname, default_index, line_size, readname):
6687 Use size_t, not int, for sizes.
6688 (readname): If the size overflows, report an error instead of
6691 2003-09-09 Derek Robert Price <derek@ximbiot.com>
6693 * getndelim2.c: Assume stdlib.h per the C89 spec.
6695 2003-09-08 Paul Eggert <eggert@twinsun.com>
6697 Assume C89 or better; remove K&R cruft.
6698 A few of these changes were first proposed by Derek Robert Price
6699 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6701 * addext.c: Include <string.h> unconditionally.
6702 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6703 Don't declare getenv or malloc.
6705 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6706 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6708 (find_stack_direction, alloca): Use prototypes.
6710 * atexit.c (atexit): Define using a prototype.
6712 * basename.c, dirname.c, stripslash.c:
6713 Include <string.h> unconditionally.
6715 * bcopy.c: Include <stddef.h>.
6716 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6718 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6720 * error.h (error, error_at_line, error_print_progname)
6721 [! (defined (__STDC__) && __STDC__)]: Remove decls.
6722 * error.c: Include error.h first, to check interface.
6723 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6724 (VA_START): Remove; all uses changeed to va_start.
6725 (exit, strerror): Remove decls.
6726 (error_print_progname): Prototype uncondionally.
6727 Don't include <errno.h>; no longer needed.
6728 (private_strerror): Remove.
6729 (error_tail): Always define.
6730 (error, error_at_line): Assume C89 or better; always use prototypes.
6731 * fatal.c: Include "fatal.h" first, to test interface.
6732 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6733 (VA_START): Remove; all uses changed to va_start.
6734 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6736 (exit): Remove decl.
6737 (fatal): Prototype unconditionally. Assume va_start works.
6738 Abort at end, to pacify gcc.
6740 * euidaccess.c (main): Define with a prototype.
6742 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6744 * exitfail.c: Include <stdlib.h> unconditionally.
6746 * fnmatch_.h (__P): Remove. All uses changed to assume
6748 * fnmatch.c: Include fnmatch.h first, to test interface.
6749 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6750 (getenv): Remove decl.
6751 (fnmatch): Define using a prototype.
6752 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6753 (FCT): Define using a prototype.
6755 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6757 * gethostname.c: Include <stddef.h>.
6758 (gethostname): Define with prototype. Length is size_t, not int.
6760 2003-09-08 Paul Eggert <eggert@twinsun.com>
6762 * getversion.c: Remove; was migrated to backupfile.c in 1997.
6763 getversion.c should have been removed then, but was accidentally
6766 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6767 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6769 2003-09-07 Paul Eggert <eggert@twinsun.com>
6771 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6772 copy_tm_result. Bug reported by Simon Josefsson in
6773 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6775 2003-09-06 Paul Eggert <eggert@twinsun.com>
6777 * time_r.c, time_r.h: New files.
6779 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6781 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
6782 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6784 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6786 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6787 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6790 * timegm.c: Switch to glibc implementation, with the following changes:
6791 [defined HAVE_CONFIG_H]: Include <config.h>.
6792 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6793 (__mktime_internal) [!defined _LIBC]: New decl.
6794 (__gmtime_r) [!defined _LIBC]: New macro and function.
6795 (timegm): Use a prototype, since gnulib assumes C89.
6796 Do not bother declaring tmp to be const, as it's not really usefu.
6797 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6798 (timegm): Declare only if HAVE_DECL_TIMEGM.
6800 2003-09-03 Paul Eggert <eggert@twinsun.com>
6802 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6803 Bug reported by Lute Kamstra in
6804 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6806 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6807 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
6808 course with correspondingly smaller numbers for tomorrow and
6809 yesterday. From Tadayoshi Funaba. Originally installed into
6810 sh-utils on 1999-08-07, but the patch got lost (I guess during the
6813 2003-08-31 Simon Josefsson <jas@extundo.com>
6815 * timegm.h: New file.
6816 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
6818 2003-08-31 Karl Berry <karl@gnu.org>
6820 * argp.h: update from libc.
6822 2003-08-28 Bruno Haible <bruno@clisp.org>
6824 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6825 warning on QNX, which defines O_BINARY to 000000.
6827 2003-08-24 Bruno Haible <bruno@clisp.org>
6829 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6830 MSVC7 <stdio.h> is included later.
6832 2003-08-20 Bruno Haible <bruno@clisp.org>
6834 * progname.h: New file, from GNU gettext.
6835 * progname.c: New file, from GNU gettext.
6836 * progreloc.c: New file, from GNU gettext.
6838 2003-08-19 Bruno Haible <bruno@clisp.org>
6840 * xstrdup.c: Assume <string.h> exists.
6842 2003-08-18 Jim Meyering <jim@meyering.net>
6844 * setenv.h: Indent nested cpp directive.
6845 * vasnprintf.c: Remove trailing blanks.
6847 2003-08-17 Simon Josefsson <jas@extundo.com>
6848 Bruno Haible <bruno@clisp.org>
6850 * xstrndup.h: New file.
6851 * xstrndup.c: New file.
6853 2003-08-17 Bruno Haible <bruno@clisp.org>
6855 * strndup.h: New file.
6857 2003-08-16 Paul Eggert <eggert@twinsun.com>
6859 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6860 space, undoing this 2003-08-12 change:
6861 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6863 2003-08-16 Jim Meyering <jim@meyering.net>
6865 Merge from coreutils.
6866 * xstrtoimax.c: #else #if -> #elif.
6867 * xstrtoumax.c: Likewise.
6869 2003-08-15 Paul Eggert <eggert@twinsun.com>
6871 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6872 rather than tab, after '#' in shell-script copyright notices.
6873 Suggested by Bruno Haible.
6875 2003-08-15 Jim Meyering <jim@meyering.net>
6876 and Paul Eggert <eggert@twinsun.com>
6878 Merge from coreutils.
6879 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6880 member but strut utmpx does not. Needed for AIX 4.3.3.
6881 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6883 2003-08-15 Jim Meyering <jim@meyering.net>
6885 Merge from coreutils.
6886 * xgethostname.c: Include <stdlib.h>.
6887 (xghostname): Don't exit for anything other than memory-related
6888 failure; just return NULL.
6889 * userspec.c: Include "posixver.h".
6890 (parse_user_spec): Accept `.' as a separator only
6891 in pre-POSIX-200112 mode.
6892 * strtoimax.c: Use #elif rather than #else #if.
6893 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6894 Remove function, now that we can rely on a working tzset function.
6895 [!_LIBC]: Ensure that the required autoconf test has been run.
6896 [!defined _NL_CURRENT && HAVE_STRFTIME]:
6897 Use underlying_strftime for %r.
6898 * sha.c: Merge in some clean-up and optimization changes from glibc.
6899 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6900 Ensure that it is a multiple of 64.
6901 Rearrange loop exit tests so as to avoid performing an
6902 additional fread after encountering an error or EOF.
6903 * realloc.c: Update copyright date.
6905 2003-08-14 Jim Meyering <jim@meyering.net>
6907 Merge from coreutils.
6908 * obstack.h: Whitespace changes.
6909 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6910 and xcalloc return values.
6911 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6912 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
6913 hang on OSF/1 5.1 for DIR on both local and remote file systems.
6914 Reported by (and fix confirmed by) Nelson H. F. Beebe.
6915 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6917 Use mntctl's return value to drive the entry-processing loop, since
6918 we can't rely on the value of the vmt_length member in the last
6919 entry. On some systems doing so could result in exhausting
6920 virtual memory. Based in part on a patch from Mike Jetzer.
6922 2003-08-14 Jim Meyering <jim@meyering.net>
6923 and Paul Eggert <eggert@twinsun.com>
6925 Merges from coreutils, plus other fixes.
6926 * physmem.c: Merge in portability changes from gcc/libiberty
6927 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
6928 for credits and details. Thanks to Kaveh Ghazi for helping
6929 to keep these files in sync.
6930 (ARRAY_SIZE): Define it.
6931 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6932 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6933 (memcasecmp): Don't assume size_t fits in unsigned int.
6934 Remove casts and duplicate code.
6935 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6936 (memcpy): Remove definition.
6937 Merge in some clean-up and optimization changes from glibc.
6938 [BLOCKSIZE]: Move definition to top of file.
6939 Ensure that it is a multiple of 64.
6940 Rearrange loop exit tests so as to avoid performing an
6941 additional fread after encountering an error or EOF.
6942 * md5.h (md5_uintptr): Define.
6943 * makepath.c (CLEANUP_CWD): Report an error if we failed to
6944 return to the initial working directory. Preserve errno
6946 * idcache.c: Include "xalloc.h".
6947 (xmalloc, xrealloc): Remove decls.
6948 (getuser): Remove casts no longer required in C89.
6949 * human.c: Include stdio.h, for sprintf.
6950 * group-member.c: Include "xalloc.h".
6951 (xmalloc, xrealloc): Remove decls.
6952 (get_group_info): Remove casts no longer required in C89.
6953 * getusershell.c (readname): Remove casts no longer required in C89.
6954 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6955 * getline.c: Whitespace fix, from coreutils.
6957 2003-08-13 Paul Eggert <eggert@twinsun.com>
6959 * exclude.c: Include <ctype.h>
6960 (IN_CTYPE_DOMAIN): New macro.
6962 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6965 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6966 Undo previous (whitespace-only) change.
6968 2003-08-12 Paul Eggert <eggert@twinsun.com>
6970 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6971 Normalize leading white space and remove trailing white space.
6972 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6973 notice, as per ../config/srclist-update.
6975 Merge from coreutils.
6976 * euidaccess.h: New file.
6977 * euidaccess.c: Include it.
6978 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6979 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
6980 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6982 2003-08-11 Bruno Haible <bruno@clisp.org>
6984 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6985 (vasnprintf): Use it instead of wcslen.
6987 2003-08-11 Bruno Haible <bruno@clisp.org>
6989 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6990 value to ensure that _Bool promotes to int. Use #define for _Bool when
6991 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6993 2003-08-10 Karl Berry <karl@gnu.org>
6995 * regex.h: update from libc (whitespace fix).
6997 2003-08-09 Paul Eggert <eggert@twinsun.com>
6999 Merge some files from coreutils. These changes were
7000 originally made by Jim Meyering.
7001 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7002 many older Unixes require this.
7003 * alloca.c (alloca): Remove cast to argument of free;
7004 no longer needed in C89.
7005 * alloca_.h, regex.h: Fix white space to match
7006 what GNU indent does.
7008 2003-08-05 Paul Eggert <eggert@twinsun.com>
7010 * bumpalloc.h: Remove.
7012 2003-08-04 Paul Eggert <eggert@twinsun.com>
7014 * getloadavg.c: Change copyright notice and spacing to conform to
7017 Merge from coreutils.
7018 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7020 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7021 from Karl Berry, implemented by Jim Meyering.
7022 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7023 from Dmitry V. Levin.
7024 Remove anachronistic cast of xrealloc.
7025 * fnmatch_.h (__const): Remove. Use 'const'.
7026 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7027 type. Otherwise, it wouldn't compile with at least /bin/cc on
7028 ymp-cray-unicos9.0.2.X.
7029 Combine two mostly-identical uses of alloca into one.
7030 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7032 2003-08-04 Dave Love <d.love@dl.ac.uk>
7036 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7037 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7038 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7039 obsolete NLIST_NAME_UNION.
7040 [__GNU__]: Undef BSD and FSCALE.
7041 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7043 2003-08-03 Paul Eggert <eggert@twinsun.com>
7045 * stdbool_.h (_Bool): Make it signed char, instead of
7046 an enum type, so that it's guaranteed to promote to int. See:
7047 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7049 2003-07-31 Paul Eggert <eggert@twinsun.com>
7051 * strerror.c: Include config.h, limits.h. Declare sprintf.
7052 (strerror): Don't assume that a printable int fits in 14 bytes.
7054 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7055 Bruno Haible <bruno@clisp.org>
7057 * getline.h (getline, getdelim): Change return type to ssize_t.
7058 * getline.c (getline, getdelim): Likewise.
7059 Remove _GNU_SOURCE define; now it's defined in config.h through
7062 2003-07-22 Paul Eggert <eggert@twinsun.com>
7064 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7065 over-parenthesization in macros.
7067 Sync with coreutils.
7069 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7072 Use `exit_failure' for xalloc and xmemcoll instead of their own
7073 private exit-failure variables.
7074 * xalloc.h (xalloc_exit_failure): Remove.
7075 * xmalloc.c: Likewise. Include exitfail.h.
7076 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7077 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7078 * xmemcoll.c: Likewise. Include exitfail.h.
7079 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7081 2003-07-18 Paul Eggert <eggert@twinsun.com>
7083 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7084 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7085 to test that it can stand by itself. Include "exitfail.h".
7086 Clients should set exit_failure instead.
7087 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7089 2003-07-18 Andreas Schwab <schwab@suse.de>
7091 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7093 2003-07-18 Bruno Haible <bruno@clisp.org>
7095 * getndelim2.h: New file.
7096 * getndelim2.c: Make into a module of its own. Include config.h,
7098 (getndelim2): Make non-static. Change return type to ssize_t.
7099 * getline.h: Change argument names.
7100 * getline.c: Include getndelim2.h instead of getndelim2.c.
7101 * getnline.c: Include getndelim2.h.
7103 2003-07-17 Bruno Haible <bruno@clisp.org>
7105 * Makefile.am: Remove file.
7106 * Makefile.in: Remove file.
7108 2003-07-17 Bruno Haible <bruno@clisp.org>
7110 * getnline.h: New file.
7111 * getnline.c: New file.
7112 * getndelim2.c: New file, extracted from getline.c.
7113 (getndelim2): Renamed from getdelim2, with added nmax argument.
7114 * getline.c: Include getndelim2.c.
7115 (getdelim2): Moved out to getndelim2.c.
7116 (getline, getdelim): Update.
7118 2003-07-15 <karl@gnu.org>
7120 * vasnprintf.c: update from gettext.
7122 2003-07-15 Jim Meyering <jim@meyering.net>
7124 * makepath.c (make_path): Enclose diagnostic in _(...).
7126 2003-07-14 Paul Eggert <eggert@twinsun.com>
7128 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7129 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7130 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7131 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7132 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7133 updated automatically by ../config/srclist-update. This changes
7134 their license from LPGL to GPL.
7136 2003-07-14 Jim Meyering <jim@meyering.net>
7138 Don't emit diagnostics. Let callers do that.
7139 * save-cwd.c: Don't include "error.h".
7140 (save_cwd): Don't call error. Ensure that errno is valid
7141 when returning nonzero.
7143 * save-cwd.h (restore_cwd): Update prototype.
7144 * save-cwd.c (restore_cwd): Remove two parameters.
7145 Simplify. Don't call error upon failure. Let callers do that.
7146 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7147 when auditing is enabled. But don't bother updating the #if.
7149 2003-07-14 Simon Josefsson <jas@extundo.com>
7151 * mempcpy.h: New file.
7152 * mempcpy.c: New file.
7154 2003-07-14 Paul Eggert <eggert@twinsun.com>
7156 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7157 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7158 unicodeio.c, unicodeio.h, unlocked-io.h:
7159 Switch from LGPL to GPL.
7161 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7163 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7164 it breaks C++ compilation.
7165 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7167 2003-07-10 Jim Meyering <jim@meyering.net>
7169 * vasnprintf.c: Remove trailing blanks.
7170 Make cpp indentation consistent.
7172 2003-07-09 Paul Eggert <eggert@twinsun.com>
7174 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7175 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7176 Switch from LGPL to GPL.
7178 2003-07-07 Paul Eggert <eggert@twinsun.com>
7180 * mktime.c: Fix some boundary cases and remove need for floating point.
7182 Issue a compile-time diagnostic if time_t is floating point, or if
7183 two's complement arithmetic is not in effect, or if arithmetic
7184 right shift does not propagate the sign. These assumptions were
7185 all in the original code but they weren't checked.
7187 (TIME_T_MIDPOINT, verify): New macros.
7188 (__isleap): Remove; it has integer overflow problems.
7189 (leapyear): New function, without those problems.
7190 (ydhms_tm_diff): Remove; splitting into two parts.
7191 (ydhms_diff): New function, containing the arithmetic part of
7192 the old ydhms_tm_diff function. Issue a compile-time
7193 diagnostic if we are not using C99 integer division.
7194 Avoid casts when possible.
7195 (guess_time_tm): New function, containing the checking part of
7196 the old ydhms_tm_diff function. Return the new value, rather than
7197 the difference between it and the old. Accept a new argument T
7198 so that *T specifies the old value. Check for overflow in the result.
7200 (__mktime_internal): Use a time_t offset, not a long int offset.
7201 This undoes the 2003-06-04 change, which is no longer needed now
7202 that we have better overflow checking.
7203 (localtime_offset): Likewise.
7205 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7206 and long are 64-bit but int is only 32-bit.
7207 (ydhms_diff): Use long int to store year1 and yday1.
7208 Issue a compile-time diagnostic if long int is not wide enough.
7210 (__mktime_internal): Use long int to store adjusted year and yday.
7211 Use plain C rather than preprocessor commands, if that doesn't
7213 Check for overflow (and try to repair) after each probe
7214 rather than checking only at the very end. This avoids some bugs
7215 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7216 does not equal GMT offset at maximum time).
7217 Use integer to check for overflow rather than floating point; this
7218 is more portable to non-IEEE hosts, and is a tad faster.
7219 When we detect that we are oscillating between two values,
7220 don't check whether tm_isdst has the requested value, since
7221 we already know the answer. When tm_isdst has the wrong value,
7222 use a different heuristic to find the right one, based on the
7223 extreme values actually observed in practice in tz2003a,
7224 rather than the (overly optimistic) "previous 3 calendar quarters".
7226 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7227 "T const" to accommodate glibc style.
7228 (check_result): Use less-confusing report format. "long" -> "long int.
7230 Don't loop if the iteration overflows time_t.
7231 Allow a negative step in the iteration.
7233 2003-07-01 Paul Eggert <eggert@twinsun.com>
7235 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7236 having it depend on HAVE_SYS_TYPES_H.
7238 2003-06-25 Bruno Haible <bruno@clisp.org>
7240 * readlink.c: New file.
7242 2003-06-20 Bruno Haible <bruno@clisp.org>
7244 Assume C89, so PARAMS isn't needed.
7245 * unicodeio.h (PARAMS): Remove.
7246 * unicodeio.c: Don't use PARAMS.
7248 2003-06-18 Jim Meyering <jim@meyering.net>
7250 Merge changes from coreutils.
7251 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7252 Remove explicit declarations of xmalloc and realloc.
7254 (read_utmp): Remove anachronistic cast of xmalloc.
7256 2003-06-17 Paul Eggert <eggert@twinsun.com>
7258 Assume C89, so PARAMS isn't needed.
7259 * backupfile.h (PARAMS): Remove. All uses removed.
7260 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7261 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7262 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7263 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7264 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7265 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7266 xstrtol.h: Likewise.
7267 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7268 same.h, strverscmp.h: Do not include config.h; no longer needed.
7269 Anyway, config.h should always be included before any other file.
7271 2003-06-11 Simon Josefsson <jas@extundo.com>
7273 * sysexit_.h: New file.
7275 2003-05-20 Derek Price <derek@ximbiot.com>
7277 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7279 2003-06-10 Simon Josefsson <jas@extundo.com>
7281 * strchrnul.h: New file.
7282 * strchrnul.c: New file.
7284 2003-06-10 Simon Josefsson <jas@extundo.com>
7286 * argp.h: New file, from glibc.
7287 * argp-ba.c: New file, from glibc.
7288 * argp-eexst.c: New file, from glibc.
7289 * argp-fmtstream.c: New file, from glibc.
7290 * argp-fmtstream.h: New file, from glibc.
7291 * argp-fs-xinl.c: New file, from glibc.
7292 * argp-help.c: New file, from glibc.
7293 * argp-namefrob.h: New file, from glibc.
7294 * argp-parse.c: New file, from glibc.
7295 * argp-pv.c: New file, from glibc.
7296 * argp-pvh.c: New file, from glibc.
7297 * argp-xinl.c: New file, from glibc.
7299 2003-06-07 Jim Meyering <jim@meyering.net>
7301 * readtokens.h: Put `Free Software Foundation, Inc.'
7302 in place of my name in the copyright comment.
7303 Remove definition and uses of __P.
7306 * stat.c: Don't declare xmalloc explicitly.
7307 Instead, include "xalloc.h".
7308 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7309 xrealloc, and xcalloc return values.
7310 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7312 * xgetcwd.h: Remove definition/uses of PARAMS.
7314 2003-06-06 Jim Meyering <jim@meyering.net>
7316 * stdbool_.h: Renamed from stdbool.h.in.
7318 2003-06-06 Jim Meyering <jim@meyering.net>
7320 Merge from coreutils.
7321 * same.c: (same_name): Declare *_basename locals to be `const'.
7322 Consolidate declarations and initializations of *_base* locals.
7324 Merge from coreutils.
7325 This avoids a core dump on systems without GNU putenv,
7326 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7327 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7328 (unsetenv): New static function, from GNU libc.
7329 (rpl_putenv): Use it.
7331 * modechange.c: Remove trailing blanks.
7333 Merge from coreutils.
7334 * fsusage.c: Remove declaration of statfs.
7335 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7337 * posixtm.c: Include <stdbool.h> unconditionally.
7339 2003-06-05 Paul Eggert <eggert@twinsun.com>
7341 * mktime.c (__mktime_internal): When resolving a tm_isdst
7342 mismatch, look in future quarters as well as past. This fixes a
7343 bug when processing fall-backwards gaps immediately after a long
7344 period of daylight-saving time.
7346 * mktime.c: Assume freestanding C89 or better.
7347 (HAVE_LIMITS_H): Remove. Assume it's 1.
7348 (__P): Remove; not used.
7349 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7350 (mktime, not_equal_tm, print_tm, check_result,
7351 main): Use prototypes. Use const * where appropriate.
7352 (main): Fix typo in testing code that uncovered by above changes.
7353 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7355 2003-06-04 Paul Eggert <eggert@twinsun.com>
7357 * mktime.c: Fix Debian bug 177940
7358 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7359 (localtime_offset): Now long int, not time_t, because we want it
7360 to be guaranteed to be signed. All uses changed.
7361 (__mktime_internal): If overflow would occur when adding offset,
7364 Merge 'human' changes from coreutils. Rewrite to support
7365 locale-specific notations like thousands separators.
7366 * human.c: Simplify authorship notice.
7367 Include human.h immediately after config.h.
7368 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7369 <limits.h>: Do not include, since human.h does.
7370 (SIZE_MAX, UINTMAX_MAX): New macros.
7371 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7372 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7373 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7374 (power_letter): Renamed from suffixes.
7375 (generate_suffix_backwards): Remove.
7376 (adjust_value): Now takes int style (because of human.h changes)
7377 and long double value (for greater precision on some platforms).
7378 (group_number): New function.
7379 (human_readable): Use it. Use integer options, not enum.
7380 Put the options before the sizes in the arg list.
7381 Support all the new options.
7382 The old human_readable function has been removed;
7383 use inttostr.h instead.
7384 (human_readable, default_block_size, humblock):
7385 Use uintmax_t, not int, for block sizes.
7386 (human_readable_inexact, block_size_types): Remove.
7387 (block_size_opts): New constant.
7388 (human_options): Renamed from human_block_size, with new signature
7389 that allows block sizes up to UINTMAX_MAX. All callers changed.
7390 * human.h: Add copyright and authorship notice.
7391 Include <limits.h> and <stdbool.h> unconditionally.
7392 (PARAMS): Remove. All uses removed.
7393 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7394 (enum human_inexact_style): Remove tag; now a nameless enum.
7395 (human_floor, human_ceiling, human_round_to_even): Now have
7396 values 2, 0, 1 rather than -1, 1, 0.
7397 (human_group_digits, human_suppress_point_zero, human_autoscale,
7398 human_base_1024, human_SI, human_B): New constants.
7399 (human_readable_inexact, human_block_size): Remove.
7400 (human_readable): Size args are now uintmax_t, not int.
7401 (human_options): New decl.
7403 * exclude.c: (new_exclude, add_exclude): Remove casts that are
7404 unnecessary now that we assume C89 or better. This change
7405 imported from coreutils.
7407 * mktime.c (__mktime_internal): Do not reject negative timestamps
7408 arbitrarily. This is the same patch as 2003-05-28, but it got lost
7409 in the 2003-05-30 sync from glibc.
7411 .h files should stand alone, but we shouldn't include <sys/types.h>
7412 if we can get away with just <stddef.h>.
7414 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7415 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7416 rather than <sys/types.h>, as we merely need size_t.
7417 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7419 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7420 Include <stdio.h>, to get FILE.
7421 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7422 memcasecmp.h has included <stddef.h> and all we need is size_t.
7423 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7424 our interface, instead of including <sys/types.h>
7426 2003-06-02 Paul Eggert <eggert@twinsun.com>
7429 Fix some minor time-related bugs with POSIX time arguments.
7430 Some valid time stamps were being rejected (notably -1, and
7431 time stamps before 1900 on 64-bit hosts). And some invalid
7432 time stamps were being accepted, e.g. September 31.
7434 * posixtm.h (posixtime): Return bool instead of time_t, so
7435 that we can return (time_t) -1 successfully.
7436 * posixtm.c: Likewise.
7437 [HAVE_STDBOOL_H]: Include <stdbool.h>.
7438 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7439 (t): Remove static var.
7440 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7441 of static var. All uses changed.
7442 (year): Do not reject years before 1900; they can occur with
7444 (posix_time_parse): Do not check for out-of-range components;
7445 that is now the caller's responsibility, since our checks were
7446 only approximations.
7447 (posixtime): Use mktime to check for out-of-range components,
7448 since it knows them exactly.
7449 If mktime returns (time_t) -1, check whether an error actually occurred
7450 by invoking localtime on -1.
7451 (main) [TEST_POSIXTIME]: Check for input data errors, and report
7452 posixtime failures better.
7453 Improve the test data (in comments only).
7455 2003-05-30 <karl@gnu.org>
7457 * mktime.c: update from libc.
7459 2003-05-30 Bruno Haible <bruno@clisp.org>
7461 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7462 * localcharset.h: Likewise.
7463 * localcharset.c: Likewise.
7465 2003-05-28 Paul Eggert <eggert@twinsun.com>
7467 Assume the headers required for C89 freestanding compilers.
7468 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7469 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7470 without checking for HAVE_LIMITS_H.
7471 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7472 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7474 * fatal.c: Include <stdarg.h> without checking for __STDC__.
7475 * exclude.c: Include <stdbool.h> unconditionally.
7476 * tempname.c: Include <stddef.h> unconditionally.
7477 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7478 * modechange.c, rpmatch.c (NULL): Don't define, since
7479 <stddef.h> does that.
7480 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7481 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7482 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7483 * xstrtol.c: Likewise.
7484 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7485 * savedir.c: Include <stddef.h> instead of defining NULL.
7487 * addext.c (addext): Use assignment rather than cast, to avoid
7488 warnings on some platforms.
7490 * mktime.c (__mktime_internal): Do not reject negative timestamps
7493 2003-05-10 Bruno Haible <bruno@clisp.org>
7495 * linebreak.c (iconv_string_length): Don't return -1 just because the
7496 string is longer than 4 KB.
7498 2003-05-12 Jim Meyering <jim@meyering.net>
7500 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7501 the space-padded-by-default conversion specifiers, %e, %k, %l.
7503 2003-05-03 Bruno Haible <bruno@clisp.org>
7505 Upgrade to Unicode-4.0.
7506 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7507 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7508 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7509 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7510 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7511 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7512 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7513 Change width of U+E0100..U+E01EF from 1 to 0.
7515 2003-04-25 Bruno Haible <bruno@clisp.org>
7517 * copy-file.c: Include <stddef.h>, for size_t.
7519 2003-04-25 Jim Meyering <jim@meyering.net>
7521 * copy-file.c (copy_file_preserving): Declare buf_size to be
7522 of type size_t, not int.
7524 2003-04-11 Jim Meyering <jim@meyering.net>
7526 Merge changes from Coreutils.
7528 2003-03-22 Jim Meyering <jim@meyering.net>
7530 * strftime.c (widen): Cast alloca return value to proper type.
7532 2003-01-19 Ulrich Drepper <drepper@redhat.com>
7535 * strftime.c (my_strftime): Handle very large width
7536 specifications for numeric values correctly. Improve checks for
7539 2003-01-19 Jim Meyering <jim@meyering.net>
7541 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7542 (nl_get_alt_digit) [! defined my_strftime]: Define.
7543 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7544 _nl_get_alt_digit and _nl_get_walt_digit.
7546 * strftime.c (my_strftime): Merge in locale-related changes from libc.
7547 These changes have no effect outside of _LIBC.
7549 2003-04-10 Bruno Haible <bruno@clisp.org>
7551 * findprog.h: New file, from GNU gettext.
7552 * findprog.c: New file, from GNU gettext.
7554 2003-04-05 Jim Meyering <jim@meyering.net>
7556 Merge changes from Coreutils.
7558 * exclude.h (PARAMS): Remove definition and uses.
7559 * exclude.c: Remove uses of `PARAMS'.
7561 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7562 Add test-cases for DOS filenames. Declare program_name.
7563 (main): Set up program_name. Patch by Rich Dawe.
7565 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7567 Use mntctl's return value to drive the entry-processing loop, since
7568 we can't rely on the value of the vmt_length member in the last
7569 entry. On some systems doing so could result in exhausting
7570 virtual memory. Based in part on a patch from Mike Jetzer.
7572 2003-04-04 Bruno Haible <bruno@clisp.org>
7574 * linebreak.h: New file, from GNU gettext.
7575 * linebreak.c: New file, from GNU gettext with slight modifications.
7576 * lbrkprop.h: New file, from GNU gettext.
7578 2003-04-03 Bruno Haible <bruno@clisp.org>
7580 * utf8-ucs4.h: New file, from GNU gettext.
7581 * utf16-ucs4.h: New file, from GNU gettext.
7582 * ucs4-utf8.h: New file, from GNU gettext.
7583 * ucs4-utf16.h: New file, from GNU gettext.
7585 2003-04-02 Bruno Haible <bruno@clisp.org>
7587 * binary-io.h: New file, from GNU gettext.
7589 2003-04-01 Bruno Haible <bruno@clisp.org>
7591 * pathname.h: New file, from GNU gettext.
7592 * concatpath.c: New file, from GNU gettext.
7594 2003-03-30 Bruno Haible <bruno@clisp.org>
7596 * copy-file.c (copy_file_preserving): Don't set owner if the function
7597 chown() doesn't exist.
7599 2003-03-28 Bruno Haible <bruno@clisp.org>
7601 * copy-file.h: New file, from GNU gettext.
7602 * copy-file.c: New file, from GNU gettext.
7604 2003-03-18 Jim Meyering <jim@meyering.net>
7606 * quote.c (quote_n): Fix typo in comment.
7608 2003-03-14 Jim Meyering <jim@meyering.net>
7610 Merge changes from Coreutils.
7611 * obstack.h (obstack_object_size): Declare temporary, __o,
7612 to be const, in order to avoid warnings.
7613 (obstack_room): Likewise.
7614 (obstack_empty_p): Likewise.
7616 2003-03-13 Paul Eggert <eggert@twinsun.com>
7618 Merge changes from Bison.
7619 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7620 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7621 when compiling Bison 1.875's `bitset bset = obstack_alloc
7622 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7623 * hash.c: Include <stdbool.h> unconditionally.
7625 2003-03-09 Paul Eggert <eggert@twinsun.com>
7627 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7628 Reported by Bruce Becker; see:
7629 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7631 2003-03-03 Paul Eggert <eggert@twinsun.com>
7632 Bruno Haible <bruno@clisp.org>
7634 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7635 Reported by John Hughes, see
7636 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7638 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
7640 * poll_.h: New file.
7643 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
7645 * mathl.h: New file.
7646 * acosl.c: New file.
7647 * asinl.c: New file.
7648 * atanl.c: New file.
7649 * ceill.c: New file.
7652 * floorl.c: New file.
7653 * frexpl.c: New file.
7654 * ldexpl.c: New file.
7656 * sincosl.c: New file.
7658 * sqrtl.c: New file.
7660 * trigl.c: New file.
7661 * trigl.h: New file.
7663 2003-02-17 Bruno Haible <bruno@clisp.org>
7665 * mkdtemp.h: New file, from GNU gettext.
7666 * mkdtemp.c: New file, from GNU gettext.
7668 2003-01-31 Bruno Haible <bruno@clisp.org>
7670 * rename.c: #undef rename before defining rpl_rename.
7671 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7673 2003-01-30 Bruno Haible <bruno@clisp.org>
7675 * printf-args.h: New file, from GNU gettext.
7676 * printf-args.c: New file, from GNU gettext.
7677 * printf-parse.h: New file, from GNU gettext.
7678 * printf-parse.c: New file, from GNU gettext.
7679 * vasnprintf.h: New file, from GNU gettext.
7680 * vasnprintf.c: New file, from GNU gettext.
7681 * asnprintf.c: New file, from GNU gettext.
7682 * vasprintf.h: New file, from GNU gettext with modifications.
7683 * vasprintf.c: New file, from GNU gettext.
7684 * asprintf.c: New file, from GNU gettext.
7686 2003-01-29 Bruno Haible <bruno@clisp.org>
7688 * stpncpy.h: New file, from GNU gettext with modifications.
7689 * stpncpy.c: New file, from GNU gettext with modifications.
7691 2003-01-28 Bruno Haible <bruno@clisp.org>
7693 * c-ctype.h: New file, from GNU gettext, with changes suggested by
7695 * c-ctype.c: New file, from GNU gettext, with changes suggested by
7698 2003-01-27 Bruno Haible <bruno@clisp.org>
7700 * xsetenv.h: New file, from GNU gettext.
7701 * xsetenv.c: New file, from GNU gettext.
7703 2003-01-23 Bruno Haible <bruno@clisp.org>
7705 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7707 2003-01-22 Bruno Haible <bruno@clisp.org>
7709 * exit.h: New file, from GNU gettext.
7711 2003-01-11 Bruno Haible <bruno@clisp.org>
7713 * stpcpy.h (stpcpy): Use ANSI C function declarations.
7714 * strcase.h (strcasecmp, strncasecmp): Likewise.
7716 2003-01-14 Jim Meyering <jim@meyering.net>
7718 * same.c (same_name): Tweak a comment.
7720 2003-01-11 Bruno Haible <bruno@clisp.org>
7722 * same.c (same_name): Reorder tests so as to avoid calling stat()
7723 when a string comparison is sufficient.
7725 2003-01-11 Bruno Haible <bruno@clisp.org>
7727 * readtokens.c (readtoken): Cast character to 'unsigned char', not
7730 2003-01-11 Bruno Haible <bruno@clisp.org>
7732 * hash-pjw.c: Add comment about low quality of this function.
7734 2003-01-12 Paul Eggert <eggert@twinsun.com>
7736 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7737 to avoid collisions with libcurses and libreadline.
7739 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7740 * getstr.h, getstr.c: Remove.
7741 * getline.c: Include "getline.h", to check interface.
7742 Move body of old getstr.c here: this defines MIN_CHUNK and
7743 declares getdelim2, which is renamed from getstr.
7744 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7746 * linebuffer.c (readlinebuffer): Renamed from readline.
7748 * linebuffer.h: Likewise.
7749 (readline): Remove backward-compatibility macro.
7751 2003-01-12 Jim Meyering <jim@meyering.net>
7753 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
7755 2003-01-10 Bruno Haible <bruno@clisp.org>
7757 * alloca_.h: New file.
7758 * getdate.y: Unconditionally include alloca.h.
7759 * makepath.c: Likewise.
7760 * setenv.c: Likewise.
7761 * userspec.c: Likewise.
7763 2003-01-09 Bruno Haible <bruno@clisp.org>
7765 * stdbool.h.in: New file.
7767 2003-01-08 Bruno Haible <bruno@clisp.org>
7769 * safe-read.c: Include specification header first, to ensure its
7771 * full-write.c: Likewise.
7773 2003-01-08 Jim Meyering <jim@meyering.net>
7775 * full-write.c: Undefine and define-away `const' after inclusion
7776 of errno.h, not before. Suggestion from Bruno Haible.
7778 2003-01-07 Jim Meyering <jim@meyering.net>
7780 * full-write.c: Rework so that it may serve to define full_read, too.
7781 * full-read.c: Simply #define FULL_READ and include full-write.c.
7783 2003-01-06 Jim Meyering <jim@meyering.net>
7785 * version-etc.c: Update year in translatable copyright string.
7787 2002-12-25 Bruno Haible <bruno@clisp.org>
7789 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7790 * xstrtol.h: Likewise.
7791 * xstrtoimax.c: Likewise.
7792 * xstrtoumax.c: Likewise.
7793 * human.h: Likewise.
7795 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7796 on systems that have <inttypes.h> but not <stdint.h>.
7798 2002-12-31 Paul Eggert <eggert@twinsun.com>
7800 * memcoll.c (memcoll): Fall back on a simple algorithm using
7801 memcmp if strcoll doesn't work.
7803 2002-12-23 Bruno Haible <bruno@clisp.org>
7805 * localcharset.h: New file.
7806 * localcharset.c: Include it.
7807 * unicodeio.c: Likewise.
7809 2002-12-22 Bruno Haible <bruno@clisp.org>
7811 * utime.c (utime_null): No need to call ftruncate if the file was
7814 2002-12-23 Bruno Haible <bruno@clisp.org>
7816 * memcoll.c (STRCOLL): New macro.
7819 2002-12-22 Bruno Haible <bruno@clisp.org>
7821 * getstr.h (getstr): Define, to avoid clash with libcurses.
7822 * linebuffer.h (readline): Define, to avoid clash with libreadline.
7824 2002-12-22 Bruno Haible <bruno@clisp.org>
7826 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7828 2002-12-23 Bruno Haible <bruno@clisp.org>
7830 * getline.h: Include <stddef.h>, for size_t.
7832 * unicodeio.h: Include <stddef.h>, for size_t.
7833 * unicodeio.c: Don't include <stddef.h>.
7835 2002-12-17 Bruno Haible <bruno@clisp.org>
7837 * canon-host.c (strdup): Remove unused declaration.
7839 * fsusage.c: Include full_read.h.
7840 (get_fs_usage): Use full_read instead of safe_read.
7842 * utime.c (utime_null): Use SAFE_READ_ERROR.
7844 2002-12-11 Bruno Haible <bruno@clisp.org>
7846 * setenv.h: Rewritten to cope with systems that have setenv() but not
7848 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7851 2002-12-11 Bruno Haible <bruno@clisp.org>
7853 * setenv.c (alloca): Fall back to malloc.
7855 (setenv): Use freea() to free memory allocated with alloca().
7857 2002-11-13 Bruno Haible <bruno@clisp.org>
7859 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7860 function declarations.
7861 * unsetenv.c (unsetenv): Likewise.
7863 2002-03-04 Bruno Haible <bruno@clisp.org>
7865 Portability to AIX 4.3.3.
7866 * unsetenv.c: New file, extracted from setenv.c.
7867 * setenv.c: Move the unsetenv() function to unsetenv.c.
7869 2001-12-20 Bruno Haible <bruno@clisp.org>
7871 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7872 use malloc instead. For SunOS 4.
7874 2001-12-11 Bruno Haible <bruno@clisp.org>
7876 * setenv.c: Declare alloca.
7877 (compar_fn_t): New typedef.
7878 (KNOWN_VALUE, STORE_VALUE): Use it.
7880 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7883 2002-12-10 Paul Eggert <eggert@twinsun.com>
7885 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7886 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7887 Choose values that are less likely to collide with system fnmatch
7889 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7890 defined (e.g., a pure POSIX system).
7891 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7892 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7894 2002-12-06 Jim Meyering <jim@meyering.net>
7896 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7898 Merge in changes from libc's misc/error.c, in preparation
7899 for the merge of gnulib's changes back into libc.
7901 * error.c (_): Define only if not already defined.
7902 Move definition to follow all #include directives.
7903 Include unlocked-io.h only if !_LIBC.
7904 [_LIBC]: Include <libio/libioP.h>.
7905 [USE_IN_LIBIO]: Include <libio/iolibio.h>
7906 (fflush): Tweak definition to use INTUSE.
7909 2002-12-05 Paul Eggert <eggert@twinsun.com>
7911 * alloca.c [defined emacs]: Include "lisp.h".
7912 (xalloc_die) [defined emacs]: New macro.
7913 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7914 [! defined emacs]: Include <xalloc.h>.
7915 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7916 (pointer): Typedef to POINTER_TYPE *.
7917 (malloc): Remove decl; we now always use xmalloc.
7918 (alloca): Use old-style definition, since Emacs needs this.
7919 Check for arithmetic overflow when computing combined size.
7921 2002-12-04 Paul Eggert <eggert@twinsun.com>
7923 Do not generate unlocked-io.h automatically, since it's easier to
7924 maintain it by hand.
7926 * unlocked-io.h: New file, from GNU diffutils,
7927 but with proper copyright notice and attribution.
7929 * Makefile.am: Add copyright notice.
7930 (libfetish_a_SOURCES): Add unlocked-io.h.
7931 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7932 (DISTCLEANFILES, io_functions): Remove macros.
7933 (EXTRA_DIST): Remove gen_uio.
7934 (unlocked-io.h): Remove rule.
7936 2002-12-04 Jim Meyering <jim@meyering.net>
7938 Reflect the fact that stat.c and lstat.c are no longer generated.
7939 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7940 (DISTCLEANFILES): Likewise.
7941 (EXTRA_DIST): Likewise.
7942 (all_local): Don't depend on stat.c or lstat.c.
7943 (stat.c, lstat.c): Remove rules.
7944 (EXTRA_DIST): Remove xstat.in.
7946 * xstat.in: Remove file. Contents moved into stat.c.
7947 * stat.c: New file. Contents mostly from xstat.in.
7948 * stat.c: Rework so that it may serve to define rpl_lstat, too.
7949 * lstat.c: New file. Simply #define LSTAT and include stat.c.
7951 * safe-read.c: Rework so that it may serve to define safe_write, too.
7952 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7954 2002-12-03 Jim Meyering <jim@meyering.net>
7956 * safe-read.c, safe-write.c: Change variable names and comments, but
7957 not semantics, to minimize the differences between these two files.
7958 (safe_read): Change comment to mention SAFE_READ_ERROR.
7960 * safe-read.c (IS_EINTR): Define.
7961 (safe_read): Use IS_EINTR in place of in-function cpp directives.
7963 2002-12-02 Bruno Haible <bruno@clisp.org>
7965 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7966 Define, taken from safe-read.c.
7967 (INT_MAX): Provide fallback.
7968 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7969 * safe-write.h (SAFE_WRITE_ERROR): Define.
7971 * safe-read.c (EINTR): Remove definition.
7972 (safe_read): Don't use EINTR if it is absent.
7974 2002-12-02 Jim Meyering <jim@meyering.net>
7976 * safe-read.c (EINTR): Define.
7977 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7978 (INT_MAX): Provide fallback.
7979 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7981 * safe-read.h (SAFE_READ_ERROR): Define.
7983 2002-12-01 Jim Meyering <jim@meyering.net>
7985 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7986 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7988 2002-11-27 Paul Eggert <eggert@twinsun.com>
7990 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7991 hash_rehash): Replace `if (limit <= value) abort ();' with
7992 `if (! (value < limit)) abort ();', for readability.
7994 2002-11-26 <karl@gnu.org>
7996 * strdup.c: copy from libc again, with jim's ok.
7997 * .cppi-disable: re-add strdup.c
7999 2002-11-25 <karl@gnu.org>
8001 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8002 instead of "strtol.c".
8004 2002-11-25 Jim Meyering <jim@meyering.net>
8006 * mktime.c: Sync from libc, now that it has the latest fix.
8008 2002-11-24 <karl@gnu.org>
8010 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8011 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8013 2002-11-24 Jim Meyering <jim@meyering.net>
8015 Update from coreutils:
8017 * mktime.c: Merge in changes from libc.
8019 Avoid a link-time failure on some Linux systems.
8020 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8021 (__mon_yday): Declare with the STATIC attribute.
8022 (__mktime_internal): Likewise.
8023 Based on a report from Greg Schafer.
8025 2002-11-23 Jim Meyering <jim@meyering.net>
8027 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8028 Use `unsigned', not `int', as type of index.
8030 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8032 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8034 2002-11-22 Paul Eggert <eggert@twinsun.com>
8036 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8037 hint that one should use `if (! x) abort ();' rather than `assert
8038 (x);', and anyway it's one less thing to worry about configuring.
8039 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8040 hash_rehash, hash_insert): Use abort rather than assert.
8042 2002-11-22 Paul Eggert <eggert@twinsun.com>
8044 * quotearg.h: Allow multiple inclusion by surrounding with
8045 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8046 so that we can be included first.
8047 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8048 * quotearg.c: Include quotearg.h immediately after config.h.
8049 No need to include stddef.h or sys/types.h any more.
8050 Surround local include files with "", not "<>".
8051 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8052 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8053 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8054 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8055 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8056 (ISPRINT): Remove; no longer needed now that we assume C89.
8058 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8061 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8062 quotearg_char): Use SIZE_MAX rather than
8063 (size_t) -1 when we are talking about "infinity".
8065 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8067 2002-11-22 Bruno Haible <bruno@clisp.org>
8069 * safe-read.h: Assume C89. Add comments.
8070 (safe_read): Change return type to size_t.
8071 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8072 counts > SSIZE_MAX correctly.
8073 * safe-write.h: New file.
8074 * safe-write.c: New file.
8075 * full-read.h: New file.
8076 * full-read.c: New file.
8077 * full-write.h: Assume C89. Add comments.
8078 * full-write.c: Include safe-write.h.
8079 (full_write): Rewritten to use safe_write.
8080 Suggested by Jim Meyering and Paul Eggert.
8082 2002-11-21 Bruno Haible <bruno@clisp.org>
8084 Remove case insensitive option matching.
8085 * argmatch.h (argcasematch): Remove declaration.
8086 (ARGCASEMATCH): Remove macro.
8087 (__xargmatch_internal): Remove case_sensitive argument.
8088 (XARGMATCH): Update.
8089 (XARGCASEMATCH): Remove macro.
8090 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8091 case_sensitive argument.
8092 (argcasematch): Remove function.
8093 (__xargmatch_internal): Remove case_sensitive argument.
8094 (main): Use XARGMATCH instead of XARGCASEMATCH.
8096 * xmalloc.c: Change compile-time error message. Add comment about
8097 required autoconf version.
8099 2002-11-21 Jim Meyering <jim@meyering.net>
8101 * strdup.c (strdup): Tweak comment and initial #if/#include.
8103 Merge in changes from the coreutils.
8105 2002-09-25 Paul Eggert <eggert@twinsun.com>
8106 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8107 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8108 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8109 int. Work more efficiently if X is the same width as uintmax_t.
8110 Do not compare X to -1, to avoid bogus compiler warning.
8111 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8112 Don't assume that f_frsize and f_bsize are the same type.
8114 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8117 * makepath.c (make_path): Restore umask *before* creating the final
8119 (make_path): Minor reformatting.
8121 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8122 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8124 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8125 ones. At least on GNU/Linux systems, `auto' means something else.
8128 2002-11-20 Paul Eggert <eggert@twinsun.com>
8130 Merge argmatch cleanups from Bison. Assume C89.
8132 * argmatch.c: Include config.h here, not in argmatch.h.
8133 Include stdlib.h, for EXIT_FAILURE.
8134 Always include <string.h>, since we assume C89.
8135 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8136 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8137 Include <stddef.h> instead, since it's all we need for size_t.
8138 (PARAMS): Remove. All uses removed.
8139 (ARRAY_CARDINALITY): Do not bother to #undef.
8140 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8141 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8142 Remove unnecessary parentheses.
8143 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8144 Insert necessary parentheses.
8145 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8146 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8148 2002-11-19 Bruno Haible <bruno@clisp.org>
8150 * mbswidth.c: Include mbswidth.h right at the beginning.
8151 * mbswidth.h: Include <stddef.h>, for size_t.
8153 * mbswidth.h (PARAMS): Remove macro.
8154 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8155 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8157 * gcd.h (PARAMS): Remove macro.
8158 (gcd): Use ANSI C function declarations.
8159 * gcd.c (gcd): Likewise.
8161 2002-11-15 Bruno Haible <bruno@clisp.org>
8163 * strcspn.c: Include <stddef.h>.
8164 (strcspn): Use ANSI C function declaration. Change return type to
8166 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8167 (strpbrk): Use NULL.
8168 * strpbrk.h (PARAMS): Remove macro.
8169 (strpbrk): Use ANSI C function declaration.
8170 * strstr.c: Don't include <sys/types.h>.
8171 * strstr.h (PARAMS): Remove macro.
8172 (strstr): Use ANSI C function declarations.
8174 2002-11-06 Bruno Haible <bruno@clisp.org>
8176 * gcd.h (gcd): Change argument type to 'unsigned long'.
8177 * gcd.c (gcd): Likewise.
8179 2002-11-05 Bruno Haible <bruno@clisp.org>
8181 * gcd.h: New file, from gettext-0.11.5.
8182 * gcd.c: New file, from gettext-0.11.5.
8184 2002-11-05 Bruno Haible <bruno@clisp.org>
8186 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8187 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8188 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8189 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8191 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8192 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8194 * closeout.c: Include gettext.h instead of <libintl.h>.
8195 * human.c: Include gettext.h instead of <libintl.h>.
8196 * quotearg.c: Include gettext.h instead of <libintl.h>.
8197 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8198 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8199 * userspec.c: Include gettext.h instead of <libintl.h>.
8200 * version-etc.c: Include gettext.h instead of <libintl.h>.
8201 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8202 (textdomain): Remove definition.
8203 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8205 * long-options.c: Remove include of <libintl.h> and definition of _.
8206 * same.c: Remove include of <libintl.h> and definition of _.
8208 2002-11-04 Bruno Haible <bruno@clisp.org>
8210 * stpcpy.h: New file, from GNU gettext-0.11.5.
8211 * strcase.h: New file, from GNU gettext-0.11.5.
8212 * strpbrk.h: New file, from GNU gettext-0.11.5.
8213 * strstr.h: New file, from GNU gettext-0.11.5.
8214 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8216 2002-05-09 Bruno Haible <bruno@clisp.org>
8218 * config.charset: Update for newest glibc. Add canonical names
8219 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8221 2002-05-09 Bruno Haible <bruno@clisp.org>
8223 * localcharset.c (get_charset_aliases): Add more Windows specific
8226 2002-05-08 Owen Taylor <otaylor@redhat.com>
8228 * config.charset: A few additions for Solaris.
8230 2001-12-05 Bruno Haible <bruno@clisp.org>
8232 * localcharset.c (locale_charset): Don't return an empty string.
8234 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8236 * config.charset: msdos in uk_UA uses CP1125.
8238 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8240 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8241 * localcharset.c (locale_charset): Declare as extern "C".
8243 2002-02-15 Bruno Haible <bruno@clisp.org>
8245 * config.charset [msdosdjgpp]: For Russian, use CP866.
8247 2002-02-11 Bruno Haible <bruno@clisp.org>
8249 * config.charset: Add support for NetBSD.
8251 2002-09-25 <karl@gnu.org>
8253 * strdup.c: copy from libc/string (via ../config/srclist*).
8254 * getopt*: copy from libc/posix.
8255 * gettext.h: copy from gettext.
8256 * .cppi-disable: add strdup.c, gettext.h.
8258 2002-07-01 Jim Meyering <meyering@lucent.com>
8260 * c-stack.c: Include sys/time.h.
8261 From Volker Borchert.
8263 2002-06-11 Paul Eggert <eggert@twinsun.com>
8265 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8266 New macro. Use it uniformly instead of
8267 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8268 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8269 reported by Vin Shelton.
8271 2002-06-22 Jim Meyering <meyering@lucent.com>
8273 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8274 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8276 2002-06-22 Paul Eggert <eggert@twinsun.com>
8278 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8279 Do not assume SA_SIGINFO behavior.
8280 Bug reported by Jim Meyering on NetBSD 1.5.2.
8282 2002-06-22 Jim Meyering <meyering@lucent.com>
8284 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8286 * exitfail.c, exitfail.h: Likewise.
8287 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8289 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8291 (EXTRA_DIST): Add fnmatch_loop.c.
8292 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8294 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8295 * fnmatch.c: Update from diffutils-2.8.2.
8296 * fnmatch_.h: New file. From diffutils-2.8.2.
8297 * fnmatch.h: Remove file.
8299 2002-06-18 Paul Eggert <eggert@twinsun.com>
8301 * file-type.h: Report an error if neither S_ISREG nor
8302 S_IFREG is defined, instead of using a test specific to glibc
8303 2.2. This should be safe, since POSIX requires S_ISREG and
8304 Unix Version 7 had S_IFREG. We don't need to check for
8305 <sys/types.h> since we don't use any symbols that it defines.
8307 2002-06-15 Jim Meyering <meyering@lucent.com>
8309 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8310 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8311 have been included before this file.
8313 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8315 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8316 so that each temporary file name is unique and valid in the first
8317 8 characters, for operation under DOS.
8319 2002-06-15 Jim Meyering <meyering@lucent.com>
8321 Work even with DJGPP 2.03, which lacks support for symlinks.
8323 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8325 * lchown.c (S_ISLNK): Likewise.
8327 2002-06-14 Jim Meyering <meyering@lucent.com>
8329 * file-type.h: Use the version from diffutils-2.8.2.
8330 * file-type.c: Likewise.
8332 2002-05-27 Jim Meyering <meyering@lucent.com>
8334 Fix a problem seen only on nonconforming systems whereby ls.c's
8335 use of localtime, and then of gettimeofday would cause trouble:
8336 the localtime call used to initialize rpl_gettimeofday's save
8337 mechanism would clobber ls's current local time information so
8338 that in any long listing the first file would always be listed
8339 with date 1970-01-01. Analysis by Volker Borchert.
8341 * gettimeofday.c (localtime): Undefine.
8342 (rpl_localtime): New function.
8344 2002-05-22 Jim Meyering <meyering@lucent.com>
8346 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8347 * file-type.h: New file.
8348 * file-type.c (file_type): New file/function. Extracted from diffutils.
8350 2002-04-29 Paul Eggert <eggert@twinsun.com>
8352 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8354 2002-04-28 Paul Eggert <eggert@twinsun.com>
8356 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8357 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8358 of 127, since 64 is the largest conceivable number for ancient
8360 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8362 2002-04-28 Jim Meyering <meyering@lucent.com>
8364 * sig2str.c (WTERMSIG): Remove definition (unused).
8366 2002-04-28 Paul Eggert <eggert@twinsun.com>
8368 * sig2str.h, sig2str.c: New files.
8369 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8371 2002-04-24 Jim Meyering <meyering@lucent.com>
8373 * gettext.h: New file, from Gettext.
8374 * Makefile.am (INCLUDES): Remove -I../intl.
8375 (libfetish_a_SOURCES): Add gettext.h.
8377 2002-04-16 Jim Meyering <meyering@lucent.com>
8379 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8380 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8381 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8383 2002-04-12 Jim Meyering <meyering@lucent.com>
8385 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8387 2002-03-10 Jim Meyering <meyering@lucent.com>
8389 * makepath.c (make_path): Remove a comma from a diagnostic.
8390 Suggestion from Santiago Vila.
8392 2002-03-08 Jim Meyering <meyering@lucent.com>
8394 * rename.c: Mention that this wrapper is needed also on
8395 mips-dec-ultrix4.4 systems.
8397 2002-03-02 Jim Meyering <meyering@lucent.com>
8399 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8400 not HAVE_CLOCK_SETTIME.
8402 2002-02-27 Paul Eggert <eggert@twinsun.com>
8404 * nanosleep.h: Rename to....
8405 * timespec.h: New name for nanosleep.h. All uses changed.
8407 * gettime.c: New file.
8408 * settime.c: New file.
8411 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8412 timespec.h. Remove nanosleep.h.
8414 2002-02-25 Paul Eggert <eggert@twinsun.com>
8416 * acl.c, acl.h: New files.
8417 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8419 2002-02-24 Jim Meyering <meyering@lucent.com>
8421 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8422 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8423 cause trouble. Reported by Nelson Beebe.
8425 2002-02-23 Paul Eggert <eggert@twinsun.com>
8427 * path-concat.c (xpath_concat): Reorder code to pacify
8428 compilers that don't know that xalloc_die never returns.
8430 2002-02-20 Jim Meyering <meyering@lucent.com>
8432 * getdate.c: Regenerate using bison-1.33.
8434 2002-02-15 Paul Eggert <eggert@twinsun.com>
8436 * posixver.c, posixver.h: New files.
8437 * Makefile.am (libfetish_a_SOURCES): Add them.
8439 2002-02-02 Paul Eggert <eggert@twinsun.com>
8440 Bruno Haible <bruno@clisp.org>
8442 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8443 (fwrite_success_callback): New declaration.
8444 * unicodeio.c (unicode_to_mb): New function, extracted from
8445 print_unicode_char. Call failure callback instead of error.
8446 (fwrite_success_callback): New function.
8447 (exit_failure_callback): New function.
8448 (fallback_failure_callback): New function.
8449 (print_unicode_char): Call unicode_to_mb.
8451 2002-01-26 Jim Meyering <meyering@lucent.com>
8453 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8455 2002-01-22 Jim Meyering <meyering@lucent.com>
8457 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8458 Otherwise, some versions of automake would omit the rule that makes
8459 Makefile from Makefile.in.
8461 2001-01-21 Paul Eggert <eggert@twinsun.com>
8463 * xmemcoll.h, xmemcoll.c: New files.
8464 * Makefile.am (libfetish_a_SOURCES): Add them.
8465 * memcoll.c: Include errno.h, and declare errno if not defined.
8466 (memcoll): Set errno to zero if there is no error.
8468 * quotearg.c (quotearg_buffer_restyled):
8469 Fix bug with quoting buffers containing NUL when backslashing escapes.
8470 This bug was exposed by the other changes in this patch.
8471 (quotearg_n_options): New arg ARGSIZE.
8472 All callers changed.
8473 (quoting_options_from_style): New function.
8474 (quotearg_n_style): Use it.
8475 (quotearg_n_style_mem): New function.
8477 * quotearg.h (quotearg_n_style_mem): New function.
8479 2002-01-16 Jim Meyering <meyering@lucent.com>
8481 * getdate.y: Add three semicolons, each just before a closing brace.
8482 Bison (as of version 1.31) no longer papers over that mistake.
8484 2002-02-14 Paul Eggert <eggert@twinsun.com>
8486 * backupfile.c (ISDIGIT): Comment fix.
8487 * getdate.y (ISDIGIT): Likewise.
8488 * posixtm.c (ISDIGIT, year): Likewise.
8489 * strverscmp.c (ISDIGIT): Likewise.
8490 * userspec.c (ISDIGIT): Likewise.
8492 2002-01-05 Jim Meyering <meyering@lucent.com>
8494 * version-etc.c (version_etc_copyright): Update copyright year.
8496 2001-01-19 Paul Eggert <eggert@twinsun.com>
8498 * closeout.c (close_stdout_status): If ferror (stdout), do
8499 not silently exit merely because the output buffer happens to
8500 have nothing pending.
8502 2001-12-18 Paul Eggert <eggert@twinsun.com>
8504 See the big note in ../ChangeLog.
8505 * human.c (suffixes): Prefer K to k for 1024.
8506 (generate_suffix_backwards): New function.
8507 (human_readable_inexact): Use it.
8508 * xstrtol.c (__xstrtol): If there is no number but there
8509 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
8510 Accept 'K' as well as 'k'.
8512 2001-12-15 Jim Meyering <meyering@lucent.com>
8514 * regex.h (__restrict_arr): Update from libc.
8516 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8517 as `remote' if the name starts with `//'. Suggested by Michael Stone.
8520 2001-12-10 Jim Meyering <meyering@lucent.com>
8522 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8523 Instead, include "xalloc.h".
8524 (initbuffer): Don't cast xmalloc return value to char*.
8525 (readline): Reword comment.
8526 Don't cast xrealloc return value to char*
8529 2001-12-09 Jim Meyering <meyering@lucent.com>
8531 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8532 `signed and unsigned type in conditional expression'.
8533 * posixtm.c (posix_time_parse): Likewise.
8535 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8537 * readtokens.c (readtoken): Declare an index to be of type unsigned
8538 to avoid a pedantic warning.
8540 * getstr.c: Don't include assert.h.
8541 (getstr): Remove warning-evoking assertions.
8542 Return -1 if offset parameter is out of bounds.
8543 Change the type of a local from int to size_t.
8545 * strftime.c (my_strftime_localtime_r): Include this function
8546 definition in the `#if ! HAVE_TM_GMTOFF' block.
8548 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8549 Include xalloc.h instead.
8551 2001-12-02 Jim Meyering <meyering@lucent.com>
8553 * tempname.c: Don't declare getenv, thus reverting the change of
8554 2001-11-18. It's no longer necessary, now that stdlib.h is always
8557 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8558 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
8560 2001-11-30 Akim Demaille <akim@epita.fr>
8562 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8563 before being defined.
8565 2001-11-27 Paul Eggert <eggert@twinsun.com>
8567 * quotearg.h (quotearg_n, quotearg_n_style):
8568 First arg is int, not unsigned.
8569 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8570 (SIZE_MAX, UINT_MAX): New macros.
8571 (quotearg_n_options): Abort if N is negative.
8572 Avoid overflow check on hosts where size_t is 64 bits and int
8573 is 32 bits, as overflow is impossible there.
8574 Fix off-by-one typo that caused unnecessary reallocation.
8576 2001-11-27 Jim Meyering <meyering@lucent.com>
8578 * tempname.c: Merge with version from libc.
8579 * regex.c: Likewise.
8581 * tempname.c: Include stdlib.h unconditionally. On some old systems
8582 for which STDC_HEADERS is 0, it was not included, resulting in a
8583 warning about an integer-to-pointer conversion problem with getenv.
8584 Reported by Volker Borchert.
8586 2001-11-26 Jim Meyering <meyering@lucent.com>
8588 * gtod.h: Remove file.
8589 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8590 * gettimeofday.c: Don't include gtod.h.
8591 (GTOD_init): Remove function.
8592 (rpl_gettimeofday): Do its job here instead, rather than aborting.
8593 Suggestion from Volker Borchert.
8595 2001-11-23 Jim Meyering <meyering@lucent.com>
8597 * hash.h (struct hash_table): Don't define here. Merely declare it.
8598 * hash.c (struct hash_table): Define it here instead.
8600 2001-11-22 Jim Meyering <meyering@lucent.com>
8602 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8604 2001-11-18 Paul Eggert <eggert@twinsun.com>
8606 * tempname.c (TMP_MAX): Remove; no longer needed.
8607 (TEMPORARIES): New macro.
8608 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
8609 removes an artificial limitation (e.g. HP-UX 10.20, where
8612 2001-11-18 Jim Meyering <meyering@lucent.com>
8614 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8617 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8618 files will be created before anything else.
8620 2001-11-17 Jim Meyering <meyering@lucent.com>
8622 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8623 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8624 rather than group writable. Patch by Juan F. Codagnone.
8626 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8627 Instead, include "xalloc.h".
8629 * mountlist.c: Include unlocked-io.h after all system headers.
8630 Remove explicit declarations of xmalloc, xrealloc,
8631 and xstrdup. Instead, include "xalloc.h".
8633 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8634 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8635 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8637 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8638 Reported by Padraig Brady.
8640 * mkstemp.c: #undef mkstemp.
8642 (rpl_mkstemp): Rename from mkstemp.
8645 2001-11-16 Jim Meyering <meyering@lucent.com>
8647 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8648 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8649 determine the amount of total physical memory, use pstat_getstatic.
8650 HPUX-11 doesn't define _SC_PHYS_PAGES.
8651 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8652 If sysconf couldn't be used to determine the amount of available
8653 physical memory, use both pstat_getstatic and pstat_getdynamic.
8654 Based on a patch from Bob Proulx.
8656 2001-11-05 Jim Meyering <meyering@lucent.com>
8658 * xstat.in (slash_aware_lstat): Correct a misleading comment.
8660 2001-11-03 Jim Meyering <meyering@lucent.com>
8662 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8663 in argmatch_to_argument call.
8665 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8668 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8669 e.g., a fault due to an attempt to free a NULL pointer.
8671 2001-11-01 Jim Meyering <meyering@lucent.com>
8673 * dirfd.c, dirfd.h: New files.
8674 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8676 * hash.c (hash_print) [TESTING]: Clean up.
8678 2001-10-22 Paul Eggert <eggert@twinsun.com>
8680 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8681 to avoid a warning if -Wall.
8683 2001-10-21 Paul Eggert <eggert@twinsun.com>
8685 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8687 2001-10-21 Jim Meyering <meyering@lucent.com>
8689 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
8690 this code would end up calling gettext even in packages built
8692 * getopt.c (_): Likewise.
8693 * regex.c (_): Likewise.
8695 2001-10-20 Paul Eggert <eggert@twinsun.com>
8697 * error.c (strerror_r): Do not declare unless !_LIBC.
8698 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8699 Use strerror_r that is only a macro, even if it is not a function.
8700 (strerror): Check for HAVE_DECL_STRERROR before declaring.
8701 (private_strerror): Use prototypes, not old-style function definition.
8702 (print_errno_message): New function.
8703 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8705 (error_tail, error, error_at_line): Use it.
8707 2001-10-11 Jim Meyering <meyering@lucent.com>
8709 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8710 and quote_n (1, ... to avoid clobbering a buffer.
8712 2001-10-05 Jim Meyering <meyering@lucent.com>
8714 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8715 * hash-pjw.c: New file (factored out of fileutils' remove.c).
8716 * hash-pjw.h: New file.
8718 2001-09-30 Jim Meyering <meyering@lucent.com>
8720 * mountlist.c [MOUNTED_GETFSSTAT]:
8721 Include <sys/ucred.h>, for Apple Darwin.
8722 Include sys/mount.h and sys/fs_types.h only if available.
8724 (read_filesystem_list): Use FS_TYPE.
8726 2001-09-29 Paul Eggert <eggert@twinsun.com>
8728 * exclude.c (excluded_filename): 0 -> false, since it's
8731 2001-09-28 Paul Eggert <eggert@twinsun.com>
8733 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8734 #defines strtoimax. Also treat the other strto* functions
8737 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8738 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8739 (strtoimax, strtoumax): Do not declare if already defined as a macro.
8741 2001-09-26 Jim Meyering <meyering@lucent.com>
8743 Most macros in unlocked-io.h had the wrong number of arguments.
8744 * gen-uio: New script.
8745 (USE_UNLOCKED_IO): Define to 1 if not already defined.
8746 * unlocked-io.hin: Remove file.
8747 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8748 rather than trying to embed it here.
8749 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
8750 Reported by Padraig Brady.
8752 2001-09-25 Volker Borchert <bt@teknon.de>
8754 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8756 2001-09-23 Jim Meyering <meyering@lucent.com>
8758 * mountlist.c: Remove useless parentheses in #if directives.
8759 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8760 the deprecated MOUNTED symbol is no longer defined in mntent.h.
8762 2001-09-22 Jim Meyering <meyering@lucent.com>
8764 * localcharset.c: Update from latest gettext.
8765 * config.charset: Likewise.
8767 2001-09-20 Jim Meyering <meyering@lucent.com>
8769 * xstrtol.c (strtoimax): Guard declaration with
8770 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8771 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8772 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8773 (strtoumax): Likewise, for completeness (it wasn't necessary).
8775 2001-09-06 Paul Eggert <eggert@twinsun.com>
8777 * strtoimax.c (HAVE_LONG_LONG):
8778 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8779 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8780 to work around bug in IBM C compiler.
8782 2001-09-16 Jim Meyering <meyering@lucent.com>
8784 * mkdir.c: New file.
8786 2001-09-04 Paul Eggert <eggert@twinsun.com>
8788 * xgetcwd.c: Revert some of the previous change; intead,
8789 fix the HAVE_GETCWD_NULL code to behave more like the
8790 !HAVE_GETCWD_NULL code used to.
8793 (xgetcwd): Do not return NULL when memory is exhausted; instead,
8796 2001-09-04 Paul Eggert <eggert@twinsun.com>
8798 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
8799 Use ssize_t, not int, to store result of readlink.
8800 Check for ssize_t overflow as well as size_t overflow,
8801 as POSIX says the result of readlink is implementation-defined
8802 when ssize_t overflows.
8803 Remove unnecessary cast to char*.
8804 Use free+malloc instead of realloc, as the storage doesn't need
8805 to be preserved and it's clearer and can be more efficient that way.
8806 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8807 * xreadlink.h (xreadlink): Update prototype.
8809 2001-09-03 Paul Eggert <eggert@twinsun.com>
8811 * exclude.c (fnmatch_no_wildcards): Fix confusion between
8812 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
8813 spotted by Jim Meyering.
8815 2001-09-03 Jim Meyering <meyering@lucent.com>
8817 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8819 2001-09-03 Paul Eggert <eggert@twinsun.com>
8821 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8822 like the HAVE_GETCWD_NULL code.
8823 Include pathmax.h if not HAVE_GETCWD.
8824 Do not include xalloc.h.
8825 (INITIAL_BUFFER_SIZE): New symbol.
8826 Do not use xmalloc / xrealloc, since the caller is responsible for
8827 handling errors. Preserve errno around `free' during failure.
8828 Do not overrun buffer when using getwd.
8830 2001-09-03 Paul Eggert <eggert@twinsun.com>
8832 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8833 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8835 2001-09-02 Jim Meyering <meyering@lucent.com>
8837 * error.c: Update from GNU libc.
8839 2001-09-01 Jim Meyering <meyering@lucent.com>
8841 * xreadlink.c: New file.
8842 * xreadlink.h: New file.
8843 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8845 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8846 doesn't conflict with sparc Solaris 7's definition in
8847 /usr/include/sys/int_types.h.
8849 * exclude.c: Use `""', not `<>' to #include non-system header files.
8850 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8851 and strncasecmp as r-values. Unixware didn't have declarations.
8853 2001-08-31 Jim Meyering <meyering@lucent.com>
8855 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8856 Use an initial, malloc'd, buffer of length 128 rather than
8857 a statically allocated one of length 1024.
8859 2001-08-30 Paul Eggert <eggert@twinsun.com>
8861 * xgetcwd.c: Don't include pathmax.h.
8862 Include stdlib.h and unistd.h if available.
8864 (xmalloc, xstrdup, free): Remove decls.
8865 (xgetcwd): Don't assume sizes fit in unsigned.
8866 Check for overflow when computing sizes.
8867 Simplify reallocation code.
8869 2001-08-28 Paul Eggert <eggert@twinsun.com>
8871 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8873 * strtoimax.c: Renamed from strtoxmax.c, removing the
8876 Also, make the following further changes to make this file's
8877 configuration more similar to that of strtol.c:
8878 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
8879 (strtoumax, uintmax_t, strtoull, strtol): Remove.
8880 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8881 (strtoimax): Renamed from strtoumax. All uses of unsigned values
8882 changed to signed values.
8884 And make the following changes as well:
8885 Fix copyright notice, as 1999 was missing.
8886 (verify): New macro.
8887 (strtoimax): Check sizes at compile-time, not run-time.
8888 Prefer strtol to strtoll if both work.
8889 (main): Remove; it was not that useful and was a pain to maintain.
8891 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8893 2001-08-30 Paul Eggert <eggert@twinsun.com>
8895 * savedir.c (savedir): Remove size parameter, as POSIX says that
8896 a directory's st_size can have an arbitrary value, so the old
8897 usage could waste an arbitrary amount of memory. All uses
8899 * savedir.h: Update prototype.
8901 2001-08-30 Paul Eggert <eggert@twinsun.com>
8903 * xstrtol.c (strtoimax): New decl.
8905 2001-08-28 Paul Eggert <eggert@twinsun.com>
8907 * xstrtol.h: Add copyright notice.
8908 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8909 LONGINT_INVALID_SUFFIX_CHAR.
8911 2001-08-30 Paul Eggert <eggert@twinsun.com>
8913 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8916 2001-08-30 Paul Eggert <eggert@twinsun.com>
8918 * hash.c: Remove '2001' from copyright notice.
8920 2001-08-30 Paul Eggert <eggert@twinsun.com>
8922 * full-write.h: New file.
8923 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8924 * full-write.c: Correct credits, as cccp.c no longer
8925 exists and anyway it was so heavily changed from the old cccp
8926 code as to be unrecognizable. Include full-write.h.
8927 (full_write) Return size_t, with short writes meaning failure.
8928 All callers changed. This fixes a bug with large buffers
8930 * utime.c: Include full-write.h.
8932 2001-08-30 Paul Eggert <eggert@twinsun.com>
8934 Merge 'exclude' changes from tar 1.13.22.
8935 This fixes one or two unlikely storage allocation overflow bugs,
8936 but doesn't change user-visible behavior otherwise.
8938 2001-08-30 Paul Eggert <eggert@twinsun.com>
8940 * exclude.c (bool): Declare, perhaps by including stdbool.h.
8941 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8942 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8943 Include if available.
8944 (<xalloc.h>): Include
8945 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8946 (verify): New macro. Use it to verify that EXCLUDE macros do not
8947 collide with FNM macros.
8948 (struct patopts): New struct.
8949 (struct exclude): Use it, as exclude patterns now come with options.
8950 (new_exclude): Support above changes.
8951 (new_exclude, add_exclude_file):
8952 Initial size must now be a power of two to simplify overflow checking.
8953 (free_exclude, fnmatch_no_wildcards): New function.
8954 (excluded_filename): No longer requires options arg, as the options
8955 are determined by add_exclude. Now returns bool, not int.
8956 (excluded_filename, add_exclude):
8957 Add support for the fancy new exclusion options.
8958 (add_exclude, add_exclude_file): Now takes int options arg.
8959 Check for arithmetic overflow when computing sizes.
8960 (add_exclude_file): xrealloc might modify errno, so don't
8961 realloc until after errno might be used.
8963 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8965 (free_exclude): New decl.
8966 (add_exclude, add_exclude_file): Now takes int options arg.
8967 (excluded_filename): No longer requires options arg, as the options
8968 are determined by add_exclude. Now returns bool, not int.
8970 2001-08-30 Paul Eggert <eggert@twinsun.com>
8972 * alloca.c (alloca): Arg is of type size_t, not unsigned.
8974 2001-08-27 Jim Meyering <meyering@lucent.com>
8976 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8978 * version-etc.c (N_): Remove definition.
8979 Revert most of last change.
8980 Instead, simply don't mark the `Copyright...' string for translation.
8981 Based on advice from Paul Eggert.
8983 * strtoxmax.c: Tweak comment.
8985 2001-08-26 Jim Meyering <meyering@lucent.com>
8987 * version-etc.c (version_etc_copyright_fmt): Replace literal year
8988 of copyright with `%s' so translators don't get an untranslated
8990 (COPYRIGHT_YEAR): Define.
8991 (version_etc): Use fprintf rather than fputs.
8992 Suggestion from Ulrich Drepper.
8994 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8996 * strtoll.c: New file, from GNU libc.
8997 * xstrtoimax.c: New file.
8999 * xstrtol.h: Add xstrtoimax.
9000 * strtoumax.c: New file. Simply include "strtoumax.c".
9001 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9003 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9004 * strtoxmax.c: ... then renamed to this.
9006 2001-08-13 Paul Eggert <eggert@twinsun.com>
9008 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9009 Port to Solaris 8, where 'sed' requires a space after the 'r'
9010 command, and where sh dislikes "$/". Clean up the spacing a bit.
9011 Redirect output to $tmp just once.
9013 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9015 * addext.c (<errno.h>): Include.
9016 (errno): Declare if not defined.
9017 (addext): Work correctly when pathconf returns -1 and leaves
9018 errno alone because there is no limit. Also, work even if
9019 pathconf returns a value greater than SIZE_MAX.
9021 2001-08-12 Jim Meyering <meyering@lucent.com>
9023 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9024 Simply `return getcwd (NULL, 0);'.
9025 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9026 Use 1300 as initial value for length, not PATH_MAX.
9028 * pathmax.h: Clean up cpp syntax.
9030 2001-08-12 Jim Meyering <meyering@lucent.com>
9032 * gettimeofday.c: New file.
9034 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9036 2001-08-04 Jim Meyering <meyering@lucent.com>
9038 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9039 to get in sync with glibc.
9041 2001-08-03 Paul Eggert <eggert@twinsun.com>
9043 The following changes are from gettext 0.10.39 as maintained by
9046 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9047 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9048 with inverted sense. All uses changed.
9050 * mbswidth.c: Don't include <limits.h>.
9051 Include <stdlib.h> and <string.h> unconditionally.
9052 (iswcntrl, mbsinit, ISCNTRL): New macros.
9053 (mbsnwidth): Use K&R style function declarations.
9054 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9055 can optimize it when MB_CUR_MAX == 1.
9056 The width of control characters is zero, not 1.
9058 2001-07-15 Jim Meyering <meyering@lucent.com>
9060 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9061 (BUILT_SOURCES): Add unlocked-io.h.
9062 (io_functions): Define.
9063 (unlocked-io.h): New rule.
9064 (DISTCLEANFILES): Add unlocked-io.h.
9065 (all-local): Depend on unlocked-io.h, to ensure it is created.
9067 * unlocked-io.hin: New file
9069 * regex.c: Update from glibc.
9071 2001-07-05 Jim Meyering <meyering@lucent.com>
9073 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9075 (libfetish_a_SOURCES): Put all .h files here instead.
9076 Remove a thus-exposed (better checks in automake) duplicate and
9077 two unnecessary .h files.
9079 2001-06-11 Jim Meyering <meyering@lucent.com>
9081 * regex.c: Update from GNU libc.
9083 2001-05-27 Jim Meyering <meyering@lucent.com>
9085 * readutmp.h (UT_TYPE): Define.
9087 2001-05-24 Jim Meyering <meyering@lucent.com>
9089 * argmatch.c: Include "quote.h".
9090 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9091 quote function. Reported by Göran Uddeborg.
9093 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9095 * dirname.c (dir_name): Compute append_dot using path, not newpath
9096 which is not yet declared.
9098 2001-05-11 Paul Eggert <eggert@twinsun.com>
9100 * Makefile.am (libfetish_a_SOURCES):
9101 Add strftime.c, since we now compile it on all hosts.
9103 * strftime.c (my_strftime):
9104 Define to nstrftime if emacs, but only if my_strftime is not defined.
9105 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9106 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9107 Add one more extra argument: a nanoseconds value.
9110 (my_strftime function): Add %N format.
9111 (emacs_strftimeu): Renamed from emacs_strftime,
9112 with extra ut argument.
9114 2001-05-11 Paul Eggert <eggert@twinsun.com>
9116 dirname code cleanup. base_name now behaves more compatibly
9117 with POSIX basename when given file names that have trailing
9118 slashes, and similarly for dir_name. Add new primitives
9119 base_len and dir_len. Put the directory-name-related decls
9122 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9123 * backupfile.c (base_name): Likewise.
9124 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9125 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9126 * makepath.c (strip_trailing_slashes): Likewise.
9127 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9129 * rename.c (strip_trailing_slashes): Likewise.
9130 * same.c (base_name): Likewise.
9131 * stripslash.c (ISSLASH): Likewise.
9133 * addext.c: Include <dirname.h> after size_t is defined.
9134 * backupfile.c: Likewise.
9136 * addext.c (addext): Use base_len to trim redundant
9137 trailing slashes instead of doing it ourselves.
9138 But do not trim the last slash if it is not redundant.
9140 * backupfile.c (find_backup_file_name,
9141 max_backup_version): Use base_len instead of rolling it ourselves.
9142 Handle the case of "" and (on DOS) "C:" correctly.
9144 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9145 Include <string.h>, <dirname.h>.
9146 (base_name): Allow file names ending in slashes, other than names
9147 that are all slashes. In this case, return the basename followed
9148 by the slashes. This is more general, and can be used in places
9149 where the original base_name purposely had an assertion failure.
9150 (base_len): New function.
9152 * dirname.c: Include <string.h> instead of <stdlib.h>.
9153 Do not include <assert.h>; no longer needed.
9155 (memrchr): Remove decl.
9156 (dir_name_r): Remove.
9157 (dir_len): Renamed from dirlen. All callers changed.
9158 Rewrite in terms of base_name, for simplicity and consistency.
9159 (dir_name): Never return NULL. All callers changed.
9160 Do not include <stdlib.h> in test program; no longer needed.
9161 return 0; is fine for test program.
9163 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9165 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9167 * path-concat.c (path_concat): Use base_len to compute
9168 base length, not strlen; this means we cannot rely on memcpy
9171 * same.c (STREQ): Remove.
9172 (same_name): Handle the case where the basename ends in trailing '/'.
9174 * stripslash.c (strip_trailing_slashes): Return nonzero if
9175 a slash was stripped. Do not strip the last slash after a
9178 2001-04-08 Jim Meyering <meyering@lucent.com>
9180 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9181 recomputed; that's necessary when the offset spans a DST transition.
9182 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9184 2001-04-02 Jim Meyering <meyering@lucent.com>
9186 * regex.h, regex.c: Update from GNU libc.
9188 2001-03-19 Paul Eggert <eggert@twinsun.com>
9190 * version-etc.c (version_etc_copyright): Update to 2001.
9192 2001-03-16 Paul Eggert <eggert@twinsun.com>
9194 * tempname.c (uint64_t): Define to uintmax_t if
9195 not defined, and if UINT64_MAX is not defined.
9196 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9197 Reported by John David Anglin.
9199 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9201 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9202 alias if codeset is empty.
9203 * config.charset (BeOS): Use wildcard syntax.
9205 2001-03-13 Jim Meyering <meyering@lucent.com>
9207 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9208 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9211 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9213 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9215 * unicodeio.c (print_unicode_char): Simplify accordingly.
9217 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9219 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9220 support for DOS/DJGPP.
9222 2001-02-28 Paul Eggert <eggert@twinsun.com>
9224 * Makefile.am (libfetish_a_SOURCES):
9225 Add dup-safer.c, fopen-safer.c.
9226 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9228 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9230 2001-02-25 Paul Eggert <eggert@twinsun.com>
9232 The mkstemp replacement is taken from glibc 2.2.2, with some
9233 portability fixes for use outside glibc, as follows:
9235 * tempname.c (struct_stat64): New macro.
9236 (direxists, __gen_tempname): Use it.
9237 This avoids a portability problem with Solaris 8.
9239 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9240 (<stddef.h>, <stdint.h>, <string.h>):
9241 Include only if STDC_HEADERS || _LIBC.
9242 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9243 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9244 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9245 (__set_errno): Define this macro if <errno.h> doesn't.
9246 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9247 Define these macros if <stdio.h> doesn't.
9248 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9249 Define these macros if <sys/stat.h>
9250 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9251 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9252 __xstat64): Define if not _LIBC.
9253 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9254 (__gen_tempname): Invoke gettimeofday only if
9255 HAVE_GETTIMEOFDAY || _LIBC;
9256 otherwise, fall back on plain "time".
9257 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9259 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9261 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9263 2001-02-17 Jim Meyering <meyering@lucent.com>
9265 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9266 around included file name.
9268 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9270 * strftime.c: Update from GNU libc (the only changes were to comments).
9272 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9274 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9276 2001-02-17 Paul Eggert <eggert@twinsun.com>
9278 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9279 Remove workaround macros for hosts that have mbrtowc but not
9280 mbstate_t, as we now insist on proper declarations for both
9281 before using mbrtowc.
9283 2001-02-17 Jim Meyering <meyering@lucent.com>
9285 * regex.c: Update from libc.
9287 2001-02-16 Paul Eggert <eggert@twinsun.com>
9289 * alloca.c (malloc): Undef before defining, since stdlib.h
9290 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9291 Reported by Mark Hounschell via Paul Eggert.
9293 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9295 * config.charset: Update for FreeBSD 4.2.
9297 2001-01-26 Jim Meyering <meyering@lucent.com>
9299 * quotearg.c: Include stddef.h.
9300 * quote.c: Include stddef.h.
9301 Reported by Axel Kittenberger.
9303 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9304 line in double quotes so that it evokes a better diagnostic.
9305 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9306 Reported by Axel Kittenberger.
9308 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9310 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9311 to avoid a warning. Add back 'const' to inptr.
9313 2001-01-16 Jim Meyering <meyering@lucent.com>
9315 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9318 2001-01-14 Jim Meyering <meyering@lucent.com>
9320 * rename.c: New file. From Volker Borchert.
9321 Include stdlib.h, string.h or strings.h, and xalloc.h.
9322 Use strip_trailing_slashes rather than open-coding it.
9324 2001-01-03 Paul Eggert <eggert@twinsun.com>
9326 * strftime.c: Sync with glibc time/strftime.c 1.81.
9328 2001-01-03 Jim Meyering <meyering@lucent.com>
9330 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9331 local `inptr' to avoid warning with some system declarations of iconv.
9333 2000-12-29 Paul Eggert <eggert@twinsun.com>
9335 * modechange.c: Do not assume that mode_t uses the
9336 traditional octal encoding. E.g. "chmod 1 FOO" should set
9337 the other-execute bit of FOO even if S_IXOTH != 1.
9339 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9340 WOTH, XOTH, ALLM): New macros.
9341 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9342 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9344 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9345 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9347 No need to use uintmax_t; unsigned long is long enough.
9348 Don't bother to get suffix since we don't use it.
9350 2000-12-24 Jim Meyering <meyering@lucent.com>
9352 * hash.c (is_prime): Return explicit boolean values.
9353 (hash_get_first): Return NULL to appease Irix5.6's 89.
9354 Reported by Nelson Beebe.
9356 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9358 * localcharset.c (locale_charset): Add support for Win32.
9360 2000-12-18 Paul Eggert <eggert@twinsun.com>
9362 * physmem.h, physmem.c: New files.
9364 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9365 (noinst_HEADERS): Add physmem.h.
9367 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9368 't' for compatibility with Solaris 8 sort.
9370 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9372 * config.charset: Add support for BeOS.
9374 2000-12-16 Jim Meyering <meyering@lucent.com>
9376 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9377 SHELLS_FILE to a file name that's useful on djgpp systems.
9379 (ADDITIONAL_DEFAULT_SHELLS): Define.
9380 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9381 Based mostly on a patch from Prashant TR.
9383 2000-12-16 Jim Meyering <meyering@lucent.com>
9385 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9386 N and M) would have treated it like `chown N:N FILE'.
9388 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9390 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9392 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9393 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9394 to the list of canonical encodings. Rename EUC-CN to GB2312.
9396 2000-12-08 Andreas Schwab <schwab@suse.de>
9398 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9399 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9401 2000-12-07 Jim Meyering <meyering@lucent.com>
9403 * stripslash.c (ISSLASH): Define.
9404 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9407 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9408 (dir_name_r): Declare this function as static.
9409 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9410 manifest itself on a name containing a mix of slashes and
9412 Make this function work with names starting with a DOS-style
9413 drive letter and colon prefix.
9414 (dir_name): Append `.' if necessary.
9415 Based mostly on patches from Prashant TR and Eli Zaretskii.
9417 * dirname.h (dir_name_r): Remove prototype.
9419 2000-12-05 Jim Meyering <meyering@lucent.com>
9421 * dirname.c (dir_name_r): Add `const' in a few local declarations.
9423 2000-12-04 Jim Meyering <meyering@lucent.com>
9425 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9426 Also include memory.h, stdlib.h, unistd.h if appropriate.
9427 Reported by Andreas Jaeger (conflicting declaration of malloc).
9429 2000-12-02 Jim Meyering <meyering@lucent.com>
9431 * closeout.h: Make idempotent, to avoid some obscure warnings.
9433 2000-12-01 Paul Eggert <eggert@twinsun.com>
9435 * memrchr.c: Include <config.h> before any system include file.
9437 2000-11-29 Paul Eggert <eggert@twinsun.com>
9439 * dirname.c (dir_name_r): Fix typo: int -> size_t.
9441 2000-11-26 Jim Meyering <meyering@lucent.com>
9443 * memcoll.c: Include sys/types.h. From Werner Almesberger.
9445 2000-11-22 Paul Eggert <eggert@twinsun.com>
9447 * strftime.c (my_strftime): Do not invoke mbrlen with a
9448 size of (size_t) -1; it's not portable.
9450 2000-11-17 Akim Demaille <akim@epita.fr>
9452 * obstack.h: Formatting changes.
9453 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9454 prevent type checking.
9455 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9456 cast the value to (void *): assigning a `foo *' to a `void *'
9458 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9460 2000-11-17 Jim Meyering <meyering@lucent.com>
9462 * strstr.c: Update from GNU libc.
9464 2000-11-16 Jim Meyering <meyering@lucent.com>
9466 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9468 2000-11-11 Jim Meyering <meyering@lucent.com>
9470 * error.c: Add a couple #includes, merging from GNU libc version.
9472 2000-11-10 Jim Meyering <meyering@lucent.com>
9474 * obstack.h: Update from GNU libc.
9475 * obstack.c: Likewise.
9477 2000-11-06 Paul Eggert <eggert@twinsun.com>
9479 * getusershell.c (setusershell): Use rewind rather than
9480 fseek/fseeko, to avoid configuration hassles with fseeko.
9481 Don't bother opening SHELLS_FILE if shellstream is NULL;
9484 2000-11-05 Jim Meyering <meyering@lucent.com>
9486 * makepath.h (make_dir): Declare.
9487 * makepath.c (make_dir): Remove `static' attribute.
9490 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
9492 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
9493 last one in a bucket, advance to the next bucket.
9495 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
9497 * fnmatch.c: Do not comment out all the code if we are using
9498 the GNU C library, because in some cases we are replacing buggy
9499 code in the GNU C library itself.
9501 2000-10-30 Paul Eggert <eggert@twinsun.com>
9503 * error.h, getline.h, modechange.h:
9504 Remove "2000" from Copyright line, as the file hasn't been
9505 changed this year other than in the copyright notice.
9507 * xalloc.h: Add "2000" to Copyright line, as this file
9508 was changed this year.
9510 2000-10-30 Paul Eggert <eggert@twinsun.com>
9512 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9513 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9514 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9516 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
9518 * regex.h (__restrict_arr): Move definition out of #ifndef block.
9519 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9520 doesn't define __restrict_arr.
9522 2000-10-29 Jim Meyering <meyering@lucent.com>
9524 * xstat.in: Fix grammar in comment.
9526 2000-10-28 Jim Meyering <meyering@lucent.com>
9528 * memchr.c: Update from libc.
9529 Adjust for portability:
9530 [HAVE_STDLIB_H]: Include stdlib.h.
9531 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9532 Undef __memchr, too.
9533 [!weak_alias]: Define __memchr to memchr.
9535 * regex.c: Update from libc.
9536 * regex.h: Likewise.
9537 * getopt1.c: Likewise.
9538 * memcmp.c: Likewise.
9540 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9541 Avoid using fseek, when possible -- it's broken by design.
9542 Patch by Ulrich Drepper.
9544 2000-10-26 Jim Meyering <meyering@lucent.com>
9546 * strftime.c: Update from libc.
9548 2000-10-25 Jim Meyering <meyering@lucent.com>
9550 * obstack.c: Update from libc.
9552 2000-10-23 Jim Meyering <meyering@lucent.com>
9554 * hard-locale.c (hard_locale): Revert last change -- it was simply
9555 wrong. That set_locale call must not have any side effects.
9558 2000-10-22 Jim Meyering <meyering@lucent.com>
9560 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9561 [CYCLIC]: Remove now-unused definition.
9563 * save-cwd.c (O_DIRECTORY): Define, if needed.
9564 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9565 Suggestion from Ulrich Drepper.
9567 2000-10-21 Jim Meyering <meyering@lucent.com>
9569 * dirname.c (dir_name_r): New function, factored out of dir_name.
9570 (dir_name): Use dir_name_r.
9571 * dirname.h (dir_name_r): Declare it.
9573 2000-10-21 Jim Meyering <meyering@lucent.com>
9575 * dirname.c (memrchr): Declare if necessary.
9576 (dir_name): Remove the restriction that there be no
9577 trailing slashes. Now, this code skips past them, effectively
9579 [TEST_DIRNAME] (main): New unit tests.
9581 * memrchr.c: New file from GNU libc.
9582 Undef __memrchr, too.
9583 [!weak_alias]: Define __memrchr to memrchr.
9584 Guard weak_alias use with `#ifdef weak_alias'.
9586 2000-10-17 Jim Meyering <meyering@lucent.com>
9588 * quote.h (PARAMS): Define and use.
9589 Reported by Akim Demaille.
9591 * getopt.c: Update from libc.
9593 2000-10-16 Jim Meyering <meyering@lucent.com>
9595 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9598 2000-09-25 Jim Meyering <meyering@lucent.com>
9600 * md5.h (rol): Define (from GnuPG).
9602 * sha.c: Give credit (GnuPG) where due.
9603 (M): Use rol rather than open-coding it.
9604 Add a FIXME comment.
9606 2000-09-21 Jim Meyering <meyering@lucent.com>
9608 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9609 Reported by Michael Stone.
9611 2000-09-20 Jim Meyering <meyering@lucent.com>
9613 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9614 (noinst_HEADERS): Add sha.h.
9615 Based on code from Scott G. Miller and from GnuPG.
9617 2000-09-15 Jim Meyering <meyering@lucent.com>
9619 * regex.c: Update from libc.
9621 2000-09-10 Jim Meyering <meyering@lucent.com>
9623 * getopt.c (_getopt_internal): Update from glibc.
9625 2000-09-09 Jim Meyering <meyering@lucent.com>
9627 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9628 think it should be used as a general replacement for isascii.
9629 * fnmatch.c: Likewise.
9630 * mbswidth.c: Likewise
9631 * regex.c: Likewise.
9634 * userspec.c: Include sys/param.h and limits.h.
9636 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9637 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9638 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9639 UID, GID. Check range.
9641 2000-09-06 Jim Meyering <meyering@lucent.com>
9643 * getopt.c (_getopt_internal): Update from glibc.
9645 2000-08-30 Jim Meyering <meyering@lucent.com>
9647 * strftime.c: Merge in changes from GNU libc.
9649 2000-08-26 Jim Meyering <meyering@lucent.com>
9651 * closeout.c: Include "__fpending.h".
9652 (close_stdout_status): Return right away if there's nothing to flush.
9654 * Makefile.am (noinst_HEADERS): Add __fpending.h.
9655 * __fpending.c: New file.
9656 * __fpending.h: New file.
9658 2000-08-07 Paul Eggert <eggert@twinsun.com>
9660 Standardize on "memory exhausted" instead of "Memory exhausted"
9661 or "virtual memory exhausted".
9662 * obstack.c (print_and_abort): Use "memory exhausted", not
9663 "virtual memory exhausted".
9664 * same.c (same_name): Invoke xalloc_die instead of printing
9666 * userspec.c (parse_user_spec): Likewise.
9667 * bumpalloc.h: comment fix
9668 * same.c, userspec.c: Include xalloc.h.
9670 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9671 not char *const and pointing to a constant array.
9672 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9673 (xrealloc): Comment fix.
9675 * userspec.c (parse_user_spec):
9676 Don't translate a message until just before returning,
9677 to avoid unnecessary translation.
9679 2000-08-07 Jim Meyering <meyering@lucent.com>
9681 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9682 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9683 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9684 getgroups.c, gethostname.c, getopt.h, group-member.c,
9685 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9686 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9687 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9688 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9689 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9690 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9691 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9692 yesno.c: Back out Copyright date changes for each file with no change
9693 this year. This eases coordination with other programs using the same
9694 source code modules. From Paul Eggert.
9696 2000-08-03 Greg McGary <greg@mcgary.org>
9698 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9699 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9700 (EXTEND_BUFFER): Use them.
9702 2000-08-01 Jim Meyering <meyering@lucent.com>
9704 * dirname.c (ISSLASH): Define.
9705 (BACKSLASH_IS_PATH_SEPARATOR): Define.
9706 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9707 both `\' and `/' may be use as path separators.
9708 Based on a patch from Prashant TR.
9710 2000-07-31 Paul Eggert <eggert@twinsun.com>
9712 * quotearg.c (quotearg_n_options): Don't make the initial
9713 slot vector a constant, since it might get modified.
9715 2000-07-31 Jim Meyering <meyering@lucent.com>
9717 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9718 * obstack.c (print_and_abort): Likewise.
9720 2000-07-30 Paul Eggert <eggert@twinsun.com>
9722 * quotearg.c (quotearg_n_options): Preallocate a slot 0
9723 buffer, so that the caller can always quote one small
9724 component of a "memory exhausted" message in slot 0.
9725 From a suggestion by Jim Meyering.
9727 2000-07-30 Jim Meyering <meyering@lucent.com>
9729 * makepath.c (make_path): Quote the other instance, too.
9731 * quotearg.c (N_STATIC_SLOTVECS): Define.
9732 (STATIC_BUF_SIZE): Define.
9733 (quotearg_n_options): Use only statically allocated storage when
9734 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9735 than STATIC_BUF_SIZE.
9737 2000-07-29 Jim Meyering <meyering@lucent.com>
9739 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9740 * dirname.c (dir_name): Likewise.
9742 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9744 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9745 (dir_name): Assert that there are no trailing slashes.
9747 2000-07-18 Bruno Haible <haible@clisp.cons.org>
9749 * mbswidth.h (mbswidth): Add a flags argument.
9750 (mbswidth): New declaration.
9751 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9752 * mbswidth.c (mbswidth): Add a flags argument.
9753 (mbsnwidth): New function.
9755 2000-07-24 Jim Meyering <meyering@lucent.com>
9757 * mbswidth.c: Remove useless #else. From Bruno Haible.
9759 2000-07-23 Paul Eggert <eggert@twinsun.com>
9761 * mbswidth.c (_XOPEN_SOURCE):
9762 Don't define; this causes problems on Solaris 7.
9763 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9765 2000-07-23 Paul Eggert <eggert@twinsun.com>
9768 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9769 so that mbstate_t is always defined.
9771 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9772 be 1 in at least one GCC installation, and this configuration
9773 error is likely to be common. Ignoring MB_LEN_MAX hurts
9774 performance on hosts that have mbrtowc but have only unibyte
9775 locales, but I assume these hosts are rare.
9777 2000-07-23 Paul Eggert <eggert@twinsun.com>
9779 * quotearg.c: Streamline by invoking multibyte code only if needed.
9780 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9781 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9782 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9783 invoke multibyte primitives.
9785 2000-07-23 Jim Meyering <meyering@lucent.com>
9787 * basename.c (base_name): Add an assertion.
9789 2000-07-15 Bruno Haible <clisp.cons.org>
9791 * quotearg.c: When the system forces us to redefine mbstate_t,
9792 shadow its mbsinit function.
9794 2000-07-16 Bruno Haible <haible@clisp.cons.org>
9796 * mbswidth.h: New file.
9797 * mbswidth.c: New file.
9798 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9799 (noinst_HEADERS): Add mbswidth.h.
9801 2000-07-17 Bruno Haible <haible@clisp.cons.org>
9803 * config.charset: Add support for FreeBSD. Improve support for HP-UX
9806 2000-07-15 Jim Meyering <meyering@lucent.com>
9808 * makepath.c: Include quote.h.
9809 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9810 corresponding argument in a `quote (...)' call.
9811 Give better diagnostics.
9813 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9814 (noinst_HEADERS): Add quote.h.
9816 * quote.c (quote, quote_n): New file. Two functions taken verbatim
9817 from tar's src/misc.c.
9818 * quote.h: New file. Prototypes for same.
9820 2000-07-10 Paul Eggert <eggert@twinsun.com>
9822 From a suggestion by Bruno Haible.
9823 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9824 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9825 to decide whether to define the BeOS workaround macro;
9826 this adjusts to the change to AC_MBSTATE_T.
9828 2000-07-13 Paul Eggert <eggert@twinsun.com>
9830 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9832 * quotearg.c (quoting_style_args, quoting_style_vals,
9833 quotearg_buffer_restyled): Add support for
9834 clocale_quoting_style. Undo previous change to
9835 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9836 and "{RIGHT QUOTATION MARK}" msgids.
9838 2000-07-05 Paul Eggert <eggert@twinsun.com>
9840 The old behavior of quoting `like this' doesn't look good with
9841 newer, ISO-style fonts. See:
9842 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9844 Instead, quote "like this" by default. Let the translator
9845 tailor the locale-specific quoting behavior by providing
9846 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9848 * quotearg.c (N_): New macro.
9849 (gettext_default): New function.
9850 (quotearg_buffer_restyled): Use
9851 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9852 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9854 2000-07-09 Jim Meyering <meyering@lucent.com>
9856 * Most files: Update copyright dates to include 2000.
9858 2000-07-08 Jim Meyering <meyering@lucent.com>
9860 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9862 (xgethostname): Remove now-unnecessary #ifdef.
9863 Move declaration of `err' into loop where it's used.
9865 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9867 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9868 by allocating a larger buffer. Test the gethostname return value for
9869 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
9870 returns an error and ENAMETOOLONG isn't defined.
9872 2000-07-05 Paul Eggert <eggert@twinsun.com>
9873 and Bruno Haible <haible@clisp.cons.org>
9875 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9877 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9879 * quotearg.c (struct quoting_options): Simplify quote_these_too
9882 2000-07-03 Jim Meyering <meyering@lucent.com>
9884 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9885 Reported by Bruno Haible.
9887 2000-07-04 Jim Meyering <meyering@lucent.com>
9889 * quotearg.c: Make inclusion of <wchar.h> independent of whether
9890 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
9893 2000-07-03 Paul Eggert <eggert@twinsun.com>
9894 and Bruno Haible <haible@clisp.cons.org>
9896 * quotearg.c (mbrtowc):
9897 Assign to *pwc, and return 1 only if result is nonzero.
9898 (iswprint): Use ISPRINT when substituting our own mbrtowc.
9900 2000-07-03 Jim Meyering <meyering@lucent.com>
9902 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9903 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9906 2000-07-02 Jim Meyering <meyering@lucent.com>
9908 * quotearg.c (mbstate_t): Don't define here.
9910 2000-07-02 Jim Meyering <meyering@lucent.com>
9912 * nanosleep.c (SIGCONT): Define if not already defined.
9914 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9916 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9917 per change in ../m4/ls-mntd-fs.m4.
9918 (read_filesystem_list): Ignore symbolic links.
9920 2000-06-29 Jim Meyering <meyering@lucent.com>
9922 * same.c: Include <string.h> or <strings.h>, as appropriate,
9923 for declaration of strcmp.
9925 * long-options.c: Include <stdlib.h>, for declaration of exit.
9927 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9928 Avoid warning by casting result to `char *' to remove `const'.
9930 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9932 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9934 2000-06-26 Paul Eggert <eggert@twinsun.com>
9936 savedir now sets errno on failure and invokes xmalloc to get memory.
9937 Fix a couple of other minor bugs while we're at it.
9939 * savedir.c (<unistd.h>): Do not include; there's no need.
9940 (NAMLEN): Remove macro.
9941 (malloc, realloc): Remove decls.
9943 ("xalloc.h"): Include.
9944 (NAME_SIZE_DEFAULT): New macro.
9945 (savedir): Use xmalloc / xrealloc to allocate memory.
9946 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9947 Skip "" directory entries.
9948 Use strlen to calculate directory entry length, since the old method
9949 is rarely used these days and isn't worth supporting.
9950 Don't use a pointer after freeing it.
9951 Check for integer overflow when calculating allocation size.
9952 Use memcpy to copy entries, instead of stpcpy.
9953 Set errno properly when returning NULL.
9954 Check for readdir error.
9956 2000-06-26 Jim Meyering <meyering@lucent.com>
9958 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9960 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9962 * getusershell.c (xmalloc, xrealloc): Remove functions.
9964 Don't include <stdlib.h>. Don't declare malloc, realloc.
9966 2000-06-23 Bruno Haible <haible@clisp.cons.org>
9968 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9970 2000-06-24 Jim Meyering <meyering@lucent.com>
9972 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9974 2000-06-21 Jim Meyering <meyering@lucent.com>
9976 * getpass.c: New file, from Bruno Haible. Required for BeOS.
9978 2000-06-19 Paul Eggert <eggert@twinsun.com>
9980 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9981 (mbrtowc, mbstate_t): Define substitutes if
9982 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9983 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9984 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9986 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9988 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9989 than 1024, return a memory chunk of least possible size, instead
9990 of size PATH_MAX + 2. In the loop, increment the size proportionally.
9991 Use free/xmalloc instead of xrealloc to avoid copying for very long
9994 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9996 * canon-host.c (canon_host): Use malloc and memcpy to copy an
9997 address, not strdup. Include <stdlib.h> and don't declare free().
9999 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10001 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10004 2000-06-21 Jim Meyering <meyering@lucent.com>
10006 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10007 (noinst_HEADERS): Add getstr.h.
10009 * getline.c (getstr): Move into a separate file.
10010 * getstr.c (getstr): New file, extracted from getline.c, with
10011 the following changes: new parameter, delim2; both delim[12]
10012 parameters have type `int', not `char'. The latter would lose
10013 with 8-bit delimiters.
10014 * getstr.h: New file.
10016 2000-06-19 Jim Meyering <meyering@lucent.com>
10018 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10020 2000-06-18 Jim Meyering <meyering@lucent.com>
10022 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10023 Besides, these days every porting target provides a mkdir function.
10025 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10026 (this snippet comes from src/system.h).
10028 2000-06-15 Paul Eggert <eggert@twinsun.com>
10030 * human.c (adjust_value): New function.
10031 (human_readable_inexact): Apply rounding style even when
10032 printing approximate values.
10034 2000-06-14 Paul Eggert <eggert@twinsun.com>
10036 * human.c (human_readable_inexact): Allow an input block
10037 size that is not a multiple of the output block size, and vice versa.
10038 Reported by Piergiorgio Sartor.
10040 2000-06-14 Paul Eggert <eggert@twinsun.com>
10042 * getdate.y (get_date): Apply relative times after time
10043 zone indicator, not before. Reported by Todd A. Jacobs.
10045 2000-06-13 Jim Meyering <meyering@lucent.com>
10047 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10049 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10051 2000-06-12 Paul Eggert <eggert@twinsun.com>
10053 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10055 2000-06-04 Paul Eggert <eggert@twinsun.com>
10057 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10059 2000-06-04 Jim Meyering <meyering@lucent.com>
10061 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10062 SunOS 4.1.4 for which gid_t is an unsigned type.
10064 2000-06-03 Jim Meyering <meyering@lucent.com>
10066 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10068 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10070 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10071 newer, don't install charset.alias.
10072 * config.charset: Change the Linux/glibc rules so they become empty
10073 on glibc-2.1 or newer.
10075 2000-06-02 Jim Meyering <meyering@lucent.com>
10077 * mountlist.c: Back out last change. Instead, do this...
10078 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10079 member using the same `ignore'-testing code.
10080 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10084 2000-05-29 Jim Meyering <meyering@lucent.com>
10086 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10087 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10089 2000-05-22 Jim Meyering <meyering@lucent.com>
10091 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10093 2000-05-18 Jim Meyering <meyering@lucent.com>
10095 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10096 back, too, since it may have been modified by allocate_entry.
10097 (hash_delete): Rewrite to use neither the assignment operator
10098 nor the comma operator in an if-expression.
10100 2000-05-15 Paul Eggert <eggert@twinsun.com>
10103 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10104 Remove; no longer needed.
10105 "quotearg.h": Add include.
10106 (file_name): Do not bother to explicitly initialize to NULL; it's less
10107 efficient on some hosts.
10108 (close_stdout_status): Remove test as to whether stdout was already
10109 closed; it breaks for the case "echo x | sort >&-".
10110 Quote file name colons.
10111 Do not assume that _("write error") lacks format strings.
10113 2000-05-15 Jim Meyering <meyering@lucent.com>
10115 * version-etc.c (version_etc_copyright): Update the copyright string
10116 used in all --version output.
10118 2000-05-14 Jim Meyering <meyering@lucent.com>
10120 * closeout.c (close_stdout_set_file_name): New function.
10121 (close_stdout_status): Use new file-scoped global.
10122 Return right away if fstat says the stdout file descriptor is invalid.
10123 * closeout.h (close_stdout_set_file_name): Declare.
10125 2000-05-10 Jim Meyering <meyering@lucent.com>
10127 * closeout.c [default_exit_status]: New file-scoped variable.
10128 (close_stdout_set_status): New function.
10129 * closeout.h (close_stdout_set_status): Declare.
10131 2000-05-08 Jim Meyering <meyering@lucent.com>
10133 * long-options.c: Don't include closeout.h.
10134 (parse_long_options): Don't call close_stdout for --version.
10136 2000-05-06 Jim Meyering <meyering@lucent.com>
10138 * strnlen.c: Undefine __strnlen and strnlen.
10139 [!weak_alias]: Define __strnlen to strnlen.
10141 * atexit.c: New file, from libiberty.
10143 2000-05-06 Jim Meyering <meyering@lucent.com>
10145 * closeout.c (close_stdout_status): Also check for errors on the
10148 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10150 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10151 instead of xmalloc, xrealloc, path_concat.
10152 (locale_charset): Treat empty environment variables as absent.
10153 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10155 2000-05-04 Jim Meyering <meyering@lucent.com>
10157 * getopt.c: Update from glibc.
10158 * obstack.c: Likewise.
10159 * obstack.h: Likewise.
10160 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10162 * regex.h: Likewise.
10163 * strndup.c: Likewise.
10164 * strnlen.c: New file, from glibc.
10166 2000-05-01 Jim Meyering <meyering@lucent.com>
10168 * full-write.c (full_write): Remove `FIXME' part of comment.
10170 2000-04-29 Jim Meyering <meyering@lucent.com>
10172 * path-concat.c: Declare strdup only if it's not defined.
10173 * canon-host.c: Likewise.
10175 2000-04-28 Jim Meyering <meyering@lucent.com>
10177 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10178 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10179 included first, then limits.h is included by locale.h by libintl.h.
10180 From John David Anglin.
10182 2000-04-25 Jim Meyering <meyering@lucent.com>
10184 * makepath.c (S_IRWXUGO): Define.
10185 (make_path): Always perform explicit chmod if MODE specifies any
10186 of the `special' permission bits. Prompted by a bug report against
10187 install from Mate Wierdl and Joost van Baal.
10189 2000-04-18 Jim Meyering <meyering@lucent.com>
10191 * README: New file.
10193 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10194 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10196 2000-04-17 Jim Meyering <meyering@lucent.com>
10198 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10199 the definition of it to rpl_strftime also defined-away the system's
10202 2000-04-15 Jim Meyering <meyering@lucent.com>
10204 Use `C' to denote so-called `contiguous' files, the same way
10206 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10207 (ftypelet): Use S_ISCTG.
10208 From Michael Deutschmann.
10210 2000-04-14 Jim Meyering <meyering@lucent.com>
10212 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10214 2000-04-08 Jim Meyering <meyering@lucent.com>
10216 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10217 names don't conflict. Reported by Eli Zaretskii.
10219 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10221 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10222 bug. Deal with the different error behavior of Irix iconv.
10224 2000-04-07 Jim Meyering <meyering@lucent.com>
10226 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10227 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10229 2000-04-05 Jim Meyering <meyering@lucent.com>
10231 Portability tweaks required for ultrix4.3.
10232 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10233 * readutmp.c: Include sys/types.h before sys/stat.h.
10234 * canon-host.c: Declare strdup.
10235 * path-concat.c: Likewise.
10236 From John David Anglin.
10238 2000-04-04 Jim Meyering <meyering@lucent.com>
10240 Be more DOS 8.3-friendly.
10241 * ref-add.sin: Renamed from ref-add.sed.in.
10242 * ref-del.sin: Renamed from ref-del.sed.in.
10243 * Makefile.am: Reflect renaming.
10244 Reported by Eli Zaretskii.
10246 Use a temporary file name that won't clash with `charset.alias'
10247 in the DOS 8.3 name space.
10248 * Makefile.am (charset_tmp): Define.
10249 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10250 (uninstall-local): Likewise.
10251 Reported by Eli Zaretskii.
10253 2000-03-29 Paul Eggert <eggert@twinsun.com>
10255 * time/strftime.c (my_strftime): Make sure we call the system
10256 strftime, not ourselves, when invoking the underlying strftime.
10258 2000-03-24 Jim Meyering <meyering@lucent.com>
10260 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10261 (charset_alias): Define.
10262 (install-exec-local): Factor out common code.
10263 (uninstall-local): Split lines longer than 80.
10264 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10265 (SUFFIXES): Define.
10266 (.sed.in.sed): New rule. Don't redirect directly to $@.
10267 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10269 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10271 * config.charset: Output a line containing "Packages using this file".
10272 * ref-add.sed.in, ref-del.sed.in: New files.
10273 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10274 ref-del.sed): New rules.
10276 2000-03-17 Jim Meyering <meyering@lucent.com>
10278 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10279 Otherwise, include <strings.h>
10281 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10283 * unicodeio.c (utf8_wctomb): New function.
10284 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10285 format instead of in UCS-4 with platform dependent endianness.
10287 2000-03-07 Paul Eggert <eggert@twinsun.com>
10289 * savedir.c (savedir): Work even if directory size is
10290 negative; this can happen with some screwy NFS configurations.
10292 2000-03-06 Jim Meyering <meyering@lucent.com>
10294 * localcharset.c (get_charset_aliases): Don't try to free file_name
10295 if it's NULL (because we ran out of memory). From Bruno Haible.
10297 2000-03-05 Jim Meyering <meyering@lucent.com>
10299 * localcharset.c ("path-concat.h"): Include.
10300 (get_charset_aliases): Use path_concat instead of ANSI string
10303 * unicodeio.h (PARAMS): Define.
10304 Use it to guard prototype.
10306 2000-03-04 Jim Meyering <meyering@lucent.com>
10308 * Makefile.am (install-exec-local): Create $(libdir) before installing
10310 (uninstall-local): Uncomment this rule so `make distcheck' works
10313 * unicodeio.c (<errno.h>): Include it.
10314 (errno): Declare if not defined.
10316 * localcharset.c: Add Bruno's comment justifying use of volatile.
10318 * config.charset: New version, incorporating remarks from a linux
10319 i18n mailing list. From Bruno Haible.
10321 2000-03-02 Jim Meyering <meyering@lucent.com>
10323 * Makefile.am (EXTRA_DIST): Add config.charset.
10325 2000-03-01 Jim Meyering <meyering@lucent.com>
10327 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10328 * unicodeio.c: Likewise.
10330 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10332 * config.charset: New file.
10333 * localcharset.c: New file.
10334 * unicodeio.h, unicodeio.c: New files.
10335 * Makefile.am (DEFS): Add -DLIBDIR=...
10336 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10337 (noinst_HEADERS): Add unicodeio.h.
10338 (all-local, install-exec-local, charset.alias): New targets.
10340 2000-02-28 Paul Eggert <eggert@twinsun.com>
10342 * quotearg.c (ALERT_CHAR): New macro.
10343 (quotearg_buffer_restyled): Use it.
10345 2000-02-27 Jim Meyering <meyering@lucent.com>
10347 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10348 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10350 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10351 not `#if STDC_HEADERS'.
10352 Declare malloc if needed.
10354 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10355 now that autoconf always defines the HAVE_DECL_ symbols.
10356 * human.c: Likewise.
10357 * same.c: Likewise.
10358 * strtoumax.c: Likewise.
10360 * backupfile.c: Arrange for cpp to fail if the configure-time
10361 declaration check was not run.
10362 * hash.c: Likewise.
10363 * human.c: Likewise.
10364 * same.c: Likewise.
10365 * strtoumax.c: Likewise.
10367 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10368 then first look up the entire `.'-containing string as a login name.
10370 2000-02-18 Paul Eggert <eggert@twinsun.com>
10372 * getdate.y: Handle two-digit years with leading zeros correctly.
10373 (textint): New typedef.
10374 (parser_control): Member year changed from int to textint.
10376 (YYSTYPE): Removed; replaced by %union with int and textint members.
10377 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10378 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10379 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10380 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10381 (date, number, to_year): Use width of number in digits, not its value,
10382 to determine whether it's a 2-digit year, or a 2-digit time.
10383 (yylex): Store number of digits of numeric tokens.
10384 Reported by John Kendall.
10386 (parser_control): Changed from struct parser_control to typedef (for
10387 consistency). All uses changed.
10389 (tID): Removed; not used.
10390 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10392 2000-02-14 Paul Eggert <eggert@twinsun.com>
10394 * getpagesize.h (getpagesize): Port to VMS for Alpha;
10395 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10397 2000-02-12 Jim Meyering <meyering@lucent.com>
10399 * userspec.c (ISDIGIT): Define it.
10400 (isdigit): Remove definition.
10401 (is_number): Use ISDIGIT, not isdigit.
10402 <libintl.h>: Include.
10403 (_ and N_): Define.
10404 (parse_user_spec): Mark translatable strings.
10406 2000-02-10 Jim Meyering <meyering@lucent.com>
10408 With these changes, nanosleep.[ch] are finally enough like the other
10409 lib/* replacement files to compile on a few more losing systems.
10411 * nanosleep.h: Don't include config.h.
10412 Remove prototype from declaration of nanosleep.
10413 (PARAMS): Remove now-unneeded definition.
10414 * nanosleep.c: #undef nanosleep.
10415 (rpl_nanosleep): Rename from nanosleep.
10417 2000-02-03 Jim Meyering <meyering@lucent.com>
10419 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10420 rather than with `#if HAVE_UTMPNAME'.
10422 2000-02-01 Jim Meyering <meyering@lucent.com>
10424 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
10426 2000-01-31 Jim Meyering <meyering@lucent.com>
10428 * nanosleep.h (nanosleep): Guard declaration with
10429 `#if ! HAVE_DECL_NANOSLEEP'.
10430 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10431 the declaration in that vendor's sys/timers.h.
10432 Reported by Christian Krackowizer.
10434 * quotearg.c (ISASCII): Add #undef and move definition to follow
10435 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10436 (ISPRINT): Likewise.
10437 Reported by Tom Tromey.
10439 2000-01-30 Jim Meyering <meyering@lucent.com>
10441 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10442 uses of ->ut_name. The latter doesn't work with new Linux header files
10443 where only utmpx.ut_user is declared.
10445 * readutmp.h (UT_USER): Define.
10447 2000-01-23 Jim Meyering <meyering@lucent.com>
10449 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10452 2000-01-22 Jim Meyering <meyering@lucent.com>
10454 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10455 [! HAVE_DECL_STRTOULL]: Declare strtoull.
10456 Required for some AIX systems. Reported by Christian Krackowizer.
10457 [TESTING] (main): New function.
10459 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
10460 * dirname.c (dir_name): Support for DOS-style file names with drive
10463 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10465 * strverscmp.c (ISDIGIT): Define.
10466 (strverscmp): Use ISDIGIT, not isdigit.
10468 2000-01-17 Paul Eggert <eggert@twinsun.com>
10470 * nanosleep.c (nanosleep):
10471 Don't use SA_INTERRUPT to decide whether to call sigaction, as
10472 POSIX.1 doesn't require SA_INTERRUPT and some systems
10473 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
10474 it's been part of POSIX.1 since day 1 (in 1988).
10476 2000-01-17 Jim Meyering <meyering@lucent.com>
10478 * interlock: Remove unused file. Reported by François Pinard.
10480 2000-01-16 Paul Eggert <eggert@twinsun.com>
10482 * quotearg.c (quotearg_buffer_restyled): Do not quote
10483 alert, backslash, formfeed, and vertical tab unnecessarily in
10484 shell quoting style.
10487 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10488 Free Software Foundation, Inc.
10489 Copying and distribution of this file, with or without modification,
10490 are permitted provided the copyright notice and this notice are preserved.