1 2006-08-14 Eric Blake <ebb9@byu.net>
3 Import the following change from libc:
5 2006-08-12 Ulrich Drepper <drepper@redhat.com>
8 * misc/error.c: Add space between program name and message if file
11 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
13 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
14 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
16 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
17 in wchar_t. Problem reported by Eric Blake.
19 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
20 LEN is smaller than SIZE. Suggested by Bruno Haible.
21 Also, help the compiler to keep LEN in a register.
23 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
25 * .cppi-disable: Add snprintf.h, socket_.h.
26 * snprintf.c: Include <errno.h> and <limits.h>.
27 (EOVERFLOW): Define if the system does not.
28 Do not include "minmax.h"; it wasn't used.
29 (snprintf): Don't assume size_t promotes to an unsigned type.
30 Fix bug when generated string was too long for the buffer: the
31 buffer's contents are supposed to be the initial prefix of the
32 output. Don't assume vasnprintf returns EOVERFLOW if the size
33 exceeds INT_MAX; do the check ourselves.
35 Import the following changes from libc:
37 2006-06-02 Jakub Jelinek <jakub@redhat.com>
39 * posix/regex_internal.c (re_string_skip_chars): If no character has
40 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
41 to the byte which couldn't be converted.
42 (re_string_reconstruct): Don't clear valid_raw_len before calling
43 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
44 tip_context using re_string_context_at.
46 2006-05-02 Ulrich Drepper <drepper@redhat.com>
48 * posix/regex.h: g++ still cannot handled [restrict].
50 2006-04-21 Ulrich Drepper <drepper@redhat.com>
52 * posix/regex.h: Remove special handling for VMS.
54 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
58 2006-07-19 Mike Frysinger <vapier@gentoo.org>
60 * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
61 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
63 2006-08-08 Eric Blake <ebb9@byu.net>
65 * verror.c (verror_at_line): Work around glibc bug 2997, so that
66 verror_at_line output complies with GNU Coding Standards even when
69 2006-08-08 Eric Blake <ebb9@byu.net>
71 * verror.h, verror.c: New files.
73 2006-08-07 Bruno Haible <bruno@clisp.org>
75 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
77 Reported by Ralf Wildenhues.
79 2006-08-06 Eric Blake <ebb9@byu.net>
81 * error.h: Fold in some upstream changes from glibc.
84 2006-07-29 Bruno Haible <bruno@clisp.org>
86 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
88 2006-07-29 Bruno Haible <bruno@clisp.org>
90 * setenv.c: Undo unintended modification done on 2006-02-27.
92 2006-07-28 Eric Blake <ebb9@byu.net>
94 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
97 2006-07-28 Simon Josefsson <jas@extundo.com>
99 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
102 2006-07-28 Simon Josefsson <jas@extundo.com>
104 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
107 2006-07-28 Bruno Haible <bruno@clisp.org>
109 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
111 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
113 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
116 2006-07-28 Bruno Haible <bruno@clisp.org>
118 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
119 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
121 Avoids link error on FreeBSD 4.x.
122 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
124 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
126 * mbswidth.c (iswcntrl): Likewise.
128 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
130 * modechange.c (mode_compile): Numeric modes now affect setuid and
131 setgid on directories only if they set these bits.
132 * modechange.h: Remove obsolete comment about masks.
134 2006-07-27 Bruno Haible <bruno@clisp.org>
136 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
137 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
140 2006-07-26 Eric Blake <ebb9@byu.net>
142 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
143 like mingw that lack mkstemp.
144 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
145 avoid compilation warning on mingw.
147 2006-07-25 Bruno Haible <bruno@clisp.org>
149 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
150 <stdarg.h> or config.h.
152 2006-07-24 Bruno Haible <bruno@clisp.org>
154 * clean-temp.h: New file, from GNU gettext.
155 * clean-temp.c: New file, from GNU gettext.
157 2006-07-24 Bruno Haible <bruno@clisp.org>
159 * tmpdir.h: New file, from GNU gettext.
160 * tmpdir.c: New file, from GNU gettext.
162 2006-07-23 Bruno Haible <bruno@clisp.org>
164 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
165 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
166 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
167 gl_linked_remove_at): Use it.
169 2006-07-23 Eric Blake <ebb9@byu.net>
171 * tmpfile-safer.c: New file.
172 * stdio-safer.h (fopen_safer): Add prototype.
173 * stdio--.h (tmpfile): Make safer.
175 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
177 * close-stream.c, close-stream.h: New files.
179 2006-07-22 Bruno Haible <bruno@clisp.org>
181 Merge from GNU gettext 0.15.
183 2005-07-05 Bruno Haible <bruno@clisp.org>
185 * printf-args.c (printf_fetchargs): Work around broken
186 definition of wint_t on mingw.
188 2005-02-12 Bruno Haible <bruno@clisp.org>
190 * xallocsa.h: Add extern "C" for C++.
192 2006-05-17 Bruno Haible <bruno@clisp.org>
195 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
197 2006-04-30 Bruno Haible <bruno@clisp.org>
199 * progreloc.c: Include <mach-o/dyld.h> if available.
200 (find_executable): Use _NSGetExecutablePath when possible.
202 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
204 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
207 2005-12-29 Bruno Haible <bruno@clisp.org>
209 * progreloc.c (set_program_name_and_installdir): Fix
212 2005-12-04 Bruno Haible <bruno@clisp.org>
215 * progreloc.c: Include <windows.h> also on Cygwin.
216 (find_executable): Add support for Cygwin.
217 (set_program_name_and_installdir): Handle also platforms with
220 2006-07-11 Bruno Haible <bruno@clisp.org>
222 * javacomp.c: Fix a comment.
223 Reported by Jim Meyering.
225 2006-04-30 Bruno Haible <bruno@clisp.org>
227 * javacomp.h (compile_java_class): Add source_version,
228 target_version arguments.
229 * javacomp.c: Rewritten to choose only a compiler that
230 respects the specified source_version and target_version.
232 2006-06-27 Bruno Haible <bruno@clisp.org>
234 Assume correct S_ISDIR macro.
235 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
237 2006-07-22 Bruno Haible <bruno@clisp.org>
239 * javaversion.h: New file, from GNU gettext.
240 * javaversion.c: New file, from GNU gettext.
241 * javaversion.java: New file, from GNU gettext.
242 * javaversion.class: New file, from GNU gettext.
244 2006-05-17 Bruno Haible <bruno@clisp.org>
247 * javaexec.c (execute_java_class): Test for jview program
250 2006-04-09 Bruno Haible <bruno@clisp.org>
252 * fatal-signal.c: Don't include string.h.
253 (at_fatal_signal): Use a copying loop instead of memcpy.
255 2005-12-04 Bruno Haible <bruno@clisp.org>
257 * csharpexec.c: Add support for 'clix' launcher (untested).
258 (execute_csharp_using_sscli): New function.
259 (execute_csharp_program): Call it.
261 2006-06-21 Bruno Haible <bruno@clisp.org>
263 Avoid warnings from recent versions of mcs.
264 * csharpcomp.c (compile_csharp_using_mono): Don't use options
265 -o, -L, -r any more. Use options documented since mcs-1.0
266 instead. Similarly for -g.
268 2005-07-09 Bruno Haible <bruno@clisp.org>
270 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
272 Reported by Mark Junker <mjscod@gmx.de>.
274 2006-06-17 Bruno Haible <bruno@clisp.org>
276 * config.charset: Update for NetBSD 3.0.
278 2006-05-17 Bruno Haible <bruno@clisp.org>
281 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
283 2006-05-16 Bruno Haible <bruno@clisp.org>
285 * localcharset.c [CYGWIN]: Include <windows.h>.
286 (get_charset_aliases): For Cygwin, return the same CPxxx
287 aliases list as under WIN32.
288 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
289 the environment variables. Fall back to GetACP().
291 2006-04-05 Bruno Haible <bruno@clisp.org>
293 * config.charset: Update Juan Manuel Guerrero's address.
295 2005-02-12 Bruno Haible <bruno@clisp.org>
297 * allocsa.h: Add extern "C" for C++.
299 2005-02-10 Bruno Haible <bruno@clisp.org>
301 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
302 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
304 2006-07-22 Bruno Haible <bruno@clisp.org>
306 * gettext.h: Update to GNU gettext-0.15.
308 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
309 and Simon Josefsson <jas@extundo.com>
311 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
313 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
315 2006-07-21 Eric Blake <ebb9@byu.net>
317 * stdlib-safer.h: New file from coreutils, required by
320 2006-07-19 Derek R. Price <derek@ximbiot.com>
322 * getaddrinfo.h: Don't define unimplemented AI_* flags.
323 Reindent and repaginate.
325 2006-07-17 Bruno Haible <bruno@clisp.org>
327 * gl_list.h: New file.
328 * gl_list.c: New file.
329 * gl_array_list.h: New file.
330 * gl_array_list.c: New file.
331 * gl_carray_list.h: New file.
332 * gl_carray_list.c: New file.
333 * gl_linked_list.h: New file.
334 * gl_linked_list.c: New file.
335 * gl_anylinked_list1.h: New file.
336 * gl_anylinked_list2.h: New file.
337 * gl_avltree_list.h: New file.
338 * gl_avltree_list.c: New file.
339 * gl_anyavltree_list1.h: New file.
340 * gl_anyavltree_list2.h: New file.
341 * gl_rbtree_list.h: New file.
342 * gl_rbtree_list.c: New file.
343 * gl_anyrbtree_list1.h: New file.
344 * gl_anyrbtree_list2.h: New file.
345 * gl_anytree_list1.h: New file.
346 * gl_anytree_list2.h: New file.
347 * gl_linkedhash_list.h: New file.
348 * gl_linkedhash_list.c: New file.
349 * gl_anyhash_list1.h: New file.
350 * gl_anyhash_list2.h: New file.
351 * gl_avltreehash_list.h: New file.
352 * gl_avltreehash_list.c: New file.
353 * gl_rbtreehash_list.h: New file.
354 * gl_rbtreehash_list.c: New file.
355 * gl_anytreehash_list1.h: New file.
356 * gl_anytreehash_list2.h: New file.
358 * gl_oset.h: New file.
359 * gl_oset.c: New file.
360 * gl_array_oset.h: New file.
361 * gl_array_oset.c: New file.
362 * gl_avltree_oset.h: New file.
363 * gl_avltree_oset.c: New file.
364 * gl_rbtree_oset.h: New file.
365 * gl_rbtree_oset.c: New file.
366 * gl_anytree_oset.h: New file.
368 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
370 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
372 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
373 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
374 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
375 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
376 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
377 callers changed. Revamp internals significantly, by not
378 attempting to create directories that are temporarily more
379 permissive than the final results. Do not attempt to use
380 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
381 This removes some race conditions, fixes some bugs, and simplifies
382 things. Use new dirchownmod function to do owner and mode changes.
383 * mkdir-p.h: Likewise.
384 * modechange.c (octal_to_mode): New function.
385 (struct mode_change): New member mentioned.
386 (make_node_op_equals): New arg mentioned. All callers changed.
387 (mode_compile): Keep track of which mode bits the user has explicitly
389 (mode_adjust): New arg DIR, so that we implement the X op correctly.
390 New arg PMODE_BITS, to keep track of which mode bits the user
391 mentioned; it treats S_ISUID and S_ISGID speciall.
393 * modechange.h: Likewise.
395 2006-07-11 Derek R. Price <derek@ximbiot.com>
397 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
399 2006-07-10 Derek R. Price <derek@ximbiot.com>
401 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
402 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
403 macros into the GNU _D_EXACT_NAMLEN.
404 * savedir.c: Likewise.
405 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
407 2006-07-09 Jim Meyering <jim@meyering.net>
409 * argp-pv.c: Remove a doubled word in a comment.
410 * check-version.c (check_version): Likewise.
411 * javacomp.c (compile_java_class): Likewise.
413 2006-07-08 Jim Meyering <jim@meyering.net>
415 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
417 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
419 * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
420 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
421 brackets. Other minor changes to suppress some compiler
424 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
426 * getloadavg.c: Use __VMS, not VMS.
427 * getopt.c: Likewise.
428 * getpagesize.h: Likewise.
429 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
430 probably does not work.
432 2006-07-06 Derek R. Price <derek@ximbiot.com>
433 and Paul Eggert <eggert@cs.ucla.edu>
435 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
436 Don't worry about this obsolete case any more.
437 (HAVE_DIR): Remove. All uses removed; we now assume you can read
439 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
440 worry about this obsolete case any more.
442 * getcwd.c: Likewise.
444 * savedir.c: Likewise.
446 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
448 * .cppi-disable: Add wcwidth.
449 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
450 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
451 (ISGRAPH): Remove. All uses changed to isgraph.
452 (FOLD) [!defined _LIBC]: Remove special case.
453 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
454 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
456 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
458 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
460 * strtod.c (strtod): cast the argument of tolower to unsigned char.
462 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
464 * memcasecmp.c: Include <limits.h>.
465 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
466 * strtod.c (strtod): Don't assume isspace works on negative chars.
467 Don't assume isdigit succeeds only on '0' through '9'.
469 2006-07-05 Derek R. Price <derek@ximbiot.com>
471 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
472 All uses of is_space replaced by isspace.
473 * exit.h: Don't talk about STDC_HEADERS.
474 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
475 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
476 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
477 replaced by isprint etc.
478 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
479 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
480 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
481 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
482 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
483 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
485 2006-07-05 Eric Blake <ebb9@byu.net>
487 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
488 missing from netdb.h.
489 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
491 2006-06-27 Bruno Haible <bruno@clisp.org>
493 Assume ANSI C header files and <ctype.h> functions.
494 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
495 (mbsnwidth): Use isprint, iscntrl instead.
497 2006-07-03 Jim Meyering <jim@meyering.net>
499 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
500 macro is used before the first cycle_check call.
502 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
504 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
505 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
506 reported by Mark D. Baushke, one in
507 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
509 Merge from coreutils.
511 * .cppi-disable: Add stdint_.h.
512 * .cvsignore: Add stdint.h.
514 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
516 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
517 both double and long double versions.
518 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
519 * xstrtold.c: New file.
520 * xstrtod.h (xstrtold): New decl.
522 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
524 * filemode.c (setst): Remove.
525 (strmode): Rewrite to avoid setst. This makes the code shorter,
526 (arguably) clearer, and the generated code is a bit smaller on my
527 Debian GNU/Linux stable x86 host.
529 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
531 * filemode.c: Include "filemode.h" first, to test the interface.
532 Assume that filemode.h includes sys/types.h and sys/stat.h.
533 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
534 (ftypelet): Reorder to put common cases first, for efficiency.
535 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
537 (strmode): Renamed from mode_string, and now stores 12 bytes instead
538 of 10, for compatibility with FreeBSD. All callers changed.
539 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
540 that can't be deduced solely from st_mode. First arg is now a const
542 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
543 (strmode): Renamed from mode_string.
544 (filemodestring): New decl.
545 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
546 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
547 (S_ISPORT, S_ISWHT): New macros, if not already defined.
549 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
551 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
552 fsusage.h now does that. Include fsusage.h first, to test interface.
553 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
554 at most one method (the old code could have generated decls that
555 didn't conform to C89, not that this was ever exercised).
556 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
558 2006-03-19 Jim Meyering <jim@meyering.net>
560 Work even in a chroot where d_ino values for entries in "/"
561 don't match the stat.st_ino values for the same names.
562 * getcwd.c (__getcwd): When no d_ino value matches the target inode
563 number, iterate through all entries again, using lstat instead.
564 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
565 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
567 * getcwd.c (__getcwd): Clarify a comment.
568 Use memcpy in place of a call to strcpy.
570 2006-03-12 Jim Meyering <jim@meyering.net>
572 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
573 that of the current directory (which we're about to chdir ".." out of),
574 then save the dev-ino of the parent, instead.
576 * same-inode.h (SAME_INODE): New file/macro.
577 * chdir-safer.c (SAME_INODE): Remove definition.
578 Include "same-inode.h", instead.
580 * cycle-check.h: Include "same-inode.h".
581 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
582 * cycle-check.c (SAME_INODE): Remove definition.
583 * root-dev-ino.h: Include "same-inode.h".
585 2006-03-11 Eric Blake <ebb9@byu.net>
587 * same.c (same_name): s/base_name/last_component/
588 * backupfile.c (check_extension, numbered_backup): Likewise.
589 * filenamecat.c (file_name_concat): Likewise.
591 2006-03-11 Eric Blake <ebb9@byu.net>,
592 Paul Eggert <eggert@cs.ucla.edu>
594 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
595 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
597 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
598 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
599 (last_component): New method.
600 * dirname.c (dir_len): Determine when drive letters need a
601 subsequent slash. Preserve // when it is special.
602 (dir_name): Don't append dot when drive letter is absolute.
603 [TEST_DIRNAME]: Move into a full-blown gnulib test.
604 * basename.c (base_name): New semantics - malloc the result.
605 Preserve // when it is special. Preserve relative files that look
607 (base_len): Preserve // when it is special.
608 (last_component): New method, similar to old base_name semantics.
609 * stripslash.c (strip_trailing_slashes): Use last_component, not
610 base_name. Strip redundant slashes from ///.
612 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
614 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
615 both are 64 bits, since this seems to be the tradition, and this
616 prevents gcc -Wformat from warning about usages with PRIuMAX. If
617 we ever run into a host that prefers long long to long in this
618 case, we'll need another configure-time test. Problem reported by
621 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
623 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
624 possible collision with system files.
625 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
626 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
627 WCHAR_MIN and WCHAR_MAX in this case.
628 (<stddef.h>): Do not include; no longer needed.
629 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
630 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
631 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
632 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
633 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
634 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
635 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
636 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
637 !defined(__c99))]: Include in this case too, since it's harmless
639 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
641 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
642 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
643 (_STDINT_MIN, _STDINT_MAX): New macros.
644 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
645 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
646 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
647 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
648 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
649 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
650 macros, not typedefs; this simplifies things quite a bit.
651 Use long int for all types narrower than int64_t.
652 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
653 Define in terms of long long int or int64_t or long int,
654 not int64_t or int32_t. This saves some compile-time testing.
655 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
656 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
657 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
658 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
659 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
660 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
661 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
662 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
663 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
664 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
665 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
666 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
667 undef any previous version and define our own version, for
668 simplicity and consistency with the new macros for types.
669 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
670 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
671 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
672 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
673 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
674 @WINT_T_SUFFIX@ to keep things simple here.
675 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
676 Simplify by assuming typical 8/16/32/64 host, since we're
677 already doing that elsewhere anyway.
678 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
679 and assume long long int is 64 bits if available. This
680 speeds up 'configure'.
682 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
684 * getaddrinfo.c: fixed typo
686 2006-06-29 Eric Blake <ebb9@byu.net>
688 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
689 unused static function.
691 2006-06-29 Eric Blake <ebb9@byu.net>
695 2006-06-29 Derek R. Price <derek@ximbiot.com>
697 * strftime.c: Assume strftime() exists.
699 2006-06-28 Bruno Haible <bruno@clisp.org>
701 * getaddrinfo.h: Fix POSIX URL.
702 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
703 (use_win32_p): Make static.
704 (getaddrinfo): Reject service name if it is empty or does not consist
705 solely of decimal digits, or if its value is > 65535.
706 (getnameinfo): Remove useless casts.
708 2006-06-28 Derek R. Price <derek@ximbiot.com>
710 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
711 Autoconf 2.60 says this stuff was obsolete.
713 2006-05-12 Bruno Haible <bruno@clisp.org>
715 * mkdtemp.c [MINGW]: Include <io.h>.
716 (mkdir): Define using _mkdir.
718 2006-06-28 Bruno Haible <bruno@clisp.org>
720 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
721 declaration for wcwidth.
722 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
724 2006-06-28 Eric Blake <ebb9@byu.net>
726 * xvasprintf.h: Fix comments.
728 2006-06-28 Eric Blake <ebb9@byu.net>
730 * mbchar.h (wcwidth): Include wcwidth.h.
731 * mbswidth.c (wcwidth): Move from here...
732 * wcwidth.h: ...to this new file.
734 2006-06-28 Simon Josefsson <jas@extundo.com>
736 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
737 functions there. It will succeed on Windows XP, but on Windows
738 2000 and (presumably) earlier, it will fail, and use the internal
740 (use_win32_p): New function.
741 (getaddrinfo): Use strtoul on servname, to support numeric ports.
742 Support AI_NUMERICSERV to disable getservbyname.
743 (getnameinfo): New function, only supports
744 NI_NUMERICHOST|NI_NUMERICSERV for now.
746 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
747 only have some of them. Add AI_NUMERICSERV. Add prototype for
750 2006-06-27 Bruno Haible <bruno@clisp.org>
752 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
754 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
756 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
757 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
758 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
760 2006-06-26 Bruno Haible <bruno@clisp.org>
762 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
764 Reported by Mark D. Baushke and Larry Jones.
766 2006-06-26 Bruno Haible <bruno@clisp.org>
768 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
770 Suggested by Mark D. Baushke and Larry Jones.
772 2006-06-23 Mark D. Baushke <mdb@gnu.org>
774 * stdint_.h: Treat BSD/OS like OpenBSD.
776 2006-06-23 Bruno Haible <bruno@clisp.org>
778 * stdint_.h: Treat IRIX like OpenBSD.
780 2006-06-23 Bruno Haible <bruno@clisp.org>
782 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
783 ISO C 99 Technical Corrigendum 1.
785 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
787 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
788 Some compiler complained about some of them. Problem reported by
790 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
792 2006-06-21 Simon Josefsson <jas@extundo.com>
794 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
797 * socket_.h: Don't define WINVER.
799 * inet_pton.h, inet_pton.c: New file, taken from glibc but
800 slightly modified to work in gnulib.
802 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
804 * read-file.c (fread_file): Start with buffer allocation of
805 0 bytes rather than 1 byte; this simplifies the code.
806 Don't invoke feof; it's not needed. Refactor to avoid duplicate
807 code to free buffer and save/restore errno.
808 (internal_read_file): Remove unused local.
810 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
812 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
813 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
814 Problem reported by Denis Excoffier in
815 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
817 2006-06-19 Simon Josefsson <jas@extundo.com>
819 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
821 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
823 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
825 2006-06-17 Bruno Haible <bruno@clisp.org>
827 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
829 2006-06-17 Bruno Haible <bruno@clisp.org>
831 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
832 problem on Solaris 2.5.1.
834 2006-06-16 Eric Blake <ebb9@byu.net>
836 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
837 * unicodeio.c [!defined errno]: Likewise.
838 * strtol.c [!defined errno]: Likewise.
839 * strtod.c [!defined errno]: Likewise.
841 2006-06-15 Bruno Haible <bruno@clisp.org>
843 * stdint_.h: Rewritten to be fully auto-configured.
844 Fixes bug on HP-UX/IA64.
846 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
848 * getdate.y (__attribute__): Don't define if already defined.
849 Problem reported by Larry Jones.
850 * utimens.c (__attribute__): Likewise.
852 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
854 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
855 reported by Andreas Schwab.
857 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
858 Bruno Haible <bruno@clisp.org>
860 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
862 2006-05-26 Martin Lambers <marlam@marlam.de>
864 * getpass.c: Updates the test for the native W32 API, and adds
865 missing includes, thus fixing compilation warnings.
867 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
869 * tempname.c (small_open, large_open): New macros.
870 (__open, __open64) [!_LIBC]: Remove.
871 (__gen_tempname): Use small_open and large_open instead of __open
872 and __open64. This fixes a portability bug on HP-UX 11.11i
873 reported by Simon Wing-Tang in
874 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
876 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
878 * exclude.c (exclude_fnmatch): New function.
879 (excluded_file_name): Call exclude_fnmatch.
880 * exclude.h (excluded_file_name): New prototype
882 2006-05-24 Bruno Haible <bruno@clisp.org>
884 * printf-args.c (printf_fetchargs): Turn NULL pointers for
885 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
886 Reported by Thorsten Maerz <torte@netztorte.de> via
887 Aaron Stone <aaron@serendipity.cx>.
889 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
891 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
892 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
893 (my_usleep): Don't mishandle maximum value.
895 2006-05-19 Jim Meyering <jim@meyering.net>
897 * getugroups.c: Correct an outdated comment. From Bruno Haible.
899 2006-05-17 Bruno Haible <bruno@clisp.org>
902 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
904 2006-05-17 Bruno Haible <bruno@clisp.org>
906 * stdint_.h: Fix recognition of Cygwin.
908 2006-05-11 Jim Meyering <jim@meyering.net>
910 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
912 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
914 * crc.c (crc32_update): Remove unnecessary L suffix.
915 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
916 unwanted sign propagation, e.g., on hosts with 64-bit int.
917 There still are some problems with reeelly weird theoretical hosts
918 (e.g., 33-bit int) but it's not worth worrying about now.
919 * sha1.c (rol): Likewise.
920 (K1, K2, K3, K4): Remove unnecessary L suffix.
922 2006-05-10 Bruno Haible <bruno@clisp.org>
924 * des.c: Cast to avoid warnings.
926 2006-05-10 Simon Josefsson <jas@extundo.com>
928 * md4.c: Typo fix, update copyright years.
929 (K1, K2): Don't use L because it turn computations into 64-bit on
932 2006-05-09 Bruno Haible <bruno@clisp.org>
934 * xvasprintf.c: Include limits.h, string.h, xsize.h.
935 (EOVERFLOW): Define fallback value.
936 (xstrcat): New function.
937 (xvasprintf): Recognize the special case of a string concatenation.
939 2006-05-01 Bruno Haible <bruno@clisp.org>
941 * stdint_.h: Shorter URL.
942 * inttypes.h: Likewise.
944 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
946 * verify.h: Document the internals better. Most of this change
947 was written by Bruno Haible.
949 2006-04-29 Bruno Haible <bruno@clisp.org>
951 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
952 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
954 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
956 * getdate.y (get_date): When adding relative date, start with the
957 initial time, not with the result of the first mktime call.
959 2006-04-23 Bruno Haible <bruno@clisp.org>
961 * copy-file.c: Include <unistd.h> unconditionally.
962 * execute.c: Likewise.
963 * fatal-signal.c: Likewise.
964 * findprog.c: Likewise.
965 * mkdtemp.c: Likewise.
968 * wait-process.h: Likewise.
970 2006-04-23 Bruno Haible <bruno@clisp.org>
972 * fwriteerror.c (fwriteerror): Call fclose also when an error
973 condition was already detected.
974 Reported by Ben Pfaff <blp@cs.stanford.edu>.
976 2006-04-19 Derek Price <derek@ximbiot.com>
977 Eric Blake <ebb9@byu.net>
979 * inttypes.h: Correct grammar in comment.
981 2006-04-18 Derek Price <derek@ximbiot.com>
982 Paul Eggert <eggert@cs.ucla.edu>
984 * inttypes.h: New file.
985 * strtoimax.c: Assume <inttypes.h>.
987 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
989 * utimens.c (futimens): glibc futimesat messes up if /proc
990 isn't mounted. Problem reported by Kir Kolyshkin.
992 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
994 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
995 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
996 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
998 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1000 Merge regex changes from libc, removing some of our
1001 POSIX-conformance changes that were rejected and redoing them in a
1004 * regcomp.c (re_compile_internal, init_dfa):
1005 Length arg is now size_t, not Idx. All uses changed.
1006 (peek_token): Forward decl now says internal_function.
1007 (__re_error_msgid, __re_error_msgid_idx):
1008 Now static rather than extern with attribute_hidden.
1009 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1010 For some reason libc prefers K&R style defns for external functions.
1011 (regerror) [!defined _LIBC]: Likewise.
1012 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1013 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1014 (build_range_exp, build_collating_symbol):
1016 (re_compile_fastmap): Use '\0' to memset, not 0.
1017 (utf8_sb_map): Make the calculations more obvious.
1018 (init_dfa, parse_bracket_exp, build_charclass_op):
1019 Call calloc and cast result, as glibc does.
1020 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1021 (build_range_exp, build_collating_symbol):
1022 Now internal functions.
1024 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1026 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1027 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1028 Don't depend on VMS; depend on __VMS instead, for POSIX
1029 namespace cleanness.
1030 (regoff_t): Define to ssize_t, not long int.
1032 Remove the REG_ macros named below. Instead, make the old names
1033 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1035 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1036 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1037 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1038 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1039 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1040 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1041 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1042 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1043 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1044 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1045 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1046 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1047 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1048 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1049 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1050 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1051 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1053 Remove. All uses replaced by the old RE_* names.
1054 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1055 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1056 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1057 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1058 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1059 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1060 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1061 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1062 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1063 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1064 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1065 Don't bother having these macros be independent of each others'
1066 values, since they no longer exist in the POSIX name space.
1068 Rename the following member names back to their old names,
1069 unless !__USE_GNU_REGEX. All uses changed back.
1070 (buffer): Renamed from re_buffer.
1071 (allocated): Renamed from re_allocated.
1072 (used): Renamed from re_used.
1073 (syntax): Renamed from re_syntax.
1074 (fastmap): Renamed from re_fastmap.
1075 (translate): Renamed from re_translate.
1076 (can_be_null): Renamed from re_can_be_null.
1077 (regs_allocated): Renamed from re_regs_allocated.
1078 (fastmap_accurate): Renamed from re_fastmap_accurate.
1079 (no_sub): Renamed from re_no_sub.
1080 (not_bol): Renamed from re_not_bol.
1081 (not_eol): Renamed from re_not_eol.
1082 (newline_anchor): Renamed from re_newline_anchor.
1083 (num_regs): Renamed from rm_num_regs.
1084 (start): Renamed from rm_start.
1085 (end): Renamed from rm_end.
1087 (free_state): Move up a bit.
1089 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1090 #define to be empty.
1091 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1092 when that is what is intended.
1093 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1094 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1096 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1097 All uses changed back to re_malloc, etc. It's now the caller's
1098 responsibility to check for overflow; all callers changed.
1099 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1100 (re_x2nrealloc): Remove.
1101 (free_state): Remove decl.
1103 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1104 (re_set_registers, re_exec):
1107 2006-01-31 Roland McGrath <roland@redhat.com>
1109 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1110 Reported by Mike Frysinger <vapier@gentoo.org>.
1112 2006-01-15 Andreas Jaeger <aj@suse.de>
1115 * regex_internal.c (re_string_reconstruct): Adjust for
1116 build_wcs_upper_buffer change.
1117 (build_wcs_upper_buffer): Change return type.
1119 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1121 * regex_internal.h: Include <stdint.h> if available.
1123 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1125 * regex_internal.h (SIZE_MAX): Provide a default definition.
1127 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1129 * regcomp.c: Adjust for changed secondary hash function.
1131 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1133 * regex.h: Pretty printing.
1134 Clean up namespace a bit.
1136 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1138 * regexec.c (update_cur_sifted_state, check_arrival,
1139 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1141 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1142 Ulrich Drepper <drepper@redhat.com>
1145 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1146 (bitset_word_t): Renamed from bitset_word. All uses changed.
1148 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1151 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1152 * regcomp.c: Remove unnecessary uses of
1153 unsigned RE_TRANSLATE_TYPE.
1154 * regex_internal.h: Likewise.
1155 * regex_internal.c: Likewise.
1156 * regexec.c: Likewise.
1157 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1159 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1161 * regexec.c (find_recover_state): Remove unnecessary
1163 (transit_state_bkref): Make DFA a const pointer.
1164 (get_subexp): Likewise.
1165 (check_arrival): Likewise.
1166 (update_cur_sifted_state): Likewise.
1167 (re_search_internal): Likewise.
1168 (prune_impossible_nodes): Likewise.
1169 (acquire_init_state_context): Likewise.
1170 (proceed_next_node): Likewise.
1171 (set_regs): Likewise.
1172 (free_fail_stack_return): Likewise.
1173 (check_arrival_expand_ecl): Mark DFA parameter as const.
1174 (check_arrival_expand_ecl_sub): Likewise.
1175 (check_subexp_limits): Likewise.
1176 (sub_epsilon_src_nodes): Likewise.
1177 (add_epsilon_src_nodes): Likewise.
1178 (merge_state_array): Likewise.
1179 (update_regs): Likewise.
1180 (build_trtable): Likewise.
1181 (sift_states_backward): Mark MCTX parameter as const.
1182 (build_sifted_states): Likewise.
1183 (update_cur_sifted_state): Likewise.
1184 (sift_states_mkref): Likewise.
1185 (check_arrival_expand_ecl): Mark eclosure as const.
1186 (check_dst_limits_calc_pos_1): Likewise.
1187 * regex_internal.h (re_match_context_t): Make dfa a const
1190 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1192 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1193 (transit_state_sb): Likewise.
1194 (transit_state_mb): Likewise.
1195 (sift_states_iter_mb): Likewise.
1196 (check_arrival_add_next_nodes): Likewise.
1197 (check_node_accept_bytes): Change first parameter to pointer-to-const.
1198 [_LIBC] (re_search_2_stub): Use mempcpy.
1200 * regex_internal.c (re_string_reconstruct): Avoid calling
1201 mbrtowc for very simple UTF-8 case.
1203 * regex_internal.c (re_acquire_state): Make DFA pointer arg
1205 (re_acquire_state_context): Likewise.
1206 * regex_internal.h: Adjust prototypes.
1208 * regex.c: Prevent using C++ compilers.
1210 * regex_internal.c (re_acquire_state): Minor code rearrangement.
1211 (re_acquire_state_context): Likewise.
1213 2006-03-29 Mark D. Baushke <mdb@gnu.org>
1214 Bruno Haible <bruno@clisp.org>
1216 * stdint_.h: On OpenBSD, don't redefine types already included in
1217 <sys/types.h> and <inttypes.h>.
1219 2006-03-24 Eric Blake <ebb9@byu.net>
1221 * time_r.c (copy_string_result): Remove, as it is no longer used.
1223 2006-03-24 Simon Josefsson <jas@extundo.com>
1225 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1226 including some doc fixes.
1227 (base64_encode_alloc): Fix +1 bug on allocation failures.
1229 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1231 * base64.c (base64_encode): Do not read past end of array with
1232 unsanitized input on systems with CHAR_BIT > 8.
1234 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1236 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1237 Typedef to long int, not to off_, as POSIX will likely change
1240 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
1242 * argp-help.c (validate_uparams): Fix typo
1243 * argp-parse.c (argp_default_options): Consistently begin help
1244 messages with a lowercase letter.
1246 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
1248 * time_r.h (asctime_r, ctime_r): Remove. These functions can
1249 overrun buffers and shouldn't be used (much as gets shouldn't be
1251 * time_r.c (asctime_r, ctime_r): Likewise.
1253 2006-03-08 Simon Josefsson <jas@extundo.com>
1255 * gc-gnulib.c (randomize): Don't open files called 'no', they
1256 signal that configure disabled the device.
1258 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
1260 * c-stack.c: Include unistd.h unconditionally, since we now assume
1262 * getlogin_r.c: Likewise.
1263 * getlogin_r.h: Likewise.
1265 * pagealign_alloc.c: Likewise.
1266 * unistd_.h: Remove; no longer needed.
1268 2006-03-07 Simon Josefsson <jas@extundo.com>
1270 * unistd_.h: New file.
1272 2006-03-07 Simon Josefsson <jas@extundo.com>
1274 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1276 2006-03-01 Simon Josefsson <jas@extundo.com>
1278 * readline.c: Fix typo, tiny patch from Stepan Kasal
1281 2006-02-28 Simon Josefsson <jas@extundo.com>
1283 * getopt.c: Protect #include of unistd.h, for MSVS.
1285 2006-02-27 Simon Josefsson <jas@extundo.com>
1287 * base64.h: Indent #define's. From Jim Meyering
1290 2006-02-27 Jim Meyering <jim@meyering.net>
1292 Revert the change of 2006-02-24, so these files can continue
1293 to be sync'd from gettext.
1294 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1297 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
1299 * glob.c: Say "invalid" rather than "illegal" in comments.
1301 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1303 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1305 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
1307 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1308 AT_FDCWD exceeds INT_MAX.
1309 * openat.h (AT_FDCWD): Likewise.
1311 2006-02-14 Jim Meyering <jim@meyering.net>
1313 Sync from coreutils.
1315 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1316 failure on deficient systems, and simplify gnulib lgpl dependencies.
1317 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1318 xmalloc/lstat combination. Based on a patch from Bruno Haible.
1320 * xalloc-die.c: Remove unused definition of N_.
1322 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
1324 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1326 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
1328 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1329 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1331 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
1333 * argp-namefrob.h: Restore changes accidentally lost during the
1334 "autoupdate" on 2005-12-12.
1336 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1338 * fnmatch.c (L_): Renamed from L, to work around a bug in
1339 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1340 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1343 2006-01-26 Simon Josefsson <jas@extundo.com>
1345 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1346 prototype is visible on mingw32.
1348 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1351 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1354 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
1356 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
1357 attempt to open for write; this always fails, at least on POSIX
1358 hosts. This reinstates the 2006-01-09 change, which was
1359 inadvertently removed.
1361 2006-01-26 Bruno Haible <bruno@clisp.org>
1362 Paul Eggert <eggert@cs.ucla.edu>
1364 * stdbool_.h (_Bool)
1365 [(! (defined __cplusplus || defined __BEOS__)
1366 && !defined __GNUC__
1367 && !(defined __HP_cc || defined __xlc__
1368 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1369 || defined __sgi))]:
1370 #define to signed char in these cases too; this simplifies
1371 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1372 etc., separately) and makes it more conservative.
1374 2006-01-21 Jim Meyering <jim@meyering.net>
1376 Sync from the stable (b5) branch of coreutils:
1378 * fts.c (fts_children): Don't let close() clobber errno from
1381 * fts.c (fts_stat): When following a symlink-to-directory,
1382 don't necessarily interpret stat-fails+lstat-succeeds as indicating
1383 a dangling symlink. That can also happen at least for ELOOP.
1384 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1385 FYI, this bug predates the inclusion of fts.c in coreutils.
1387 * fts.c (fts_open): Put new maxarglen declaration and uses
1388 in their own block, so pre-c99 compilers don't object.
1390 Avoid the double-free (first in fts_read, second in fts_close) that
1391 would occur when an `active' directory is made inaccessible (e.g.,
1392 via chmod a-x) during a traversal.
1393 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1394 before returning. Reproduce this failure by
1395 mkdir -p a/b; cd a; chmod a-x . b
1396 Reported by Stavros Passas.
1398 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
1400 * argp-namefrob.h: Bugfix. Remove stray #
1402 2006-01-25 Bruno Haible <bruno@clisp.org>
1404 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1406 Reported by Paul Eggert.
1408 2006-01-25 Jim Meyering <jim@meyering.net>
1410 * fileblocks.c: Remove more useless parentheses.
1411 * readutmp.h: Likewise.
1413 2006-01-24 Bruno Haible <bruno@clisp.org>
1415 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1417 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
1420 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1421 to avoid problems with the built-in _Bool type.
1422 Reported by Paul Eggert on 2005-11-26.
1424 2006-01-24 Jim Meyering <jim@meyering.net>
1426 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1428 2006-01-24 Simon Josefsson <jas@extundo.com>
1430 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1433 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1435 Work around porting bugs reported by Dieter in
1436 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1437 * getopt.c (_NOPROTO): Remove; no longer needed.
1438 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1439 Include "getopt.h" first, to check interface.
1440 (getenv): Declare only if defined HAVE_DECL_GETENV &&
1442 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1443 (__strndup): Revert to K&R-style function dfns, the glibc style.
1444 * strnlen.c: Don't claim it's taken from glibc; it's not.
1445 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1446 Include strnlen.h first, to get prototype properly.
1447 (strnlen): Renamed from __strnlen.
1450 2006-01-23 Ulrich Drepper <drepper@redhat.com>
1452 These changes imported from libc.
1453 * getopt.c: Use __fxprintf instead of inline stream orientation
1454 test and two separate function calls.
1455 * strndup.c (__strndup): Add libc_hidden_def.
1457 2006-01-22 Bruno Haible <bruno@clisp.org>
1459 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1460 temporary buffer for sprintf, take into account the precision also
1461 for 'd', 'i', 'u', 'o', 'x', 'X'.
1463 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1465 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1466 to pacify gcc -Wswitch-default.
1468 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
1470 * argp-help.c (usage_long_opt): Do not print DOC options.
1471 (__argp_base_name): Removed
1472 * argp-namefrob.h (__argp_basename): Removed definition. Was a
1474 (__argp_base_name): Provide macro definition or extern declaration
1475 depending on the configuration
1477 2006-01-20 Simon Josefsson <jas@extundo.com>
1479 * inet_ntop.h: Unconditionally include sys/socket.h.
1481 2006-01-19 Simon Josefsson <jas@extundo.com>
1483 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1485 2006-01-12 Simon Josefsson <jas@extundo.com>
1487 * base64.c: Fix warning, reported by Bruno Haible
1488 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1490 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
1492 Sync from coreutils.
1493 * md5.c: Fix commentary typos.
1494 (alignof, UNALIGNED_P): No need for a GCC-specific version.
1495 * md5.h (__attribute__): Remove; unused.
1496 * sha1.c: Fix commentary to match md5 better.
1497 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1498 so that we don't need to worry about alignment. All uses changed.
1499 This merges the 2005-10-28 md5 change into sha1.
1501 2006-01-11 Jim Meyering <jim@meyering.net>
1503 Sync from coreutils.
1504 * md5.c (OP): Fix spacing.
1506 2006-01-11 Simon Josefsson <jas@extundo.com>
1508 * stdint_.h (SIZE_MAX): Add missing (.
1510 2006-01-10 Bruno Haible <bruno@clisp.org>
1512 * argp.h (__const): Remove macro. Use const instead.
1513 * argp-fmtstream.h (__const): Likewise.
1514 * glob_.h (__const): Remove macro.
1515 * glob-libc.h: Use const instead of __const.
1517 2006-01-10 Jim Meyering <jim@meyering.net>
1519 Avoid the double-free (first in fts_read, second in fts_close) that
1520 would occur when an `active' directory is made inaccessible (e.g.,
1521 via chmod a-x) during a traversal.
1522 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1523 before returning. Reproduce this failure by
1524 mkdir -p a/b; cd a; chmod a-x . b
1525 Reported by Stavros Passas.
1527 Sync from coreutils.
1528 * sha1.c: Tweak grammar in a comment.
1530 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
1532 * regex_internal.h (BITSET_WORD_BITS):
1533 Work around a bug in 64-bit PGC (before version 6.1-2), where the
1534 preprocessor mishandles large unsigned values as if they were signed.
1535 Problem reported by Claudio Fontana in
1536 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1538 2006-01-10 Simon Josefsson <jas@extundo.com>
1540 * socket_.h: New file.
1542 2006-01-10 Bruno Haible <bruno@clisp.org>
1544 * localcharset.c: Update from GNU gettext.
1546 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
1548 Sync from coreutils.
1549 * chdir-long.c (cdb_free): Don't bother trying to open directory
1550 for write access: POSIX says that must fail.
1551 * fts.c (diropen): Likewise.
1552 * save-cwd.c (save_cwd): Likewise.
1553 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1554 well, for minor improvements on hosts that lack O_DIRECTORY.
1555 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1556 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1557 Fall back on chown if open failed with EACCES.
1559 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1560 Report an error at compile-time if only a 1-second nominal clock
1561 resolution is found.
1563 * lchmod.h: New file.
1564 * mkdir-p.c: Include lchmod.h, lchown.h.
1565 (make_dir_parents): Use lchown rather than chown, and
1566 lchmod rather than chmod.
1568 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1569 too. Problem with "none" reported by Bob Proulx. Problem with
1570 "proc" reported by n0dalus.
1572 * mountlist.c: Include <limits.h>.
1573 (dev_from_mount_options)
1574 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1575 New function. It no longer assumes "dev=" has the System V meaning
1576 on Linux (since it doesn't). It also parses "dev=" more carefully.
1577 (read_file_system_list)
1578 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1579 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1582 * posixtm.h (PDS_PRE_2000): New macro.
1583 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1584 All usages changed. Reject dates outside the range 1969-1999 if
1585 PDS_PRE_2000 is used.
1587 2006-01-09 Jim Meyering <jim@meyering.net>
1589 Sync from coreutils.
1591 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1593 * chdir-safer.h, chdir-safer.c: New files.
1595 * modechange.c (mode_compile): Reject an invalid mode string
1596 that starts with an octal digit. From Andreas Gruenbacher.
1598 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1599 and dup to open_safer and dup_safer, respectively.
1600 (openat_permissive): Fix typo in comment.
1602 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1603 "gettext.h"; either no longer needed or are guaranteed by openat.h.
1604 (_): Remove; no longer needed.
1605 (openat): Renamed from rpl_openat; no need for rpl_openat
1606 since openat.h renames openat for us.
1607 Replace most of the body with a call to openat_permissive,
1608 to avoid duplicate code.
1609 Port to (probably hypothetical) environments were mode_t is
1611 (openat_permissive): Require mode arg, so that we can check
1612 types better. Put it just after flags. Change cwd failure
1613 indicator from pointer-to-bool to pointer-to-errno-value.
1614 All callers changed.
1615 Invoke openat_save_fail and/or openat_restore_fail if
1616 cwd_errno is null, so that openat can call us.
1617 (openat_permissive, fdopendir, fstatat, unlinkat):
1618 Simplify errno handling to avoid some duplicate code,
1619 as it's OK to set errno on success.
1620 * openat.h: Revamp code so that function macros depend on
1621 __OPENAT_PREFIX only, not also on AT_FDCWD.
1622 (openat_ro): Remove. Caller changed to use openat_permissive.
1623 (openat_permissive): Now a macro, if not a function.
1624 (openat_restore_fail, openat_save_fail): Now always functions,
1625 since mkdirat needs them even if __OPENAT_PREFIX is defined.
1627 * openat-priv.h: New file, defining macros used by mkdirat.c
1629 * mkdirat.c: Include openat-priv.h.
1630 Remove definitions of macros defined therein.
1631 * openat.c: Likewise.
1633 * mkdirat.c (mkdirat): New file and function.
1634 * openat.h (mkdirat): Declare.
1636 * openat.c (fdopendir): Don't change errno when returning non-NULL.
1638 * openat.h (openat_permissive): Declare.
1639 (openat_ro): Define.
1641 * openat.c (EXPECTED_ERRNO): New macro.
1642 (openat_permissive): New function -- used in remove.c rewrite.
1643 (all functions): Set errno just before returning, only if there
1644 was an actual failure.
1645 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1647 Emulate openat-family functions using Linux's procfs, if possible.
1648 Idea and some code based on Ulrich Drepper's glibc changes.
1650 * openat.c: (BUILD_PROC_NAME): New macro.
1651 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1652 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1653 before falling back on save_cwd and restore_cwd.
1654 (fdopendir, fstatat, unlinkat): Likewise.
1656 * openat.c (fstatat, unlinkat): Perform the syscall directly,
1657 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1659 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1660 as second argument to va_arg. Otherwise, some versions of gcc
1661 warn that `if this code is reached, the program will abort'.
1663 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
1665 Sync from coreutils.
1667 Add POSIX ACL support
1668 * acl.h (copy_acl, set_acl): Add declarations.
1669 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1670 systems other than Linux.
1671 (chmod_or_fchmod): New function: use fchmod when possible,
1672 and chmod otherwise.
1673 (file_has_acl): Add a POSIX ACL implementation, with a
1674 Linux-specific subcase.
1675 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1676 S_ISVTX from one file to another. Fall back to fchmod/chmod when
1677 acls are unsupported.
1678 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1679 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
1682 2006-01-09 Bruno Haible <bruno@clisp.org>
1684 * sysexit_.h (EX_OK): New macro.
1685 Suggested by Martin Lambers <marlam@marlam.de>.
1687 2006-01-09 Bruno Haible <bruno@clisp.org>
1689 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1690 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1691 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1692 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1694 2006-01-09 Bruno Haible <bruno@clisp.org>
1696 * stdint_.h (SIZE_MAX): Write the value without involving negative
1699 2005-10-16 Bruno Haible <bruno@clisp.org>
1701 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1702 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1704 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
1706 * strftime.c (tzname): Don't declare if it is already #defined.
1707 Problem reported for Mingw by Mark Junker.
1709 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1711 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1712 long int, not int, for nanosecond counts, so that people who are
1713 used to POSIX struct timespec won't be surprised. Reported by Jim
1716 2005-12-16 Jim Meyering <jim@meyering.net>
1718 * fprintftime.c, fprintftime.h: New files.
1720 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
1722 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1723 * argp-help.c (fill_in_uparams): Check if the constructed
1724 struct uparams is valid. Fall back to the default values if it is
1727 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
1729 * argp-help.c (__argp_base_name): New function
1730 (__argp_short_program_name): Rewrite using __argp_base_name
1731 * argp-namefrob.h: Define program_invocation_name and
1732 program_invocation_short_name if requested
1733 (__argp_base_name): Add prototype
1734 * argp-parse.c (argp_def): Use gettext wrappers
1735 (argp_default_parser): Use __argp_base_name
1736 * argp-pin.c: New file. Defines program_invocation_name and
1737 program_invocation_short_name on systems that lack them.
1739 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
1741 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1742 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1743 porting problem reported by Georg Schwarz in
1744 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1746 2005-07-09 Bruno Haible <bruno@clisp.org>
1748 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1749 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1750 Reported by Mark Junker <mjscod@gmx.de>.
1752 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
1754 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1755 (uintmax_t) [defined uintmax_t]: Do not declare.
1756 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1757 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1758 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
1759 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1760 sake of portability to weird hosts that C allows (though we don't
1761 know of any practical examples).
1763 * savedir.h (fdsavedir): New decl.
1764 * savedir.c (fdsavedir, savedirstream): New functions; the latter
1765 contains most of the former guts of savedir.
1766 (savedir): Use savedirstream.
1769 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
1771 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1772 coreutils no longer futzes with rounding modes.
1774 2005-11-14 Jim Meyering <jim@meyering.net>
1776 * mkstemp-safer.c: Include <config.h>, required for possible
1777 replacement of mkstemp.
1779 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
1781 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1783 (gethrxtime) [! (HAVE_NANOUPTIME
1784 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1785 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1786 our own approximation.
1788 2005-11-10 Simon Josefsson <jas@extundo.com>
1790 * readline.c: Remove EOL.
1792 2005-11-08 Eric Blake <ebb9@byu.net>
1794 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1796 2005-11-08 Eric Blake <ebb9@byu.net>
1798 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1800 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
1802 Fix porting problem reported by Theodoros V. Kalamatianos.
1803 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1804 Don't assume that futimes failing means we must fail.
1806 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
1808 * getcwd.c (__getcwd): Don't assume that system calls after readdir
1809 leave errno alone. Problem reported by Dmitry V. Levin.
1811 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
1813 * savedir.c (savedir): Don't assume that xrealloc etc. leave
1814 errno alone. Problem reported by Frederic Jolliton.
1816 2005-10-28 Simon Josefsson <jas@extundo.com>
1818 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1819 "restrict" keywords, as per POSIX. Protect the function
1820 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1821 Don't use K&R prototypes. Check the sprintf return values.
1822 Re-define EAFNOSUPPORT if not present. Indent.
1824 * md5.h, md5.c: Simplify buffer handling visavi alignment,
1825 suggested by Bruno Haible <bruno@clisp.org>.
1827 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
1829 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
1831 * gc-libgcrypt.c: Add MD2 (which is not available through
1834 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
1836 * md2.h, md2.c: New files.
1838 2005-10-24 Simon Josefsson <jas@extundo.com>
1840 * md4.h: Shrink buffer size, now that we changed the type.
1842 2005-10-22 Simon Josefsson <jas@extundo.com>
1844 * arcfour.h, arcfour.c: Use fixed size indices in the
1845 arcfour_context struct (simplify test vector testing in GNU
1848 2005-10-22 Simon Josefsson <jas@extundo.com>
1850 * md4.h, md4.c: Simplify buffer handling visavi alignment,
1851 suggested by Bruno Haible <bruno@clisp.org>.
1853 2005-10-22 Simon Josefsson <jas@extundo.com>
1855 * crc.h: Include stddef.h, for size_t.
1857 2005-10-21 Simon Josefsson <jas@extundo.com>
1859 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
1860 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
1862 2005-10-21 Simon Josefsson <jas@extundo.com>
1864 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
1867 2005-10-21 Simon Josefsson <jas@extundo.com>
1869 * gc-gnulib.c: Support ARCTWO in CBC mode.
1871 2005-10-21 Simon Josefsson <jas@extundo.com>
1873 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
1876 * hmac-sha1.c (hmac_sha1): Likewise.
1878 * crc.c (crc32_update): Actually use crc parameter, suggested by
1879 Bruno Haible <bruno@clisp.org>.
1881 * crc.h: Include stdint.h directly, suggested by Bruno Haible
1884 2005-10-21 Simon Josefsson <jas@extundo.com>
1886 * des.h, des.c: New files.
1888 * gc-gnulib.c: Support DES.c
1890 2005-10-21 Simon Josefsson <jas@extundo.com>
1892 * arctwo.h, arctwo.c: New files.
1894 * gc-gnulib.c: Support ARCTWO.
1896 2005-10-21 Simon Josefsson <jas@extundo.com>
1898 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
1900 2005-10-19 Simon Josefsson <jas@extundo.com>
1902 * gc-gnulib.c: Support ARCFOUR.
1904 2005-10-19 Simon Josefsson <jas@extundo.com>
1906 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
1909 * gc.h: Add ECB enum type.
1911 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
1913 2005-10-19 Simon Josefsson <jas@extundo.com>
1915 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
1917 2005-10-18 Simon Josefsson <jas@extundo.com>
1919 * md4.h, md4.c: New files, based on md5.?.
1921 2005-10-17 Simon Josefsson <jas@extundo.com>
1923 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
1925 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
1927 2005-10-17 Simon Josefsson <jas@extundo.com>
1929 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
1931 2005-10-17 Simon Josefsson <jas@extundo.com>
1933 * gc.h, gc-libgcrypt.c: Add ciphers.
1935 2005-10-17 Simon Josefsson <jas@extundo.com>
1937 * sha1.c: Use uint32_t instead of md5_uint32.t
1939 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
1942 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
1944 * md5.h: Use stdint.h and uint32_t. Doc fix.
1946 2005-10-15 Simon Josefsson <jas@extundo.com>
1948 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
1950 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
1952 2005-10-14 Simon Josefsson <jas@extundo.com>
1954 * arcfour.h, arcfour.c: New files.
1956 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
1958 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1959 include <wchar.h>; no longer needed.
1961 2005-10-14 Jakub Jelinek <jakub@redhat.com>
1962 and Ulrich Drepper <drepper@redhat.com>
1965 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1966 instead of inline stream orientation test and two separate
1967 function calls. Pay no attention to USE_IN_LIBIO.
1969 2005-10-14 Roland McGrath <roland@redhat.com>
1971 Import from libc. [BZ #1331]
1972 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1974 Reported by Matej Vela <vela@debian.org>.
1976 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
1978 * mkdir-p.c (make_dir_parents): Don't report an error if an
1979 intermediate directory is in a read-only file system. Problem
1980 reported by Eric Blake.
1982 2005-10-13 Simon Josefsson <jas@extundo.com>
1984 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
1985 Move memory allocation outside of loop.
1987 2005-10-12 Simon Josefsson <jas@extundo.com>
1989 * gc-pbkdf2-sha1.c: New file.
1991 * gc.h: Add gc_pbkdf2_sha1 prototype.
1993 2005-10-12 Simon Josefsson <jas@extundo.com>
1995 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
1996 suggested by Bruno Haible <bruno@clisp.org>.
1998 2005-10-12 Simon Josefsson <jas@extundo.com>
2000 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2002 * gc-gnulib.c (gc_hmac_sha1): New function.
2004 2005-10-12 Simon Josefsson <jas@extundo.com>
2006 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2008 2005-10-12 Simon Josefsson <jas@extundo.com>
2010 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2011 GC_USE_HMAC_MD5, respectively.
2013 * gc-libgcrypt.c (gc_md5): Fix assert call.
2016 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2018 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2020 * gc-gnulib.c (gc_hash_buffer): Ditto.
2022 2005-10-11 Bruno Haible <bruno@clisp.org>
2024 * c-strcasestr.h: New file, from GNU gettext.
2025 * c-strcasestr.c: New file, from GNU gettext.
2027 2005-10-11 Bruno Haible <bruno@clisp.org>
2029 * c-strcase.h: New file, from GNU gettext.
2030 * c-strcasecmp.c: New file, from GNU gettext.
2031 * c-strncasecmp.c: New file, from GNU gettext.
2033 2005-10-11 Simon Josefsson <jas@extundo.com>
2035 * crc.h, crc.c: New files.
2037 * gc.h (gc_hash_buffer): Add doc.
2039 2005-10-08 Simon Josefsson <jas@extundo.com>
2041 * gc.h: Add gc_hash and gc_hash_buffer.
2043 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2045 * gc-libgcrypt.c (gc_hash_buffer): Add.
2047 2005-10-11 Bruno Haible <bruno@clisp.org>
2049 * strcasecmp.c: Include limits.h.
2050 (strcasecmp): Avoid integer overflow on exotic platforms.
2051 * strncasecmp.c: Include limits.h.
2052 (strncasecmp): Avoid integer overflow on exotic platforms.
2053 Reported by Paul Eggert.
2055 2005-10-06 Simon Josefsson <jas@extundo.com>
2057 * hmac-md5.c: New file.
2061 2005-10-06 Simon Josefsson <jas@extundo.com>
2063 * memxor.c (memxor): Avoid casts and warnings.
2065 2005-10-05 Derek Price <derek@ximbiot.com>
2067 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2069 2005-10-05 Simon Josefsson <jas@extundo.com>
2071 * memxor.c (memxor): Fix compiler error.
2073 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2074 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2076 * memxor.h, memxor.c: New files.
2078 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2079 we assume all systems have it, suggested by Jim Meyering
2080 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2081 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2082 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2085 2005-10-04 Bruno Haible <bruno@clisp.org>
2087 * verify.h (verify_true): Provide alternative definition for C++.
2089 2005-10-04 Simon Josefsson <jas@extundo.com>
2091 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2092 D. Baushke" <mdb@gnu.org>.
2094 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2096 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2097 (SSIZE_MAX): New macro, if not already defined.
2098 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2101 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2103 * exclude.c: Include verify.h.
2104 (verify): Remove. All callers changed to use verify.h's version.
2105 * strtoimax.c: Likewise.
2106 * utimecmp.c: Likewis.e
2108 Sync from coreutils.
2109 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2110 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2111 * .cvsignore: Add fts.h, search.h, t-fpending.
2112 * settime.c (settime): Fix { typo in previous patch. Also, don't
2113 bother returning ENOSYS if settimeofday or stime fails; just let
2114 them return whatever errno they want to return.
2115 * utimens.c: Include unistd.h, for dup2.
2116 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2117 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2119 2005-10-02 Jim Meyering <jim@meyering.net>
2121 Sync from coreutils.
2122 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2123 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2124 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2125 Remove AT_FDCWD test.
2126 Do not consume the fd unless successful.
2127 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2128 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2129 block, so that we don't even try to compile it if settimeofday is
2130 available. This works around a compilation failure on OSF1 V5.1,
2131 due to stime requiring a `long int*' while tv_sec is `int'.
2133 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2135 * getdelim.c (getdelim): Remove unused variables.
2137 2005-10-01 Simon Josefsson <jas@extundo.com>
2139 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2140 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2141 AI_* and EAI_* definitions. Protect function declarations.
2143 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2145 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2146 so that the code works even with ancient cpp. Portability problem
2147 with GCC 2.7.2.1 reported by Thomas M.Ott.
2149 2005-09-27 Jim Meyering <jim@meyering.net>
2151 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2153 * intprops.h (signed_type_or_expr__): Define.
2154 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2157 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2159 * verify.h (verify_expr): Remove, replacing with:
2160 (verify_true): New macro that returns true instead of void.
2161 (verify_type__): Remove.
2162 (verify): Use verify_true rather than verify_type__.
2164 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2166 * utimens.c (ENOSYS): Define if not already defined.
2167 (futimens): Support having a null PATH if the file descriptor
2170 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2172 (__attribute): Define to empty unless GCC 3.1 or later.
2173 This works around a core dump on OpenBSD 3.4, which has GCC
2174 2.95.3, which dumps core when given __attribute__(()). It also
2175 simplifies other tests, since we really don't want to bother with
2176 worrying about which ancient version of GCC supported what.
2177 Original problem reported by Yoann Vandoorselaere, with part of
2178 the fix suggested by Derek Price.
2180 2005-09-24 Jim Meyering <jim@meyering.net>
2182 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2183 so we can once again use a positive bitfield width of 1 -- now we
2184 don't have to explain why we were using a bitfield width of 2.
2186 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2188 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2189 Problem reported by Eric Blake.
2190 (getaddrinfo): Initialize se so that it's not garbage.
2191 Redo internal storage allocation so that it doesn't make unportable
2192 assumptions about alignment.
2195 * utimens.c (futimens): Use futimesat if available.
2196 Prefer it to futimes since it doesn't have the futimes bug.
2198 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2199 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2200 Instead, declare a function that returns a pointer to an array,
2201 and use verify_type__ to declare the size of the array.
2202 Problem and germ of a solution reported by Bruno Haible.
2203 (verify_type__): Use 2, not 1, for bitfield size, to avoid
2204 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
2206 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
2208 Sync from coreutils.
2210 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2212 * argmatch.h: Include verify.h
2213 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2214 (ARGMATCH_ASSERT): Remove; unused.
2215 * canonicalize.c: Assume STDC_HEADERS.
2216 * exclude.c: Include "strcase.h".
2217 * regex_internal.h [!defined _LIBC]: Likewise.
2218 * getusershell.c: Include stdio--.h rather than stdio.h
2220 (getusershell): Call fopen, not fopen_safer.
2221 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2222 Do not include unistd-safer.h.
2223 (save_cwd): Don't call fd_safer; no longer needed
2224 now that we include fcntl--.h.
2226 * getdate.y (relative_time): New type.
2227 (RELATIVE_TIME_0): New constant.
2228 (parser_control): Use relative_time instead of doing it ourselves.
2229 (%union): Add new relative_time rel member.
2230 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2232 (relunit, relunit_snumber): Now of type rel.
2233 (zone, rel, relunit, get_date): Adjust to above changes.
2235 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2236 Do not include unistd-safer.h.
2237 (getloadavg): Don't call fd_safer; no longer needed
2238 now that we include fcntl--.h.
2240 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2241 (make_dir_parents): Treat ENOSYS like EEXIST.
2243 Improve quality of diagnostics on restore_cwd failure.
2244 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
2245 (make_dir_parents): Last arg is now int * (for errno), not bool *.
2246 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2247 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2248 each time through the loop. Do not diagnose restore_cwd failure;
2249 that is the caller's job (and perhaps the caller does not care).
2251 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2252 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2253 If the file already exists but is not a directory, don't bother
2254 to try to make its parents.
2255 Close potential file descriptor leak if we can't chdir("/") (!).
2256 Don't always return true if chdir($PWD) fails; return true only
2257 if the requested action was done successfully (except for the
2259 Don't log final directory unless we actually made it.
2260 Refactor to avoid duplicate code to fix up permissions.
2261 Don't attempt to fix up parent permissions if chdir($PWD) fails.
2263 * strftime.c (my_strftime): Rewrite the previous change slightly,
2264 to make it a bit faster and (I hope) clearer.
2265 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2266 Fix bug in formats like %2N.
2268 * verify.h: New file.
2270 2005-09-22 Jim Meyering <jim@meyering.net>
2272 Sync from coreutils.
2274 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2276 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2277 the .tm_year member, since otherwise gcc-4.0 would now warn about
2278 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2280 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2281 order to avoid an unsuppressible warning from gcc on 64-bit systems.
2283 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2284 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2285 when run in a time zone for which daylight savings time is in effect
2286 for the starting date.
2288 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2289 stop us from restricting permissions of just-created absolute-named
2291 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2292 to restore initial working directory.
2293 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2294 to tell caller if/when we change the working directory and are
2295 unable to return to the initial one.
2296 * mkdir-p.h (make_dir_parents): Update prototype.
2297 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2298 `return false'. This fixes a bug introduced on 2004-07-30.
2300 * openat.c (fdopendir): Be sure to close the supplied
2301 file descriptor before returning. This makes our replacement
2302 implementation a little closer to Solaris's, where fdopendir
2303 ties the file descriptor to the returned DIR* pointer.
2304 * openat.c (unlinkat): New function.
2305 * openat.h (unlinkat): Add prototype.
2306 * openat-die.c (openat_save_fail): Rename from openat_save_die.
2307 (openat_restore_fail): Rename from openat_restore_die.
2308 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2310 Provide an alternative to exiting immediately upon save_cwd or
2311 restore_cwd failure. Now, an application can arrange e.g.,
2312 to perform a longjump in that case.
2313 * openat.c: Include dirname.h.
2314 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2315 (rpl_openat, fdopendir, fstatat): Call openat_save_die
2316 and openat_restore_die rather than calling error directly.
2317 Don't include "error.h" or "exitfail.h"; they're no longer needed.
2319 * openat-die.c (openat_save_die, openat_restore_die): New file.
2320 * openat.h (openat_save_die, openat_restore_die): Declare and define.
2322 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2323 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2324 int utc, int nanoseconds);
2326 date should not have to allocate a megabyte of virtual memory to
2327 handle a format argument like +%1048575T. When implemented with
2328 strftime, it must allocate such a buffer, use strftime to fill it
2329 in, print it, then free it.
2330 With fprintftime, it simply prints everything and exits.
2331 With no need for memory allocation, that's one fewer way to fail.
2332 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2333 optional field width, not before, so we accept %9:z, not %:9z.
2334 (my_strftime): Be sure to use L_('x') for literals.
2336 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2337 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2338 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2339 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2340 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2341 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2342 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2343 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2344 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2346 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2347 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2348 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2349 and don't include <sys/file.h>).
2351 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
2353 Sync from coreutils.
2355 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2356 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2357 [!LDAV_DONE]: Avoid unused variable warning.
2359 2005-09-21 Bruno Haible <bruno@clisp.org>
2361 * unicodeio.h (unicode_to_mb): New declaration.
2363 2005-09-20 Derek Price <derek@ximbiot.com>
2365 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2367 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2369 Use a consistent style for including <config.h>.
2370 * __fpending.c, acl.c, argmatch.c,
2371 argp-help.c, argp-parse.c,
2372 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2373 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2374 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2375 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2376 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2377 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2378 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2379 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2380 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2381 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2382 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2383 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2384 modechange.c, mountlist.c, open-safer.c, physmem.c,
2385 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2386 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2387 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2388 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2389 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2390 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2391 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2392 userspec.c, utimecmp.c, version-etc-fsf.c,
2393 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2394 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2395 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2396 Standardize inclusion of config.h.
2397 * __fpending.h, dirfd.h, getdate.h, human.h,
2398 inttostr.h: Removed inclusion of config.h from header files.
2399 * inttostr.c: Adjusted in-tree users.
2400 * timespec.h: Remove superfluous warning to include config.h.
2401 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2402 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2403 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2404 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2406 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
2408 * stat-time.h: New file.
2409 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2410 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
2412 (timespec_cmp): New function.
2413 * utimecmp.c: Include stat-time.h.
2414 (SYSCALL_RESOLUTION): Depend on whether various struct stat
2415 members exist, not on the obsolescent ST_MTIM_NSEC.
2416 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2418 2005-09-15 Derek Price <derek@ximbiot.com>
2419 Paul Eggert <eggert@cs.ucla.edu>
2421 * regcomp.c, regexec.c, regex_internal.c: Back out previous
2422 changes, consolidating in...
2423 * regex_internal.h: ...this file.
2425 2005-09-15 Derek Price <derek@ximbiot.com>
2427 * regex_internal.h: Blank `pure' for GNUC < 3.
2428 * regex_internal.c: Ditto, using this...
2429 (__GNUC_PREREQ): ...new macro.
2430 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2431 (__GNUC_PREREQ): ...this new macro.
2433 * strstr.h: Include string.h. Define strstr as a macro here.
2435 2005-09-13 Derek Price <derek@ximbiot.com>
2437 * canon-host.c (canon_host_r): Set *cherror on memory allocation
2439 Reported by Jim Meyering <jim@meyering.net>.
2441 2005-09-13 Jim Meyering <jim@meyering.net>
2443 * canon-host.c: Filter through gnu indent and reword comments slightly.
2444 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2446 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2448 * lib/base64.c: Typo.
2449 (base64_encode): Put b64str in initialized data section.
2451 2005-09-12 Derek Price <derek@ximbiot.com>
2453 Return usable errors from canon-host.
2454 * canon-host.h: New file.
2455 * canon-host.c (canon_host): Wrap...
2456 (canon_host_r): ...this new function, which now relies exclusively on
2458 (ch_strerror): New function.
2459 (last_cherror): New global.
2460 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2461 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
2463 (freeaddrinfo): Free ai->ai_canonname when set.
2465 2005-09-12 Derek Price <derek@ximbiot.com>
2466 Paul Eggert <eggert@cs.ucla.edu>
2468 * glob-libc.h: Renamed from glob_.h. The new version is
2469 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2470 protecting things that should be done only in gnulib contexts.
2471 * glob_.h: New file, containing only the glob things needed for
2473 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
2474 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2475 (glob, globfree, glob_pattern_p): Now defined simply in terms of
2476 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2477 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2478 and to respect the namespace rules better.
2480 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
2482 Merge glibc and coreutils changes into gnulib, plus a few
2484 * md5.c: Use #error rather than a string.
2485 (CYCLIC): New macro, from glibc source. Use it instead of rol.
2486 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2487 (__attribute__): Define to empty for non recent-GCC.
2488 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2489 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2490 Renamed from their non-__ counterparts, with new macros replacing
2491 them if not _LIBC. Add __THROW attribute.
2493 (struct md5_ctx): Align buffer if using GCC.
2494 * sha1.h (struct sha1_ctx): Likewise.
2495 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
2496 The old name was backwards.
2497 (NOTSWAP): Remove; not used.
2498 (rol): New macro, moved here from md5.h.
2499 (sha1_process_block): Remove a FIXME that doesn't make sense.
2501 2005-09-12 Derek Price <derek@ximbiot.com>
2503 * gai_strerror.c: Include config.h when available. Include
2504 getaddrinfo.h before other headers to test interface.
2505 Reported by Larry Jones <lawrence.jones@ugs.com>.
2507 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
2509 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2510 definitions, since that's the preferred style in glibc.
2511 Fix a minor spacing issue, and update copyright notice to match glibc's.
2513 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
2515 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2517 2005-09-06 Simon Josefsson <jas@extundo.com>
2519 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2520 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
2522 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
2524 Change bitset word type from unsigned int to unsigned long int,
2525 as this has better performance on typical 64-bit hosts.
2526 Port bitset code to hosts with unusual word sizes.
2527 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2528 (build_collating_symbol):
2529 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2530 argument is a bitset. This is merely a style issue, but it makes
2531 it clearer that an entire array is expected.
2532 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2533 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2534 Port to the case where bitset_word is not the same as unsigned int.
2535 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2536 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2538 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2539 (build_trtable, group_nodes_into_DFAstates):
2541 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2542 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2543 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2544 * regexec.c (group_nodes_into_DFAstates): Likewise.
2545 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2546 * regcomp.c (optimize_subexps, lower_subexp):
2547 Work even if bitset_word has holes in its bitwise representation.
2548 * regex_internal.h (BITSET_WORD_BITS): Likewise.
2549 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2551 * regex_internal.c (re_string_reconstruct):
2552 Don't assume UCHAR_MAX == 255.
2553 * regex_internal.h (bitset_set_all): Likewise.
2554 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2556 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
2557 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2559 (BITSET_WORD_MAX): New macro.
2560 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2561 (bitset_set_all, bitset_copy): Now inline functions, not macros.
2562 (bitset_empty, bitset_copy):
2563 Prefer sizeof (bitset) to multiplying it out ourselves.
2564 (bitset_not_merge): Remove; unused.
2565 (bitset_contain): Return bool, not unsigned int with one bit on.
2566 All callers changed.
2567 * regexec.c (build_trtable): Don't assume bitset has no stricter
2568 alignment than re_node_set; do this by defining a new internal
2569 type struct dests_alloc and using it to allocate memory.
2571 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
2573 Check for arithmetic overflow when calculating sizes, to prevent
2574 some buffer-overflow issues. These patches are conservative, in the
2575 sense that when I couldn't determine whether an overflow was possible,
2576 I inserted a run-time check.
2577 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2578 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2579 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2580 (re_xnrealloc, re_x2nrealloc): New inline functions.
2581 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2582 (build_equiv_class, build_charclass): Check for arithmetic overflow
2583 in size expression calculations.
2584 * lib/regex_internal.c (re_string_realloc_buffers):
2585 (build_wcs_upper_buffer, re_node_set_add_intersect):
2586 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2587 (re_dfa_add_node, register_state): Likewise.
2588 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2589 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2590 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2591 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2593 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
2595 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2596 to avoid a collision with bits/local_lim.h in glibc.
2597 All uses changed. Problem reported by Dmitry V. Levin in
2598 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2600 * regex_internal.c (build_wcs_upper_buffer): Fix portability
2601 bugs in int versus size_t comparisons.
2602 (re_string_context_at): Fix bug where the code assumed that
2605 Use bool where appropriate.
2606 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2607 All callers changed.
2608 (calc_eclosure_iter): Likewise, for ROOT arg.
2609 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2610 (build_charclass_op): Likewise, for NON_MATCH arg.
2611 * regex_internal.c (re_string_allocate, re_string_construct):
2612 (re_string_construct_common): Likewise, for ICASE arg.
2613 * regexec.c (re_search_2_stub, re_search_stub):
2614 Likewise, for RET_LEN arg.
2615 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2616 (set_regs): Likewise, for FL_BACKTRACK arg.
2617 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2618 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2619 (calc_eclosure_iter, parse_bracket_exp):
2620 Use bool for internal variables that are booleans.
2621 * regexec.c (re_search_internal, check_matching, proceed_next_node):
2622 (set_regs, build_sifted_states, sift_states_bkref):
2623 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2624 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2625 (find_collation_sequence_value):
2627 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2628 (re_node_set_compare):
2629 Return bool, not int. All callers changed.
2630 * regexec.c (check_halt_node_context, check_dst_limits):
2631 (build_trtable, check_node_accept): Likewise.
2632 * regex_internal.h: Include stdbool.h.
2634 Fix bugs uncovered when converting to bool.
2635 * regcomp.c (calc_eclosure_iter): Check for storage allocation
2636 failure instead of charging ahead blindly.
2637 * regex_internal.c (register_state): Likewise.
2638 * regexec.c (re_search_2_stub): Use simpler method than boolean
2639 for freeing internal storage.
2640 (group_nodes_into_DFA_states): Use unsigned int, not int, for
2641 bitset pieces used as boolean, to avoid undefined behavior
2642 on hosts that do int overflow checking.
2644 2005-08-31 Derek Price <derek@ximbiot.com>
2646 * getdelim.c (getdelim): Return EOF on EOF.
2647 Reported by Larry Jones <lawrence.jones@ugs.com>.
2649 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2651 * regex_internal.c (re_string_reconstruct): Don't assume buffer
2652 lengths fit in regoff_t; this isn't true if regoff_t is the same
2654 * regex.c (re_search_internal): 5th arg is LAST_START
2655 (= START + RANGE) instead of RANGE. This avoids overflow
2656 problems when regoff_t is the same width as size_t.
2657 All callers changed.
2658 (re_search_2_stub): Check for overflow when adding the
2659 sizes of the two strings.
2660 (re_search_stub): Check for overflow when adding START
2661 to RANGE; if it occurs, substitute the extreme value.
2663 2005-08-31 Jim Meyering <jim@meyering.net>
2665 * regcomp.c (search_duplicated_node): Make first pointer arg
2667 * regex_internal.c (create_ci_newstate, create_cd_newstate):
2668 (register_state): Likewise.
2669 * regexec.c (search_cur_bkref_entry, check_dst_limits):
2670 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2671 (group_nodes_into_DFAstates): Likewise.
2673 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2675 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2676 old glibc regex code mishandles strings longer than 2**31 bytes.
2677 This patch fixes this when the regex code is used in gnulib
2678 (i.e., outside glibc).
2680 This patch should not affect the use of the regex code inside
2681 glibc. No doubt this problem also needs to be handled for glibc
2682 as well, but the result will be an incompatible change to the
2683 glibc ABI, and the old ABI will have to be supported too. That
2684 can be the the subject for another patch.
2686 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2687 governing whether the rest of this patch is active. By default,
2688 the macro is disabled and the patch has no effect.
2689 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2690 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2691 (struct re_pattern_buffer, re_search, re_search_2, re_match):
2692 (re_match_2, re_set_registers): Use the new types.
2693 * regex_internal.h (Idx, re_hashval_t): New types.
2694 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2696 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2697 (re_string_context_at, bin_tree_t, re_dfastate_t):
2698 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2699 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2700 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2701 (re_string_char_size_at, re_string_wchar_at):
2702 (re_string_elem_size_at):
2703 Use the new types and macros to port to 64-bit hosts.
2704 Use unsigned types for internal values, so that the code
2705 mostly works even for arrays larger than SSIZE_MAX.
2706 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2707 (search_duplicated_node, calc_eclosure_iter, fetch_number):
2708 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2709 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2710 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2711 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2712 (calc_inveclosure, parse_dup_op, build_range_exp):
2713 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2714 (fetch_number, create_token_tree, mark_opt_subexp):
2716 * regex_internal.c (re_string_construct_common, create_ci_newstate):
2717 (create_cd_newstate, re_string_allocate, re_string_construct):
2718 (re_string_realloc_buffers, build_wcs_upper_buffer):
2719 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2720 (re_string_reconstruct, re_string_peek_byte_case):
2721 (re_string_fetch_byte_case, re_string_context_at):
2722 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2723 (re_node_set_init_copy, re_node_set_add_intersect):
2724 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2725 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2726 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2727 (re_acquire_state, re_acquire_state_context, register_state):
2729 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2730 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2731 (re_search_internal, re_search_2_stub, re_search_stub)
2732 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2733 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2734 (update_cur_sifted_state, check_dst_limits):
2735 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2736 (check_subexp_limits, sift_states_bkref, merge_state_array):
2737 (check_subexp_matching_top, get_subexp, get_subexp_sub):
2738 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2739 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2740 (expand_bkref_cache, check_node_accept_bytes):
2741 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2742 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2743 (acquire_init_state_context, check_halt_node_context):
2744 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2745 (sift_states_backward, clean_state_log_if_needed):
2746 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2747 (find_recover_state, transit_state_sb, transit_state_mb):
2748 (transit_state_bkref, build_trtable, match_ctx_clean):
2750 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2751 to work around an assumption that REG_MISSING is negative.
2753 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2754 (seek_collating_symbol_entry) [defined _LIBC]:
2755 (lookup_collation_sequence_value) [defined _LIBC]:
2756 (build_range_exp, build_collating_symbol) [defined _LIBC]:
2757 Use prototypes rather than old-style function definitions.
2758 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2759 (transit_state_sb) [0]:
2760 (find_collation_sequence_value) [defined _LIBC]: Likewise.
2762 * regexec.c (re_search_internal): Simplify update of rm_so and
2765 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2766 (optimize_subexps, lower_subexp):
2767 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2768 since the signed shift might overflow. Use 1u<<31 instead.
2769 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2770 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2773 * regcomp.c (optimize_subexps, lower_subexp):
2774 Use CHAR_BIT rather than 8, for clarity.
2775 * regexec.c (check_dst_limits_calc_pos_1):
2776 (check_subexp_matching_top): Likewise.
2777 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2778 have to worry about portability issues when shifting it left.
2779 Remove no-longer-needed test for table_size > 0.
2780 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2781 in a word, as the resulting behavior is undefined.
2782 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2783 in one case, a <= should have been an <, and in another case the
2784 whole test was missing.
2785 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
2786 the standard name CHAR_BIT.
2787 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2788 this is not true on one's complement and signed-magnitude hosts.
2790 * regex_internal.h (re_sub_match_top_t): Remove unused member
2792 (struct re_dfa_t): Remove unused member states_alloc.
2793 * regcomp.c (init_dfa): Don't initialize unused members.
2795 2005-08-31 Bruno Haible <bruno@clisp.org>
2797 * strstr.c: Include <stddef.h>, for NULL.
2798 * strcasestr.c: Likewise.
2799 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2801 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
2803 * iconvme.h: Add prototype for iconv_alloc.
2805 2005-08-29 Simon Josefsson <jas@extundo.com>
2807 * iconvme.c: Fix errno.
2809 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
2811 * iconvme.c: Split iconv_string into iconv_alloc.
2813 2005-08-27 Jim Meyering <jim@meyering.net>
2815 * fopen-safer.c: Merge minor changes from coreutils.
2816 * dup-safer.c: Likewise.
2817 * fd-safer.c: Likewise.
2819 Merge from coreutils.
2820 * stdio--.h: New file.
2821 * stdlib--.h: New file.
2822 * mkstemp-safer.c: New file.
2824 GNU tar needs these.
2825 * pipe-safer.c: New file.
2826 * creat-safer.c: New file.
2827 * fcntl--.h (creat): Define to creat_safer.
2828 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
2829 * unistd--.h (pipe): Define to pipe_safer.
2830 * unistd-safer.h: Declare pipe_safer.
2832 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
2834 * regex_internal.h: Remove all references to
2835 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
2837 (bitset_not, bitset_merge, bitset_not_merge):
2838 (bitset_mask, re_string_allocate, re_string_construct):
2839 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
2840 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
2841 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
2842 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
2843 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2844 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2845 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
2846 (re_acquire_state_context):
2847 Remove unnecessary forward decls.
2848 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
2849 Put __attribute at function definition,
2850 now that the function decl has been removed.
2851 * lib/regex_internal.c (re_string_peek_byte_case):
2852 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
2855 2005-08-26 Simon Josefsson <jas@extundo.com>
2857 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
2858 Haible <bruno@clisp.org>.
2860 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
2862 * regexec.c (set_regs): Don't alloca with an unbounded size.
2864 alloca modernization/simplification for regex.
2865 * regex.c: Remove portability cruft for alloca. This no longer
2866 needs to be at the start of the file, and can be moved into
2867 regex_internal.h and simplified.
2868 * regex_internal.h: Include <alloca.h>.
2869 (__libc_use_alloca) [!defined _LIBC]: New macro.
2870 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
2871 now works outside glibc.
2873 2005-08-24 Simon Josefsson <jas@extundo.com>
2875 * getpass.c: Add WIN32 implementation. Conditionalize use of
2876 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
2877 GLIBC specific code.
2879 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
2881 Make regex safe for g++. This fixes one real bug (an "err"
2882 that should have been "*err"). g++ problem reported by
2884 * regex_internal.h (re_calloc): New macro, consistent with
2885 re_malloc etc. All callers of calloc changed to use re_calloc.
2886 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
2887 not int. All callers changed.
2888 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
2889 just use an array of size MB_LEN_MAX.
2890 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
2891 (find_recover_state): Change "err" to "*err"; this fixes what
2892 appears to be a real bug.
2893 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
2896 2005-08-25 Jim Meyering <jim@meyering.net>
2898 * open-safer.c: Include <config.h>.
2899 Otherwise, we'd lose LARGEFILE support in any file using
2902 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
2904 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
2905 * regex.h (regerror): Likewise.
2907 * regex.c: Do not include <sys/types.h>, as POSIX no longer
2908 requires this. (The code never needed it.)
2910 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2911 All uses of recently-renamed identifiers changed to use the new,
2912 POSIX-compliant names. The code will build and run just fine
2913 without these changes, but it's better to eat our own dog food
2914 and use the standard-conforming names.
2916 * regex.h: Fix a multitude of POSIX name space violations.
2917 These changes have an effect only for programs that define
2918 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
2919 do not change anything for programs compiled in the normal way.
2920 Also, there is no effect on the ABI.
2922 (_REGEX_SOURCE): New macro.
2923 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
2924 defined and _GNU_SOURCE is not; this fixes a name space violation.
2926 Rename the following macros to obey POSIX requirements.
2927 The old names are still visible as macros if _REGEX_SOURCE is defined.
2928 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
2929 RE_BACKSLASH_ESCAPE_IN_LISTS.
2930 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
2931 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
2932 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
2933 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
2934 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
2935 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
2936 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
2937 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
2938 (REG_INTERVALS): renamed from RE_INTERVALS.
2939 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
2940 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
2941 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
2942 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
2943 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
2944 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
2945 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
2946 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
2947 RE_UNMATCHED_RIGHT_PAREN_ORD.
2948 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
2949 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
2950 (REG_DEBUG): renamed from RE_DEBUG.
2951 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
2952 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
2953 unusual, since we can't clash with the POSIX REG_ICASE.
2954 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
2955 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
2956 (REG_NO_SUB): renamed from RE_NO_SUB.
2957 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
2958 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
2959 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
2960 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
2961 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
2962 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
2963 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
2964 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
2965 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
2966 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
2967 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
2968 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
2969 RE_SYNTAX_POSIX_MINIMAL_BASIC.
2970 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
2971 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
2972 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2973 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
2974 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
2975 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
2976 (REG_FIXED): Renamed from REGS_FIXED.
2977 (REG_NREGS): Renamed from RE_NREGS.
2979 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
2980 of other REG_* macros, since POSIX says the user is allowed to
2981 #undef these macros selectively.
2983 (reg_errcode_t): Update comment stating what other tables need
2986 Rename the following enum values to obey POSIX requirements.
2987 The old names are still visible as macros.
2988 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
2989 is not defined, since GNU is supposed to be a superset of POSIX as
2990 much as possible, and since we want reg_errcode_t to be a signed
2991 type for implementation consistency.
2992 (_REG_NOERROR): Renamed from REG_NOERROR.
2993 (_REG_NOMATCH): Renamed from REG_NOMATCH.
2994 (_REG_BADPAT): Renamed from REG_BADPAT.
2995 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
2996 (_REG_ECTYPE): Renamed from REG_ECTYPE.
2997 (_REG_EESCAPE): Renamed from REG_EESCAPE.
2998 (_REG_ESUBREG): Renamed from REG_ESUBREG.
2999 (_REG_EBRACK): Renamed from REG_EBRACK.
3000 (_REG_EPAREN): Renamed from REG_EPAREN.
3001 (_REG_EBRACE): Renamed from REG_EBRACE.
3002 (_REG_BADBR): Renamed from REG_BADBR.
3003 (_REG_ERANGE): Renamed from REG_ERANGE.
3004 (_REG_ESPACE): Renamed from REG_ESPACE.
3005 (_REG_BADRPT): Renamed from REG_BADRPT.
3006 (_REG_EEND): Renamed from REG_EEND.
3007 (_REG_ESIZE): Renamed from REG_ESIZE.
3008 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3009 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3010 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3011 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3012 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3014 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3015 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3016 changed. But support the old name if the new one is not defined
3017 and if _REGEX_SOURCE.
3019 Change the following member names in struct re_pattern_buffer.
3020 The old names are still supported if !_REGEX_SOURCE.
3021 The new names are always supported, regardless of _REGEX_SOURCE.
3022 (re_buffer): Renamed from buffer.
3023 (re_allocated): Renamed from allocated.
3024 (re_used): Renamed from used.
3025 (re_syntax): Renamed from syntax.
3026 (re_fastmap): Renamed from fastmap.
3027 (re_translate): Renamed from translate.
3028 (re_can_be_null): Renamed from can_be_null.
3029 (re_regs_allocated): Renamed from regs_allocated.
3030 (re_fastmap_accurate): Renamed from fastmap_accurate.
3031 (re_no_sub): Renamed from no_sub.
3032 (re_not_bol): Renamed from not_bol.
3033 (re_not_eol): Renamed from not_eol.
3034 (re_newline_anchor): Renamed from newline_anchor.
3036 Change the following member names in struct re_registers.
3037 The old names are still supported if !_REGEX_SOURCE.
3038 The new names are always supported, regardless of _REGEX_SOURCE.
3039 (rm_num_regs): Renamed from num_regs.
3040 (rm_start): Renamed from start.
3041 (rm_end): Renamed from end.
3043 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3044 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3045 Prepend __ to parameter names.
3047 Undo yesterday's changes.
3049 2005-08-24 Jim Meyering <jim@meyering.net>
3051 Sync from coreutils.
3052 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3054 2005-08-21 Bruno Haible <bruno@clisp.org>
3056 * lock.h: Add multiple inclusion guard.
3057 * tls.h: Add multiple inclusion guard.
3059 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3061 * regex.h (REG_NOSYS)
3062 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3063 Define, since POSIX requires it as of 2001.
3064 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3065 New private symbol, used to keep the enum signed in all cases.
3066 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3067 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3069 * regex_internal.c (re_string_skip_chars, register_state):
3071 Remove forward decls; no longer needed now that we use prototypes.
3072 * regexec.c (acquire_init_state_context, check_halt_node_context):
3073 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3074 (clean_state_log_if_needed): Likewise.
3076 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3078 Fix problems reported by Sam Steingold in
3079 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3080 * regexec.c (sift_states_bkref): Fix portability bug: the code
3081 assumed that reg_errcode_t is a signed type, which is not
3082 necessarily true if _XOPEN_SOURCE is not defined.
3083 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3084 some compilers warn about it otherwise.
3086 2005-08-20 Jim Meyering <jim@meyering.net>
3088 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3089 of unused local, dfa.
3091 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3093 * regcomp.c (create_initial_state): Remove duplicate decl.
3094 (init_word_char, create_initial_state, duplicate_node_closure):
3095 (fetch_token, peek_token_bracket, build_range_exp):
3096 (build_collating_symbol): Remove forward decls; no longer needed
3097 now that we use prototypes.
3100 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3101 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3102 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3103 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3104 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3105 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3106 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3107 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3108 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3109 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3110 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3111 (build_charclass, build_charclass_op, fetch_number, create_tree):
3112 (create_token_tree, mark_opt_subexp, duplicate_tree):
3113 Use prototypes rather than old-style definitions.
3116 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3117 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3118 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3119 (re_string_reconstruct, re_string_peek_byte_case):
3120 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3121 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3122 (re_node_set_init_copy, re_node_set_add_intersect):
3123 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3124 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3125 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3126 (re_acquire_state, re_acquire_state_context, register_state):
3127 (create_ci_newstate, create_cd_newstate, free_state):
3129 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3130 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3131 (re_search_internal, prune_impossible_nodes):
3132 (acquire_init_state_context, check_matching, static):
3133 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3134 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3135 (update_regs, sift_states_backward, build_sifted_states):
3136 (clean_state_log_if_needed, merge_state_array):
3137 (update_cur_sifted_state, add_epsilon_src_nodes):
3138 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3139 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3140 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3141 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3142 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3143 (check_arrival, check_arrival_add_next_nodes):
3144 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3145 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3146 (check_node_accept_bytes, check_node_accept, extend_buffers):
3147 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3148 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3153 (re_string_allocate, re_string_construct, re_string_reconstruct):
3154 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3155 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3156 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3157 (re_string_context_at, re_string_peek_byte_case):
3158 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3159 is defined, since we now use prototypes always.
3161 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3162 C89 or better. All uses removed.
3164 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3166 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3167 [defined lint]: Suppress bogus uninitialized-variable warnings.
3169 * regcomp.c (duplicate_node): Return new index, not an error code,
3170 and let the caller return REG_ESPACE if out of space. This
3171 removes an uninitialied-variable warning with GCC 4.0.1, and also
3172 avoids taking the address of a local variable. All callers
3175 2005-08-19 Jim Meyering <jim@meyering.net>
3177 * regexec.c (proceed_next_node): Redo local variables to
3178 avoid GCC shadowing warnings.
3180 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3182 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3183 (re_node_set_insert_last, re_dfa_add_node):
3184 Rename local variables to avoid GCC shadowing warnings.
3186 2005-08-18 Bruno Haible <bruno@clisp.org>
3188 * strstr.c (strstr): Fix return value in multibyte case.
3189 * strcasestr.c (strcasestr): Likewise.
3191 2005-08-17 Jim Meyering <jim@meyering.net>
3193 Make the %s format (seconds since the epoch) work for a negative
3194 number and when used with a zero-padded field width, e.g. %015s.
3196 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3197 label so that it precedes the code to set `digits'. Otherwise,
3198 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
3199 print `00-22'. Now, it prints `-0022', as it should.
3201 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
3203 * regex.h: Remove useless space-before-tab. From coreutils.
3205 2005-08-17 Bruno Haible <bruno@clisp.org>
3207 * strcasestr.h: New file.
3208 * strcasestr.c: New file.
3210 2005-08-17 Bruno Haible <bruno@clisp.org>
3212 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3213 * strstr.c: Completely rewritten, with multibyte locale support.
3215 2005-08-17 Bruno Haible <bruno@clisp.org>
3217 * strcasecmp.c: Use mbuiter.h.
3219 2005-08-17 Bruno Haible <bruno@clisp.org>
3221 * mbuiter.h: New file.
3223 2005-08-16 Bruno Haible <bruno@clisp.org>
3225 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3227 (mbi_avail, mbi_advance): Let the iteration end before the terminating
3228 NUL byte, not after it.
3230 2005-08-16 Bruno Haible <bruno@clisp.org>
3232 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3233 the valid ones. Makes the comparison operations transitive:
3234 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3235 * strcasecmp.c (strcasecmp): Use mb_casecmp.
3237 2005-08-16 Bruno Haible <bruno@clisp.org>
3239 * strcase.h (strcasecmp): Add note in comments.
3240 * strncasecmp.c: Use code from strcasecmp.c.
3241 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3242 (strcasecmp): Work correctly in multibyte locales.
3244 2005-08-16 Bruno Haible <bruno@clisp.org>
3246 * strnlen1.h: New file.
3247 * strnlen1.c: New file.
3249 2005-08-16 Bruno Haible <bruno@clisp.org>
3251 * mbfile.h: New file.
3253 2005-08-16 Bruno Haible <bruno@clisp.org>
3255 * mbiter.h: New file.
3257 2005-08-16 Bruno Haible <bruno@clisp.org>
3259 * mbchar.h: New file.
3260 * mbchar.c: New file.
3262 2005-08-16 Bruno Haible <bruno@clisp.org>
3264 * tls.h: New file, from GNU gettext.
3265 * tls.c: New file, from GNU gettext.
3267 2005-08-15 Bruno Haible <bruno@clisp.org>
3269 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3272 2005-08-14 Jim Meyering <jim@meyering.net>
3274 Sync from coreutils.
3276 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3277 Use the hash-table-based cycle-detection code not just when
3278 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3279 Reported by James Youngman in
3280 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3281 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3282 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3283 This lets us compile with -DFTS_DEBUG, once again.
3284 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3285 * fts.c (fd_safer): Remove decl.
3286 Include fcntl--.h rather than unistd-safer.h
3287 (fts_safe_changedir): Don't call fd_safer; no longer needed
3288 now that we include fcntl--.h.
3290 2005-08-11 Simon Josefsson <jas@extundo.com>
3292 * readline.h, readline.c: New file.
3294 2005-08-11 Bruno Haible <bruno@clisp.org>
3296 * strnlen.h (strnlen): Change parameter name to match comment.
3298 2005-08-10 Simon Josefsson <jas@extundo.com>
3300 * strndup.c: Use strnlen.h.
3302 * strnlen.h: New file.
3304 2005-08-02 Simon Josefsson <jas@extundo.com>
3306 * getline.h, getline.c: Rewrite.
3308 * getdelim.h, getdelim.c: New files, ported from glibc.
3310 2005-07-31 Bruno Haible <bruno@clisp.org>
3312 * lock.h (gl_lock_initializer): New macro.
3313 (gl_lock_define_initialized): Use it.
3314 (gl_rwlock_initializer): New macro.
3315 (gl_rwlock_define_initialized): Use it.
3316 (gl_recursive_lock_initializer): New macro.
3317 (gl_recursive_lock_define_initialized): Use it.
3319 2005-07-26 Bruno Haible <bruno@clisp.org>
3321 * lock.h: Update from GNU gettext.
3322 * lock.c: Update from GNU gettext.
3324 2005-07-18 Bruno Haible <bruno@clisp.org>
3326 * lock.h (gl_once_t): New type.
3327 (gl_once_define, gl_once): New macros.
3328 * lock.c (fresh_once): New variable.
3329 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3332 2005-07-18 Simon Josefsson <jas@extundo.com>
3334 * check-version.c (check_version): Accept identical versions too.
3336 2005-07-18 Bruno Haible <bruno@clisp.org>
3338 * lock.h: New file, from GNU gettext.
3339 * lock.c: New file, from GNU gettext.
3341 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
3343 * quotearg.c: Add translator comment suggested by Bruno Haible,
3344 with a minor change.
3346 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3348 * version-etc-fsf.c (version_etc_copyright): Parameterize the
3349 copyright symbol and the year.
3350 * version-etc.c (COPYRIGHT_YEAR): New constant.
3351 (version_etc_va): Use parameterized copyright notice.
3352 Reword to conform to the current GNU coding standards.
3354 2005-07-11 Simon Josefsson <jas@extundo.com>
3356 * size_max.h: New file.
3358 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
3360 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3363 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
3364 and Paul Eggert <eggert@cs.ucla.edu>
3366 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3367 in wint_t, not wchar_t. Remove now-unnecessary cast.
3369 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3371 * regex.c, regex.h: Sync from libc.
3372 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3373 New files, synced from libc, except that regex_internal.h
3374 currently has a small porting fix.
3376 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
3378 Remove the dependency of the strftime module on the tzset module.
3379 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3380 Copy the input structure, to work around some of the bug with
3381 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
3382 Solaris releases, you should also use the tzset module, but we won't
3383 require it as a dependency any more since we don't want LGPLed code
3384 to depend on GPLed code.
3386 2005-07-02 Jim Meyering <jim@meyering.net>
3388 * backupfile.c (backup_args): Change a `0' to NULL.
3390 2005-07-01 Jim Meyering <jim@meyering.net>
3392 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3393 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3394 * save-cwd.c, tempname.c:
3395 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3396 and don't include <sys/file.h>).
3398 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
3400 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3401 declares only 'struct timespec;' (!).
3403 2005-06-29 Jim Meyering <jim@meyering.net>
3405 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3406 type name. Use the variable name instead.
3407 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3409 2005-06-28 Simon Josefsson <jas@extundo.com>
3411 * check-version.h, check-version.c: New files.
3413 2005-06-28 Simon Josefsson <jas@extundo.com>
3415 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
3416 collision with global variable. Better indentation. Don't
3417 increment buffer pointer beyond buffer end. Based on comments
3418 from Paul Eggert <eggert@cs.ucla.edu>.
3422 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
3424 * canon-host.c (canon-host): Append trailing "," to 0 in
3425 initializer of struct addrinfo, as an indication that we don't
3426 care how many members the structure has.
3428 2005-06-24 Derek Price <derek@ximbiot.com>
3429 and Bruno Haible <bruno@clisp.org>
3431 Remove stat module & update lstat.
3432 * stat.c: Remove this file...
3433 (slash_aware_lstat): ...moving this content and its support...
3434 * lstat.c (rpl_lstat): ...into here.
3435 * lstat.h: New file.
3437 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
3439 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
3440 (ranged_convert): Don't save conversion in a temporary struct.
3441 This causes a warning with GCC 4.0.0, and anyway in the typical
3442 case it's not worth the extra 100 bytes or so of code.
3443 (ranged_convert, __mktime_internal): When calling a function via a
3444 pointer P, use P () rather than (*P) (), as we now assume C89 or
3447 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
3449 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3450 "who -r" failed to give output. Problem reported by Tim Waugh.
3452 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3453 (xcalloc): Use it to avoid needless tests.
3454 Problem reported by Jim Meyering.
3456 2005-06-16 Jim Meyering <jim@meyering.net>
3458 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3459 when either N or S is zero.
3461 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3463 * argp.h (__option_is_short): Check upper limit of
3464 __key. Isprint() requires its argument to have the value
3465 of an unsigned char or EOF.
3467 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
3469 * fnmatch.c (fnmatch): If there is an encoding error in a
3470 multibyte string or pattern, fall back on unibyte matching.
3471 Problem reported by James Youngman.
3473 2005-06-08 Bruno Haible <bruno@clisp.org>
3475 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3478 2005-06-08 Bruno Haible <bruno@clisp.org>
3480 * csharpcomp.h: New file, from GNU gettext.
3481 * csharpcomp.c: New file, from GNU gettext.
3482 * csharpcomp.sh.in: New file, from GNU gettext.
3484 2005-06-07 Derek Price <derek@ximbiot.com>
3487 * glob_.h: Indent nested #ifdef.
3489 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
3491 Sync from coreutils.
3492 Use "file name" when talking about file names, instead of "filename"
3493 or "path", as per the GNU coding standards.
3494 * mkdir-p.c: Renamed from makepath.c.
3495 (make_dir_parents): Renamed from make_path. All callers changed.
3496 * mkdir-p.h: Likewise. All includers changed.
3497 * filenamecat.c: Renamed from path-concat.c.
3498 (file_name_concat): Renamed from path_concat. All callers changed.
3499 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3500 * filenamecat.h: Likewise. All includers changed.
3501 * acl.c: Don't use "path" or "filename" to mean "file name"
3502 in comments or local variable names.
3503 * basename.c: Likewise.
3504 * canonicalize.c, canonicalize.h: Likewise.
3505 * dirname.c, dirname.h: Likewise.
3506 * euidaccess.c: Likewise.
3507 * exclude.c: Likewise
3508 * fnmatch_.h, fnmatch_loop.c: Likewise.
3509 * fsusage.c, fsuage.h: Likewise.
3510 * fts.c, fts_.h: Likewise.
3511 * getcwd.c: Likewise.
3512 * getloadavg.c: Likewise.
3513 * mkstemp.c: Likewise.
3514 * mountlist.c, mountlist.h: Likewise.
3515 * openat.c, openat.h: Likewise.
3516 * readlink-stub.c: Likewise.
3517 * readutmp.c, readutmp.h: Likewise.
3518 * rename.c: Likewise.
3519 * rmdir.c: Likewise.
3521 * savedir.c: Likewise.
3522 * stripslash.c: Likewise.
3523 * tempname.c: Likewise.
3524 * xreadlink.c: Likewise.
3525 * exclude.c (excluded_file_name): Renamed from excluded_filename.
3527 * exclude.h: Likewise.
3529 * euidaccess.c (getuid, getgid, getuid, getegid)
3530 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3531 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3532 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3533 * pathmax.h: Include <limits.h> unconditionally, since other
3534 files have been getting away with it for years (MORE/BSD 4.3
3536 * userspec.c (getpwnam, getgrnam, getgrgid)
3537 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3539 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3540 Define to 256, not 255, as per modern POSIX.
3542 2005-06-01 Bruno Haible <bruno@clisp.org>
3544 * csharpexec.h: New file, from GNU gettext.
3545 * csharpexec.c: New file, from GNU gettext.
3546 * csharpexec.sh.in: New file, from GNU gettext.
3548 2005-05-31 Derek Price <derek@ximbiot.com>
3549 Paul Eggert <eggert@cs.ucla.edu>
3552 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3554 2005-05-29 Derek Price <derek@ximbiot.com>
3555 Paul Eggert <eggert@cs.ucla.edu>
3557 * glob_.h, glob.c: New files.
3559 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
3561 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3563 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3564 the configuration hassle isn't worth it.
3565 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3566 (LONGEST_MODIFIER, PRIuMAX): Remove.
3568 2005-05-27 Bruno Haible <bruno@clisp.org>
3570 * getlogin_r.h: Remove second include of <stddef.h>.
3572 2005-05-25 Bruno Haible <bruno@clisp.org>
3573 Derek Price <derek@ximbiot.com>
3575 * getlogin_r.h: Simplify API documentation.
3577 2005-05-25 Derek Price <derek@ximbiot.com>
3578 Paul Eggert <eggert@cs.ucla.edu>
3580 * getlogin_r.c, getlogin_r.h: New files.
3582 2005-05-22 Bruno Haible <bruno@clisp.org>
3584 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3585 Also include <sys/param.h> if it defines MIN, MAX.
3586 Based on a patch by Derek Price <derek@ximbiot.com>.
3588 2005-05-22 Bruno Haible <bruno@clisp.org>
3590 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3591 (INT64_MIN): Fix definition.
3592 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3594 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3595 NEED_SIGNED_INT_TYPES.
3597 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3598 HAVE_SYSTEM_INTTYPES.
3600 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
3602 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3603 so that unistd-safer.h (GPL'ed code) need not be included.
3605 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
3608 * fts.c: Don't include "cycle-check.h" or "hash.h".
3609 (setup_dir, free_dir): New functions.
3610 (enter_dir, leave_dir): Define trivial
3611 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
3612 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
3613 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3614 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3615 Move to fts-cycle.c.
3616 (fts_open): Use setup_dir.
3617 (fts_close): Use free_dir.
3618 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3619 This adds a label and some gotos, but the alternatives were messier.
3620 Check for memory allocation failure when entering a dir.
3621 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3622 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3623 (FTS): New member fts_cycle, that is a union that contains the
3624 old active_dir_ht and cycle_state. All uses changed to mention
3625 fts_cycle.ht and fts_cycle.state.
3626 * fts-cycle.c: New file, containing GPL'ed code migrated out of
3627 fts.c, with the following changes:
3628 (setup_dir, free_dir): New functions.
3629 (enter_dir): Now returns bool. Return true if successful, false
3630 if memory exhausted. All callers changed.
3631 Do not bother partly cleaning up on
3632 memory allocation failure; that is free_dir's job.
3633 However, free ad if hash_insert fails, to avoid memory leak.
3634 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3635 fts->fts_options to see which union member to use.
3637 2005-05-20 Jim Meyering <jim@meyering.net>
3639 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3640 Now a macro, to pacify GCC.
3642 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
3644 * chown.c (rpl_chown): Return -1 on failure.
3646 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
3648 * canonicalize.c: Include canonicalize.h first, to test interface.
3649 Include <stddef.h> unconditionally, since we assume C89 now.
3650 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3651 * fts.c: Include fts_.h first, to check interface.
3652 Do not include intprops.h; no longer needed.
3653 Include cycle-check.h and hash.h, since fts_.h no longer does.
3654 Remove unnecessary casts of closedir to void.
3655 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3656 decide whether to decrement nlinks.
3657 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3658 (FTS): Use struct hash_table * instead of Hash_table, so that
3659 we no longer need to include hash.h here.
3661 2005-05-17 Jim Meyering <jim@meyering.net>
3663 * fts.c, fts_.h: New files, from coreutils.
3665 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
3667 Sync from coreutils.
3668 * unlinkdir.c, unlinkdir.h: New files.
3669 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3670 regex.h, unlocked-io.h, xtime.h:
3671 White space changes only.
3672 * makepath.c (make_path): Port to hosts where leading "//" is special.
3673 * yesno.c: Include getline.h, not ctype.h.
3674 (yesno): Don't remove leading white space; POSIX doesn't allow it.
3675 Use getline to remove arbitrary restriction on response length.
3677 2005-05-13 Bruno Haible <bruno@clisp.org>
3679 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3680 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3681 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3682 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3683 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3684 Add support for 64-bit integers in the MSVC compiler.
3686 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
3688 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3689 Change the initial comment to refer to GPL, not LGPL.
3690 gnulib-tool will change it to LGPL as needed.
3692 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3693 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3694 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3695 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3696 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3697 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3698 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3699 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3700 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3701 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3702 concatpath.c, config.charset, copy-file.c, copy-file.h,
3703 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3704 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3705 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3706 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3707 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3708 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3709 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3710 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3711 full-read.c, full-read.h, full-write.c, full-write.h,
3712 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3713 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3714 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3715 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3716 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3717 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3718 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3719 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3720 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3721 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3722 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3723 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3724 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3725 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3726 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3727 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3728 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3729 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3730 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3731 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3732 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3733 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3734 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3735 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3736 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3737 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3738 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3739 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3740 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3741 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3742 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3743 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3744 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3745 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3746 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3747 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3748 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3749 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3750 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3751 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3752 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3753 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3754 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3755 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3756 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3757 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3758 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3759 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3760 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3761 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3762 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3763 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3764 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3765 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3766 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3767 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3768 Update FSF postal mail address.
3770 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3772 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3773 specified in ai_socktype. Fix invalid ai_protocol
3774 check. ai_protocol is usually set to 0 or depending on
3775 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
3776 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
3777 ai_socktype / ai_protocol in the returned addrinfo structure.
3779 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3780 Bruno Haible <bruno@clisp.org>
3782 * inet_ntop.h: New file.
3783 * inet_ntop.c: New file, from glibc with modifications.
3785 2005-05-08 Jim Meyering <jim@meyering.net>
3787 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3789 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
3791 Merge from coreutils. Among other things,
3792 add bulletproofing for cases where stdin, stdout, or stderr are closed.
3793 * fd-safer.c: New file.
3794 * fcntl-safer.h, open-safer.c: Remove.
3795 * chdir-long.c: Fix comment "fetish" -> "coreutils".
3796 * dup-safer.c: Include unistd-safer.h first.
3797 Don't include errno.h.
3798 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3799 * file-type.h: Don't assume invoker included sys/stat.h first.
3800 * file-type.c: Rely on file-type.h change.
3801 * getloadavg.c: Include unistd-safer.h.
3802 (getloadavg): Use safer open.
3803 * getusershell.c: Include "stdio-safer.h".
3804 (getusershell): Use safer fopen.
3805 * long-options.c (long_options): Use NULL rather than 0.
3806 * modechange.h (mode_free): Remove; all callers changed to invoke
3808 * modechange.c: Likewise.
3809 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3810 (MODE_DONE): New constant.
3811 (struct mode_change): Remove 'next' member.
3812 (make_node_op_equals): New function; like the old one of the
3813 same name, except it allocates an array.
3814 (mode_compile, mode_create_from_ref): Use it.
3815 (mode_compile): Allocate result as an array, not a linked list.
3816 Parse octal string ourself, so that we catch mistakes like "+0".
3817 (mode_adjust): Arg is an array, not a linked list.
3818 * modechange.c: Include stat-macros.h, xalloc.h.
3819 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3820 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3821 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3822 Remove. This is now stat-macros.h's job.
3823 (talloc): Remove. All callers replaced by xalloc, so that
3824 our invokers don't have to worry about reporting memory failures.
3825 (make_node_op_equals): Remove.
3826 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3828 (struct mode_change): Moved here from modechange.h.
3829 (mode_append_entry): Remove.
3830 (mode_compile): Remove MASKED_OPS arg, since it encouraged
3831 apps to have incorrect behavior. Use simpler algorithm for head
3832 and tail. Don't futz with umask; that's now the job of mode_adjust.
3833 Detect more invalid usages rather than having somewhat-random behavior.
3834 Don't insert an "a=" action, as that leads to incorrect behavior.
3835 (mode_compile, mode_create_from_ref): Return NULL on error instead
3836 of an enum, since now there's only one way to have an error. All
3838 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
3839 at the correct time. Simplify calculation of "+u" and its ilk.
3840 Don't mishandle "+X".
3841 (mode_free): Remove "register" and localize decls.
3842 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3843 (struct mode_change): Move to modechange.c; callers don't
3844 need to see this stuff.
3845 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
3846 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
3847 (mode_change, mode_adjust): Reflect the new signatures noted above.
3848 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
3849 that might redefine system include files.
3850 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
3851 (my_usleep): Use NULL rather than (void *) 0.
3852 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
3853 Use siginterrupt to specify that system calls should be interrupted.
3854 (rpl_nanosleep): Move initialization of suspended closer to call of
3856 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
3857 * readutmp.c: Likewise. Include signal.h, stdbool.h.
3858 (desirable_utmp_entry): New function.
3859 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
3860 using x2nrealloc, to simplify logic.
3861 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
3862 size calculation. Do not assume utmp file is a regular file.
3863 * readutmp.h (UT_PID): Moved here from ../src/who.c.
3864 (READ_UTMP_CHECK_PIDS): New constant.
3865 * save-cwd.c: Include unistd-safer.h.
3866 (save_cwd): Use fd_safer.
3867 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
3868 [!_LIBC] Include "stat-macros.h" instead.
3869 * unistd-safer.h (fd_safer): New decl.
3871 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
3873 * byteswap_.h: New file.
3875 2005-04-25 Albert Chin <china@thewrittenword.com>
3877 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
3880 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
3882 * getdate.y (zone): Allow relunit_snumber after tZONE, so
3883 that "UTC +1 second" continues to work. Problem reported
3885 (relunit_snumber): New rule.
3888 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
3890 * getdate.y (universal_time_zone_table): New constant.
3891 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
3892 universal_time_zone_table.
3893 (lookup_zone): Prefer universal_time_zone_table to
3894 local_time_zone_table, so that "GMT" time stamps are allowed in
3895 London during the summer. Problem reported by Ian Abbott.
3897 2005-04-12 Jim Meyering <jim@meyering.net>
3899 * human.c (humblock): Set *options even when returning due to
3900 xstrtoumax conversion failure. Thanks to a used-uninitialized
3903 2005-04-09 Jim Meyering <jim@meyering.net>
3905 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
3906 -Wuninitialized: initialize tm0.tm_year.
3908 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
3910 * getdate.y (parser_control): rels_seen is now a boolean, not a
3911 count, since there's no maximum. All uses changed.
3912 Add member dsts_seen.
3913 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
3915 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
3916 Use pc_rels_seen to decide whther a date is absolute.
3918 * getdate.y (number): Don't overwrite year.
3919 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
3922 2005-04-02 Simon Josefsson <jas@extundo.com>
3924 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
3925 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
3927 2005-03-27 Jim Meyering <jim@meyering.net>
3929 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
3931 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
3933 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
3934 "one's complement" -> "ones' complement" in comment, as per Knuth.
3935 "value of type" -> "type or expression" in comment.
3936 * mktime.c, strftime.c: Propagate intprops.h comment nits.
3938 2005-03-26 Jim Meyering <jim@meyering.net>
3941 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
3942 Correct typos: s/or/of/.
3944 2005-03-23 Jim Meyering <jim@meyering.net>
3946 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
3948 2005-03-21 Jim Meyering <jim@meyering.net>
3950 Changes imported from coreutils.
3952 * cycle-check.c: Don't include xalloc.h.
3954 * path-concat.c: Don't include assert.h.
3955 (path_concat): Remove assertion that would have triggered
3956 for ABASE starting with more than one slash.
3957 Reported by Andreas Schwab.
3959 * path-concat.c (path_concat): Set *BASE_IN_RESULT
3960 properly when ABASE is an absolute file name.
3961 Correct the description of this function.
3963 Add an assertion and a test driver.
3964 This fixes a bug introduced on 2004-07-02.
3965 Andreas Schwab reported the resulting failure of cp --parents:
3966 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
3968 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
3970 * strftime.c (my_strftime): If the underlying strftime returns 0
3971 (which shouldn't happen), generate nothing instead of returning 0
3972 immediately, so that nstrftime (NULL, ...) doesn't return 0.
3974 2005-03-16 Bruno Haible <bruno@clisp.org>
3976 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
3978 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
3980 * strftime.c (my_strftime): Prepend space to format so that we can
3981 reliably distinguish strftime failure from empty output on POSIX
3984 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
3986 * iconvme.c (SIZE_MAX): New macro, if not already defined.
3987 (iconv_string): Don't guess a size-zero buffer, as that might cause
3988 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
3989 result would be 'too large', where 'too large' is (heuristically)
3990 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
3991 overflow concerns. This will prevent some unwanted malloc failures
3992 when the inputs are very large.
3994 2005-03-15 Bruno Haible <bruno@clisp.org>
3996 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
3999 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4002 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4004 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4006 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4007 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4009 * strtol.c: Likewise.
4011 2005-03-14 Simon Josefsson <jas@extundo.com>
4013 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4016 2005-03-14 Jim Meyering <jim@meyering.net>
4018 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4019 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4020 to be nonzero so that we (and caller) can detect the difference
4021 between a valid zero-length expansion and an error return, even
4022 when the underlying strftime fails before writing anything into
4025 2005-03-10 Jim Meyering <jim@meyering.net>
4027 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4028 so that this module works on systems without fchdir.
4030 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4032 Factor int-properties macros into a single file, except for
4033 glibc-related files.
4034 * intprops.h: New file.
4035 * getloadavg.c: Include it instead of limits.h.
4036 (INT_STRLEN_BOUND): Remove.
4037 * human.c: Include intprops.h.
4038 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4039 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4040 * inttostr.h: Include intprops.h instead of limits.h.
4041 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4042 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4043 for consistency with intprops.h.
4044 (time_t_is_integer, twos_complement_arithmetic): Use them.
4045 * sig2str.h: Include <signal.h>, intprops.h.
4046 (INT_STRLEN_BOUND): Remove.
4047 * strftime.c (TYPE_SIGNED): Remove.
4048 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4049 * strtol.c: Adjust comments to match intprops.h.
4050 * userspec.c: Include intprops.h.
4051 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4052 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4053 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4054 instead of rolling our own expressions.
4055 * xstrtol.c: Include xstrtol.h first, to test interface.
4057 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4059 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4060 the right thing even if adding 1900 would overflow. Similarly
4061 for tm_mon + 1 and tm_yday + 1.
4062 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4063 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4064 (DO_SIGNED_NUMBER): New macro.
4065 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4067 2005-03-07 Bruno Haible <bruno@clisp.org>
4069 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4071 2005-03-03 Derek R. Price <derek@ximbiot.com>
4072 Bruno Haible <bruno@clisp.org>
4074 * pagealign_alloc.h: New file.
4075 * pagealign_alloc.c: New file.
4077 2005-01-28 Bruno Haible <bruno@clisp.org>
4079 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4082 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4084 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4085 The workaround isn't strictly needed for POSIX conformance, and
4086 it's too much of a pain to configure and maintain. We'll ask
4087 people to fix their kernels instead.
4088 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4089 (NANOSLEEP_BUG_WORKAROUND): Remove.
4090 (xnanosleep): Remove the workaround.
4092 2005-02-12 Bruno Haible <bruno@clisp.org>
4094 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4096 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4098 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4099 * timespec.h (gettime): Return void, since it always
4100 succeeds now. All uses changed.
4101 * gettime.c (gettime) Likewise.
4102 [HAVE_NANOTIME]: Prefer nanotime.
4103 Assume gettimeofday succeeds, as POSIX requires.
4104 Assime time () succeeds, since other code already does.
4105 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4106 (timespec_subtract): Remove.
4107 (NANOSLEEP_BUG_WORKAROUND): New constant.
4108 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4109 things considerably. Use it only on GNU/Linux hosts, since the
4110 workaround shouldn't be needed elsewhere.
4112 2005-02-24 Bruno Haible <bruno@clisp.org>
4114 * gettext.h: Update from GNU gettext 0.14.2.
4116 2005-02-24 Bruno Haible <bruno@clisp.org>
4118 * localcharset.c: Update from GNU gettext 0.14.2.
4119 * config.charset: Update from GNU gettext 0.14.2.
4121 2005-02-22 Simon Josefsson <jas@extundo.com>
4123 * iconvme.h, iconvme.c: New files, from libc.
4125 2005-02-20 Neil Conway <neilc@samurai.com>
4127 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4128 returned by OSX/Darwin if the specified buffer is not large
4129 enough for the hostname.
4131 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4133 * memrchr.h: New file.
4134 * chdir-long.c: Include it.
4135 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4136 Don't bother including stddef.h.
4138 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4140 * argp-help.c (__argp_help): Create a fake struct argp_state and
4141 pass it to _help, otherwise the latter coredumps trying to
4142 dereference state.root_argp.
4144 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4146 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4148 Include <sys/types.h>, for dev_t.
4149 (ME_DUMMY, ME_REMOTE): Move from here....
4150 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4151 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4153 Include mountlist.h first, to test the interface.
4155 2005-01-29 Bruno Haible <bruno@clisp.org>
4157 * progname.c (program_name): Initialize.
4158 Needed when linking statically on MacOS X.
4160 2005-01-28 Bruno Haible <bruno@clisp.org>
4162 * javacomp.sh.in: New file, from GNU gettext.
4163 * javacomp.h: New file, from GNU gettext.
4164 * javacomp.c: New file, from GNU gettext.
4166 2005-01-26 Bruno Haible <bruno@clisp.org>
4168 * javaexec.sh.in: New file, from GNU gettext.
4169 * javaexec.h: New file, from GNU gettext.
4170 * javaexec.c: New file, from GNU gettext.
4172 2005-01-26 Simon Josefsson <jas@extundo.com>
4174 * gai_strerror.c: Use GPL in header.
4176 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4178 * argp-help.c (hol_entry_help): Avoid using non-constant
4179 initializers for struct pentry_state.
4180 (__argp_error): Check return value of __asprintf
4181 (__argp_failure): Translate error message
4183 * argp-parse.c: Removed braces around the expansion of N_()
4185 2005-01-21 Jim Meyering <jim@meyering.net>
4187 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4188 same value as for Solaris 9.
4190 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4191 component length. This included changing the parameter to be
4192 of type `char *' rather than `char const *'.
4193 * chdir-long.h (chdir_long): Update prototype.
4195 * openat.c (fdopendir, fstatat): New functions.
4196 * openat.h: Include headers required for use of DIR and struct stat.
4197 [AT_SYMLINK_NOFOLLOW]: Define.
4198 (fdopendir, fstatat): Add prototypes.
4200 2005-01-21 Bruno Haible <bruno@clisp.org>
4202 * classpath.h: New file, from GNU gettext.
4203 * classpath.c: New file, from GNU gettext.
4205 2005-01-20 Simon Josefsson <jas@extundo.com>
4207 * version-etc-fsf.c: New file, with version_etc_copyright.
4208 * version-etc.c: Remove version_etc_copyright.
4209 * version-etc.h (version_etc_copyright): Use [] instead of * in
4210 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4212 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
4214 * save-cwd.c (save_cwd): Remove code to support the case
4215 where fchdir is missing or flaky.
4217 2005-01-20 Simon Josefsson <jas@extundo.com>
4219 * base64.h (isbase64): Add.
4221 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4222 using a unsigned prototype, don't inline.
4223 (base64_decode): Use it.
4225 2005-01-19 Bruno Haible <bruno@clisp.org>
4227 * sh-quote.h: New file, from GNU gettext.
4228 * sh-quote.c: New file, from GNU gettext.
4230 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
4232 Merge changes from coreutils, as described below in several
4233 changelogs dated today.
4235 * save-cwd.c: Include "save-cwd.h" before other include files.
4236 (O_DIRECTORY): Remove; not needed here, since "." must be
4237 a directory. All uses removed.
4238 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
4239 universal on Suns, and we also need to test for IRIX.
4240 Revamp code to use 'if' rather than '#if'.
4241 Avoid unnecessary comparison of cwd->desc to 0.
4243 * utimens.c (futimens): Robustify the previous patch, by checking
4244 for known valid error numbers rather than observed invalid ones.
4246 2005-01-18 Jim Meyering <jim@meyering.net>
4248 * version-etc.c (version_etc_copyright): Update copyright date.
4250 * utimens.c (futimens): Account for the fact that futimes
4251 can also fail with errno == ENOSYS or errno == ENOENT.
4252 Patch from Dmitry V. Levin.
4254 Change the name of the robust chdir function from chdir to chdir_long.
4255 * save-cwd.c: Include chdir-long.h rather than chdir.h.
4256 (restore_cwd): Use chdir_long, not chdir.
4257 * chdir-long.c: Renamed from chdir.c.
4258 * chdir-long.h: Renamed from chdir.h.
4259 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4262 2005-01-18 Bob Proulx <bob@proulx.com>
4264 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4265 offsetof() macro construct to avoid compile failure with native HP-UX
4266 11.0 ANSI C compiler.
4268 2005-01-06 Bruno Haible <bruno@clisp.org>
4270 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4271 because stpncpy.m4 takes care of it.
4273 2004-01-24 Bruno Haible <bruno@clisp.org>
4275 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4277 2003-10-09 Bruno Haible <bruno@clisp.org>
4279 * progreloc.c: Include xalloc.h instead of xmalloc.h.
4281 2005-01-06 Bruno Haible <bruno@clisp.org>
4283 * fwriteerror.h (fwriteerror): Change specification to include fclose.
4284 * fwriteerror.c: Include <stdbool.h>.
4285 (fwriteerror): At the end, close the file stream. Record whether
4286 stdout was already closed.
4288 2004-05-27 Bruno Haible <bruno@clisp.org>
4290 * execute.c (environ): Declare if needed.
4291 * pipe.c (environ): Likewise.
4292 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4294 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
4296 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4297 definitions to be after all include files, to avoid collisions.
4298 Problem reported by Bob Proulx.
4300 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
4302 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4303 not needed. This removes a dependency on the gettext module.
4304 [defined _LIBC]: Do not include <libintl.h>; not needed.
4306 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
4308 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4311 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
4313 * argp-parse.c: Include <stddef.h>.
4314 (alignof, alignto): New macros.
4315 (parser_init): Don't assume that void * is aligned sufficiently
4318 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4319 need to extend the stack.
4320 (YYINITDEPTH): New macro, so that the initial stack isn't overly
4323 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4325 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4327 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4329 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4330 Remove now-obsolete comment about AIX.
4331 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4332 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4333 (YYMAXDEPTH): New macro.
4335 2004-12-18 Bruno Haible <bruno@clisp.org>
4337 * fatal-signal.c (fatal_signals): Make non-const.
4338 (init_fatal_signals): New function.
4339 (uninstall_handlers, install_handlers): Ignore signals that were set to
4341 (at_fatal_signal): Call init_fatal_signals.
4342 (init_fatal_signal_set): Likewise. Ignore signals that were set to
4344 Reported by Paul Eggert.
4346 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4348 * getdate.y (textint): New member "negative".
4349 (time_zone_hhmm): New function.
4350 Expect 14 shift-reduce conflicts, not 13.
4351 (o_colon_minutes): New rule.
4352 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4353 (yylex): Set the "negative" member of signed numbers.
4355 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
4357 Changes imported from coreutils.
4358 * hard-locale.c: Assume <locale.h> exists.
4360 (GLIBC_VERSION): New macro.
4361 (hard_locale): Assume setlocale exists.
4362 Rewrite to avoid #ifdef.
4363 Use strdup rather than malloc + strcpy.
4364 * human.c: Assume <locale.h> exists.
4365 (human_readable): Assume localeconv exists.
4367 2004-12-01 Jakub Jelinek <jakub@redhat.com>
4369 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4370 convert T2, not T. (Imported from libc.)
4372 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
4374 * getcwd.c (is_ENAMETOOLONG): New macro.
4375 (__getcwd.c): Don't restore errno; glibc doesn't.
4376 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4377 first, falling back to our code only if its results look suspicious.
4378 Ensure that the resulting buffer is only as large as necessary.
4380 * readutmp.c: Include readutmp.h first.
4381 Include <errno.h>, since readutmp.h no longer does that.
4382 * readutmp.h: Don't include <errno.h>,
4383 <sys/param.h>, <time.h>; not needed to establish interface.
4384 (errno): Remove decl.
4385 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4386 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4387 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4389 2004-11-28 Simon Josefsson <jas@extundo.com>
4391 * base64.h, base64.c: New file.
4393 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
4395 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4397 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
4399 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4400 HP's ANSI C compiler.
4401 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4402 Declaring int functions causes warnings on some modern systems and
4403 shouldn't be needed to compile on ancient ones.
4404 * same.c (MIN) [defined MIN]: Don't define, since it's already
4407 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4408 with the following changes.
4409 (__set_errno): Parenthesize properly.
4410 Include <stdbool.h>.
4411 (MIN, MAX, MATCHING_INO): New macros.
4412 (__getcwd): Define with prototype, not K&R form.
4413 Use heuristics to allocate default buffer on stack if possible.
4414 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4415 behavior, and to avoid the PATH_MAX limit when computing
4417 Use MATCHING_INO to compare inode number to file.
4418 Check for arithmetic overflow in size calculations.
4419 Fix bug in reallocation of dot array that caused getcwd to fail
4420 on directories nested deeper than 75.
4421 Be more careful about saving errno on error.
4422 Do not use realloc; use only free+malloc, as this is a bit
4423 more flexible and avoids a needless copy operation.
4424 Do not inspect st_dev and st_ino for symbolic links; POSIX
4425 doesn't specify the latter.
4426 Check for closedir errors.
4427 Avoid needless casts.
4428 Use "#ifdef weak_alias" around weak_alias, to be like other
4430 The following changes to getcwd.c have effect only when used in
4431 gnulib; they have no effect inside glibc proper.
4432 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4433 as alloca isn't used.
4434 (alloca, __alloca): Likewise.
4435 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4436 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4437 unconditionally, as gnulib assumes C89 or better.
4438 Do not include <sys/param.h>.
4439 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4440 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4442 (NULL) [!defined NULL]: Remove; we assume C89 or better.
4443 Include <dirent.h> in a way that is compatible with modern Autoconf.
4444 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4445 New macros, if not already defined.
4446 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4447 Use "_LIBC", not "defined _LIBC", for consistency.
4448 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4450 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4451 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
4452 * xgetcwd.c: David MacKenzie's old code was removed, so give
4453 credit only to Jim Meyering and adjust the copyright dates.
4454 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4455 <stdlib.h>, <unistd.h>, "pathmax.h".
4456 Instead, include "xgetcwd.h" (first) and "getcwd.h".
4457 (INITIAL_BUFFER_SIZE): Remove.
4458 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4460 2004-11-23 Jim Meyering <jim@meyering.net>
4462 * getopt_.h: Remove trailing blanks.
4464 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
4466 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4467 (futimens): New function, which uses futimes if available.
4468 (futimens, utimens): Support timespec==NULL, with same semantics
4469 as utime and utimens.
4470 * utimens.h (futimens): New decl.
4472 2004-11-23 Jim Meyering <jim@meyering.net>
4474 * __fpending.c: Add comment.
4476 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4478 * getopt_.h: Re-addition of __getopt_argv_const caused
4479 redefinition warnings. To avoid them, include the defines
4480 in `#if !defined __need_getopt ... #endif'. The only place
4481 where __getopt_argv_const is used is in definitions
4482 of getopt_long and getopt_long_only below, which are as well
4483 protected by `#ifndef __need_getopt'.
4484 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4485 __need_getopt after including <stdio.h> and <unistd.h> These
4486 headers might have defined it.
4488 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
4490 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4492 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4493 optopt): Use them instead of invoking ## directly; otherwise, the
4494 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4496 2004-11-19 Bruno Haible <bruno@clisp.org>
4498 * strtok_r.c: Move comments from here...
4499 * strtok_r.h: ... to here.
4501 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
4503 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4504 might fail. Problem reported by Yoann Vandoorselaere.
4505 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4506 that mishandle size_t overflow.
4508 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
4510 * canon-host.c: Include "strdup.h".
4511 (canon_host): Use getaddrinfo if available, so that IPv6 works.
4512 Use strdup instead of malloc/strcpy to duplicate strings.
4514 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4515 (human_space_before_unit): New constant.
4516 * human.c (human_readable): Support it.
4518 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4519 (xgetcwd): Set errno correctly when failing.
4520 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4521 the failure is actually due to a PATH_MAX problem.
4523 Further getopt changes to make it more likely that glibc will
4524 buy the changes back.
4525 * getopt.c (POSIXLY_CORRECT): New constant.
4526 (getopt): Use it, so to preserve glibc semantic
4527 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4528 when compiling for libc.
4529 * getopt_.h (__getopt_argv_const): Bring it back.
4530 (getopt_long, getopt_long_only): Use it.
4532 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4533 New arg POSIXLY_CORRECT. All callers changed.
4534 (getopt): Argv is now char * const *, as per standard.
4535 (_getopt_internal_r, _getopt_internal): Argv is now char **,
4536 not char *__getopt_argv_const *.
4537 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4538 _getopt_long_only_r): Likewise.
4539 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4540 * getopt_int.h (_getopt_internal, _getopt_internal_r,
4541 _getopt_long_r, _getopt_long_only_r): Likewise.
4542 * getopt_.h (__getopt_argv_const): Remove.
4543 (getopt): Argv is now char * const *, as per standard.
4545 * getdate.y (tORDINAL): New token.
4546 (day, relunit): Allow it for relative times.
4547 (relative_time_table): Use tORDINAL for ordinals.
4549 2004-11-15 Jim Meyering <jim@meyering.net>
4551 * closeout.c: Include "__fpending.h" once again.
4552 Include <stdbool.h>.
4553 (close_stdout): Don't fail just because stdout was closed initially,
4554 since some programs don't write to stdout in the normal course of
4555 operation (other than --version and --help), and we don't want this
4556 function to make e.g. `touch file >&-' fail.
4557 But do fail if it was closed and someone has tried to write to it.
4558 E.g., `printf foo >&-' must fail.
4560 2004-11-11 Simon Josefsson <jas@extundo.com>
4562 * strtok_r.h, strtok_r.c: New file.
4564 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
4566 * getopt_.h (__getopt_argv_const): New macro, to be used so that
4567 we can stop lying to compilers about the constness of argv when we
4568 are compiled outside glibc.
4569 (getopt, getopt_long, getopt_long_only): Use it.
4570 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4572 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4573 _getopt_long_only_r): Likewise.
4574 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4575 _getopt_long_only_r): Likewise.
4577 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4578 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4579 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4580 the other external symbols.
4581 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4582 declaration, since the above renaming now works around collisions.
4584 2004-11-11 Jim Meyering <jim@meyering.net>
4586 * linebreak.c: Remove trailing blanks.
4587 * alloca_.h: Likewise.
4588 * acosl.c: Likewise.
4589 * euidaccess.c: Likewise.
4590 * allocsa.h: Likewise.
4592 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
4594 * mktime.c (SHR): New macro, which is a portable
4595 substitute for >> that should work even on Crays.
4596 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4597 Problem reported by Mark D. Baushke in
4598 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4599 * getdate.y (SHR): Likewise.
4601 * strftime.c (SHR): Likewise.
4603 * quotearg.c (struct quoting_options): Use unsigned int for
4604 quote_these_too, so that right shifts are well defined. All uses
4607 2004-11-10 Simon Josefsson <jas@extundo.com>
4609 * getaddrinfo.h, getaddrinfo.c: New files.
4611 2004-11-10 Jim Meyering <jim@meyering.net>
4613 Ensure that no close failure goes unreported.
4614 * closeout.c (close_stdout): Always close stdout. I.e., don't
4615 return early when it seems there's nothing to flush.
4616 Don't include __fpending.h.
4618 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
4620 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4622 2004-11-05 Bruno Haible <bruno@clisp.org>
4624 * readlink.c: Include stddef.h, needed for size_t on Woe32.
4625 Reported by Mark D. Baushke <mdb@cvshome.org>.
4627 2004-11-04 Bruno Haible <bruno@clisp.org>
4629 2004-09-11 Bruno Haible <bruno@clisp.org>
4630 * allocsa.valgrind: New file.
4631 2004-02-06 Bruno Haible <bruno@clisp.org>
4632 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4633 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4634 Reported by Christopher Seip <chris.seip@hp.com>.
4636 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
4638 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4639 with errno == ERANGE if the buffer is too small.
4640 Problem reported by Mark D. Baushke.
4642 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
4644 * xreadlink.c (MAXSIZE): New macro.
4645 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
4646 size does not exceed MAXSIZE. Avoid cast.
4647 As suggested by Mark D. Baushke in
4648 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4649 if readlink fails with buffer size just under MAXSIZE, try again
4652 2004-11-02 Derek R. Price <derek@ximbiot.com>
4653 and Paul Eggert <eggert@cs.ucla.edu>
4655 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4656 (get_date): Overparenthesize to avoid GCC warning.
4658 2004-11-02 Bruno Haible <bruno@clisp.org>
4660 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4661 function returns void.
4663 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
4665 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4666 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4669 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
4671 * getdate.y: Add support for TZ="foo" within a date string.
4672 Fix some bugs near time_t boundaries. Reject dates with
4673 out-of-range components, e.g., "Sept 31".
4674 Include <stdlib.h>, "setenv.h", "xalloc.h".
4675 (ISDIGIT_LOCALE): Remove; unused.
4676 Note that the TZ and time functions used here are not reentrant.
4677 (mktime_ok, get_tz): New functions.
4678 (TZBUFSIZE): New constant.
4679 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
4680 This requires that we sometimes generate our own TZ="XXX..." setting.
4682 2004-10-27 Derek R. Price <derek@ximbiot.com>
4684 * mktime.c (not_equal_tm): Remove redundant check.
4686 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
4688 * getdate.y: Use Bison 1.875 features, and some minor
4689 code cleanups. This change does not affect semantics.
4690 Don't include <stdlib.h>; no longer needed.
4691 Don't include unlocked-io.h; only the "#if TEST" code uses
4692 stdio, and performance isn't crucial there.
4693 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4694 Bison 1.875 features as described below.
4695 All uses of "PC." replaced by "pc->".
4696 (YYSTYPE): Add a forward declaration.
4697 (yylex, yyerror): Use full prototypes in forward decls.
4698 Use "%pure-parser" rather than obsolescent "%pure_parser".
4699 Use %parse-param and %lex-param instead of obsolescent
4700 YYPARSE_PARAM and YYLEX_PARAM.
4701 (meridian_table, month_and_day_table, time_units_table,
4702 relative_time_table, time_zone_table, military_table,
4703 lookup_zone, lookup_word, get_date):
4704 Use NULL instead of 0 where appropriate.
4705 (to_hour): Avoid abort (), to avoid a dependency on
4707 (yyerror, yylex): Now accepts parser_control * arg.
4708 (main) [TEST]: Use '\0' rather than 0 for char.
4710 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
4712 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4713 It's now the caller's responsibility to handle the case where
4714 !HAVE_GETPAGESIZE && !defined getpagesize.
4716 * mktime.c (leapyear): Arg is long int, not int.
4718 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
4720 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4722 2004-10-12 Simon Josefsson <jas@extundo.com>
4724 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4725 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4728 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
4730 * vsnprintf.h: New file.
4731 * vsnprintf.c: New file.
4733 2004-10-07 Bruno Haible <bruno@clisp.org>
4735 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4736 into the provided buffer.
4738 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
4740 * diacrit.c, diacrit.h: Add GPL notice.
4742 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4743 * atanl.c (atanl): Keep the code as similar to glibc as possible.
4744 * logl.c (logl): Keep the code as similar to glibc as possible.
4745 This avoids a potential constant-folding bug.
4747 2004-10-05 Bruno Haible <bruno@clisp.org>
4749 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4751 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4753 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
4754 * xmalloc.c (xmemdup): Likewise.
4755 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4756 XFREE): Remove these long-obsolescent macros.
4757 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4758 * xstrdup.c: Remove.
4760 * regex.c (re_comp): Cast gettext return value to char *,
4761 Problem reported by Martin Neitzel via Mark D. Baushke.
4763 2004-10-04 Simon Josefsson <jas@extundo.com>
4765 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4766 '#ifdef USE_UNLOCKED_IO'.
4768 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4770 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4771 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4772 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4773 regex.c, sha1.c, version-etc.c, yesno.c:
4774 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4775 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4776 the includer's responsibility.
4778 Sync from coreutils.
4780 * modechange.c (mode_compile): Don't decrement a pointer that
4781 points to the start of a string, as the C Standard says the
4782 resulting behavior is undefined.
4784 * backupfile.h (enum backuptype): Rename none -> no_backups,
4785 simple -> simple_backups, numbered_existing ->
4786 numbered_existing_backups, numbered -> numbered_backups
4787 to avoid shadowing problems. All uses changed.
4788 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4789 * backupfile.c (check_extension, numbered_backup):
4790 Rename locals to avoid shadowing 'basename'.
4791 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4794 * .cppi-disable: Add getopt_.h, getopt_int.h.
4795 * .cvsignore: Add getopt.h.
4797 2004-10-04 Simon Josefsson <jas@extundo.com>
4799 * memmem.h: New file.
4800 * memmem.c: New file, taken from glibc.
4802 2004-10-02 Jim Meyering <jim@meyering.net>
4804 * dirfd.h, getpagesize.h: Add copyright notice.
4806 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
4808 * snprintf.c: Remove comments as to why each header is needed.
4810 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
4812 * strsep.h: New file.
4813 * strsep.c: New file.
4815 2004-10-01 Simon Josefsson <jas@extundo.com>
4817 * snprintf.c (snprintf): Handle size==0.
4819 2004-10-01 Simon Josefsson <jas@extundo.com>
4820 Bruno Haible <bruno@clisp.org>
4822 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
4823 (snprintf): Declare 'args'.
4825 2004-09-30 Simon Josefsson <jas@extundo.com>
4827 * snprintf.h, snprintf.c: New files.
4829 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4831 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
4832 (hol_entry_help): Never translate an empty string.
4833 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
4834 * argp.h (OPTION_NO_TRANS): New option.
4836 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
4838 * xvasprintf.c: Include xalloc.h.
4839 (xvasprintf): Use xalloc_die, not xmalloc_die.
4841 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
4843 * dummy.c: Change copyright notice to FSF, and license to GPL.
4845 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
4847 * argp-pvh.c (argp_program_version_hook): Provide initial value.
4848 Problem reported by Bruno Haible in:
4849 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
4851 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
4853 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
4854 in case some system header has #define'd it. Problem reported by
4855 Soeren D. Schulze in
4856 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
4858 2004-09-08 Bruno Haible <bruno@clisp.org>
4860 * stdint_.h: New file, taken from GNU clisp.
4862 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
4864 * xvasprintf.h: New file.
4865 * xvasprintf.c: New file.
4866 * xasprintf.c: New file.
4868 2004-09-08 Bruno Haible <bruno@clisp.org>
4870 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
4872 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
4874 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
4876 Import from coreutils.
4877 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
4878 strings on unbounded length. alloca's performance benefits aren't
4879 that important here.
4881 (parse_with_separator): New function, with most of the internals
4882 of the old parse_user_spec. Allow user to omit both user and group,
4883 for compatibility with FreeBSD.
4884 Clone only the user name, not the entire spec.
4885 Do not set *uid, *gid unless entirely successful.
4886 Avoid memory leak in some failing cases.
4887 Fix regression for USER.GROUP reported by Dmitry V. Levin in
4888 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
4889 (parse_user_spec): Rewrite to use parse_with_separator.
4891 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
4893 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
4894 its complicated substitute.
4895 * argp-help.c: Include <errno.h>, for program_invocation_short_name
4896 and program_invocation_name.
4897 (__argp_basename) [!_LIBC]: Remove; the only use was
4898 replaced by its body.
4899 (__argp_short_program_name): Change condition from
4900 !defined __argp_short_program_name to
4901 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
4902 to match argp-namefrob.h.
4903 (__argp_failure): Don't assume strerror_r returns char *.
4904 * argp-parse.c (N_): Define unconditionally.
4905 (argp_default_options): Fill out initializers with 0 to avoid
4908 2004-08-12 Simon Josefsson <jas@extundo.com>
4910 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
4911 * getopt_.h: Renamed from getopt.h.
4913 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
4915 Merge from coreutils.
4917 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
4918 wmemchr or wmemcpy. Problem reported by Robert Dahlem
4919 for Reliant Unix 5.43.
4921 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
4922 (union fooround): Use uintmax_t, not long int.
4923 The rest is a merge from libc:
4924 [defined _LIBC]: Include <shlib-compat.h>.
4925 (_obstack) [defined _LIBC]: Remove after 2.3.4.
4927 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
4929 * strverscmp.c: Convert to UTF-8.
4931 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
4933 * obstack.h (obstack_empty_p):
4934 Don't assume that chunk->contents is suitably aligned.
4935 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
4936 Likewise. Problem reported by Benno in
4937 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
4939 * chown.c (rpl_chown): Work even if the file is writeable but not
4940 readable. This could be improved further but it'd take some work.
4942 2004-08-08 Simon Josefsson <jas@extundo.com>
4944 * xgethostname.c: Don't include error.h (not used).
4947 * getpass.c: Include getpass.h first.
4949 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
4951 * xalloc-die.c: New files.
4952 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
4954 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
4955 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
4956 (_, N_, xalloc_die): Move to xalloc-die.c.
4957 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
4958 so that we needn't mess with xalloc_msg_memory_exhausted.
4960 * sha1.h: Renamed from sha.h.
4961 (SHA1_H): Renamed from _SHA_H.
4962 (sha1_ctx): Renamed from sha_ctx.
4963 (sha1_init_ctx): Renamed from sha_init_ctx.
4964 (sha1_process_block): Renamed from sha_process_block.
4965 (sha1_process_bytes): Renamed from sha_process_bytes.
4966 (sha1_finish_ctx): Renamed from sha_finish_ctx.
4967 (sha1_read_ctx): Renamed from sha_read_ctx.
4968 (sha1_stream): Renamed from sha_stream.
4969 (sha1_buffer): Renamed from sha_buffer.
4970 * sha1.c: Likewise; renamed from sha.c.
4971 Do not include <sys/types.h>.
4972 Include <stddef.h> rather than <stdlib.h>.
4974 2004-08-08 Bruno Haible <bruno@clisp.org>
4976 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4977 FILESYSTEM_PREFIX_LEN.
4978 * progreloc.c: Likewise.
4979 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
4981 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
4984 * argp-help.c (make_hol, hol_append): Don't assume that
4985 SIZE_MAX is a valid preprocessor constant.
4986 (__argp_basename): Change from "#ifndef _LIBC"
4987 to "#ifndef __argp_short_program_name", so that
4988 we don't compile these functions for tar.
4990 More merges from coreutils.
4991 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
4992 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
4994 * addext.c: Remove; no longer needed.
4995 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
4996 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
4997 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
4998 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
4999 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5000 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5001 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5002 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5003 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5004 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5005 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5006 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5007 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5008 Import changes from coreutils.
5010 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5012 Merge from coreutils.
5014 * .gdb-history: Remove; this doesn't belong here.
5016 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5017 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5018 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5020 * dirname.h: Include <stdbool.h>.
5021 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5022 for consistency with POSIX terminology. All uses changed.
5023 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5024 (strip_trailing_slashes): Use bool for booleans.
5025 * stripslash.c (strip_trailing_slashes): Likewise.
5027 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5028 sometimes returns a positive errno value even when it succeeds.
5029 (print_errno_message) [!LIBC]: Fall back on strerror if
5032 * path-concat.c (mempcpy): Don't define if a system header defines it.
5033 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5034 (longest_relative_suffix): New function.
5035 (path_concat): Use it. Assume first argument is not NULL.
5036 Port to DOS. Omit redundant separators.
5037 Report an error instead of returning NULL.
5038 Use mempcpy instead of memcpy.
5039 (xpath_concat): Remove: not declared or used.
5041 * same.h: Include <stdbool.h>
5042 (same_name): Return bool, not int.
5043 * same.c (same_name): Likewise.
5044 (errno): Don't declare; we assume C89 or better now.
5046 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5047 if not already defined.
5049 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5050 * dup-safer.c (errno): Likewise.
5052 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5054 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5057 2004-08-03 Simon Josefsson <jas@extundo.com>
5059 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5060 * progname.h: Don't include stdbool.h.
5062 2004-08-02 Simon Josefsson <jas@extundo.com>
5064 * getsubopt.h: New file, with comments from Bruno Haible.
5065 * getsubopt.c: New file, from glibc, but slightly modified based on
5066 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5068 2004-08-01 Simon Josefsson <jas@extundo.com>
5070 * xgetdomainname.c: Include stdlib.h, for free().
5072 2004-07-16 Simon Josefsson <jas@extundo.com>
5074 * dummy.c: New file.
5076 2004-07-16 Bruno Haible <bruno@clisp.org>
5078 * backupfile.h: Add extern "C" for C++.
5079 * closeout.h: Likewise.
5080 * copy-file.h: Likewise.
5081 * findprog.h: Likewise.
5082 * full-write.h: Likewise.
5083 * pathname.h: Likewise.
5084 * progname.h: Likewise.
5085 * stpcpy.h: Likewise.
5086 * stpncpy.h: Likewise.
5087 * strcase.h: Likewise.
5088 * strstr.h: Likewise.
5089 * xalloc.h: Likewise.
5091 * mbswidth.h: Add extern "C" for C++.
5092 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5094 2004-07-09 Simon Josefsson <jas@extundo.com>
5096 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5097 failed without this.)
5099 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5101 * fchown-stub.c: New file.
5103 2004-06-24 Jim Meyering <jim@meyering.net>
5105 * obstack.h (obstack_base): Cast to (void *), per documentation.
5107 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5109 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5111 2004-06-01 Jim Meyering <jim@meyering.net>
5113 * calloc.c: New file.
5115 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5117 * getdate.y (yylex): Allow space between sign and number.
5118 Problem reported by Dan Jacobson.
5120 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5121 and Jim Meyering <jim@meyering.net>
5123 Merge from coreutils CVS.
5125 * stat-macros.h: New file, with contents from file-type.h
5126 and coreutils' system.h.
5127 * file-type.c: Include "stat-macros.h".
5128 * file-type.h (file_type): Move all macro definitions to new file,
5131 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5132 Wrap old code with this conditional.
5133 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5134 function that does not dereference symlinks.
5135 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5137 * xreadlink.c: Include xreadlink.h first, to catch .h file
5138 dependency problems.
5139 (xreadlink): Accept new arg SIZE, for efficiency.
5140 All decls and uses changed.
5141 * xreadlink.h: Include <stddef.h>, for size_t.
5143 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5144 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5146 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5148 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5150 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5151 macros to be defined.
5152 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5153 the allocator returns NULL because the requested size is zero.
5155 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5157 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5158 var. Add comment explaining why libc still defines it. This
5159 merges the following patch from glibc:
5160 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5162 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5164 * obstack.c (_obstack): Remove unused variable. It hasn't been
5165 present in glibc since revision 1.1 of this file.
5166 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5167 obstack_alignment_mask, obstack_alloc, obstack_base,
5168 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5169 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5170 obstack_grow0, obstack_init, obstack_int_grow,
5171 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5172 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5173 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5174 nonexistent functions.
5176 2004-05-17 Derek R. Price <derek@ximbiot.com>
5177 Paul Eggert <eggert@cs.ucla.edu>
5179 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5181 2004-05-14 Bruno Haible <bruno@clisp.org>
5183 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5184 that consists of a '.' followed by an empty digit string.
5185 Patch by Tor Lillqvist <tml@iki.fi>.
5187 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5189 Port obstack to the AS/400, where pointers are 16 bytes wide and
5190 you cannot cast an integer to a valid pointer. This patch is
5191 currently waiting to be integrated into glibc; see
5192 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5194 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5195 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5196 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5197 (struct obstack): temp member is now a union of a pointer and
5198 an integer, instead of an integer. All integer uses changed.
5199 This does not affect the physical layout of struct obstack,
5200 except on hosts (like the AS/400) where the size or alignment of
5201 void * is greater than that of ptrdiff_t.
5202 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5203 __STDC__)]: Store temporary in pointer member of union, not
5205 * obstack.c: Include <stddef.h>, for offsetof.
5206 (struct fooalign): Remove; it doesn't need a name.
5207 (union fooround): Change double to long double, and add void *.
5208 (DEFAULT_ALIGNMENT): Use offsetof to compute.
5209 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5210 not a macro. Hence the values are always int; so remove all
5211 casts-to-int in uses.
5213 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
5214 Derek Price <derek@ximbiot.com>
5216 * alloca.c: Include <alloca.h>, to get our interface.
5217 * alloca_.h: Use __alloca on AIX, so that we don't have to
5218 include <alloca.h> first. Use C89 prototype for alloca; this
5219 requires including <stddef.h> for size_t. Use extern "C" if C++.
5220 Use #elif for simplicity, since we can assume C89 now.
5221 Don't try to source the system alloca.h since it will not be found
5222 and to prevent recursively including its replacement.
5223 * fnmatch.c: Include <alloca.h> instead of opencoding.
5224 * regex.c: Likewise.
5226 2004-05-16 Derek Price <derek@ximbiot.com>
5227 Paul Eggert <eggert@cs.ucla.edu>
5229 getline cleanup. This changes the getndelim2 API: both order of
5230 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5233 * getline.c: Don't include stddef.h or stdio.h, since our
5234 interface does that.
5235 (getline): Always use getdelim, so that we don't have two
5236 copies of this code.
5237 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5239 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5240 (GETNDELIM2_MAXIMUM): New macro.
5241 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
5242 instead of the old practice of delim2==0. All callers changed.
5243 Return -1 on overflow, instead of returning junk.
5244 Do not set *linesize unless allocation succeeds.
5245 * getndelim2.h: Do not include stddef.h; no longer needed, now
5246 that we include sys/types.h.
5247 * getnline.h: Likewise.
5248 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5249 (getndelim2): Reorder arguments.
5250 * getnline.c (getnline, getndelim):
5251 Don't discard the NMAX argument.
5252 (getnline): Invoke getndelim, to avoid code duplication.
5253 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5254 of (size_t) -1 by callers of the getnline family.
5256 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
5258 * nanosleep.c (suspended): Change its type from int to
5259 sig_atomic_t volatile.
5260 (first_call): Make it private to rpl_nanosleep, and have it
5261 be zero initially as that's a bit faster.
5262 (my_usleep): Round up fractional times instead of truncating them,
5263 as this is the usual meaning for 'sleep'.
5265 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5267 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5268 (ENOSYS): Define if not defined.
5269 (settime): Fall back on stime if it exists and settimeofday fails.
5270 But don't bother with fallbacks if a method fails with errno == EPERM.
5272 2004-05-11 Jim Meyering <jim@meyering.net>
5274 Prior to this change, the save_cwd caller required read access to the
5275 current directory on most systems (ones with the fchdir function).
5277 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5278 fails, try write-only, and finally, resort to using xgetcwd.
5280 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5282 * obstack.c, obstack.h: Import changes from libc.
5284 2004-04-28 Bruno Haible <bruno@clisp.org>
5286 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5287 implicitly appends .exe to executables.
5288 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5289 accepts Windows pathnames.
5290 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5291 Cygwin like Windows, since it now accepts Windows pathnames.
5292 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5293 Cygwin like Windows, since it now accepts Windows pathnames.
5294 Reported by Derek Robert Price <derek@ximbiot.com>.
5296 2004-04-20 Jim Meyering <jim@meyering.net>
5298 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5300 2004-04-20 Jim Meyering <jim@meyering.net>
5301 Bruno Haible <bruno@clisp.org>
5303 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5304 memory when realloc fails.
5306 2004-04-18 Jim Meyering <jim@meyering.net>
5308 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5309 don't leak memory and do call END_UTMP_ENT.
5311 2004-04-11 Paul Eggert <eggert@twinsun.com>
5313 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5314 (CHAR_BIT): Remove, since we assume C89.
5315 Include <stdint.h> if available, as per current Autoconf CVS advice.
5317 2004-03-30 Paul Eggert <eggert@twinsun.com>
5319 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5320 not bool, to be more consistent with Unix conventions.
5321 Suggested by Bruno Haible.
5323 Merge from coreutils.
5325 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5328 * getdate.h: Include stdbool.h, and timespec.h instead of
5329 the usual <time.h> dance.
5330 (get_date): Change signature to support fractional time stamps.
5331 All callers changed.
5332 * getdate.y: Include "getdate.h" first, as we can now
5333 assume C89 and don't need to worry about 'const'.
5334 Similarly, include "unlocked-io.h" near start, not in middle.
5336 (textint.value): Use long int rather than int.
5337 (textint.digits): Use size_t rather than int.
5338 (BILLION, LOG10_BILLION): New constants.
5339 (parser_control): New member rel_ns. Members day_ordinal,
5340 time_zone, month, day, hour, minutes, rel_year, rel_month,
5341 rel_day, rel_hour, rel_minutes, rel_seconds
5342 are now long int, not int. Member seconds is now struct timespec,
5343 not int. New member timespec_seen. Members dates_seen, days_seen,
5344 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5346 (%union.intval): Now long int, not int.
5347 New member timespec.
5348 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5349 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5350 (spec): Now is a timespec or an item list.
5351 (timespec, items): New nonterminals.
5352 (time, rel, relunit, number, get_date):
5353 Add support for fractional seconds.
5354 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5355 (gmtime, localtime, mktime): Remove decls; not needed with C89.
5356 (to_hour): First arg is now long int, not int.
5357 (to_year): Returns long int, not int.
5358 Don't treat year -70 like 70.
5359 (tm_diff): Returns long int, not int.
5360 (lookup_word): Use bool instead of int when appropriate.
5361 (yylex): Use size_t for count, not int.
5362 Detect overflow when parsing large integer constants.
5363 Add support for fractions.
5364 (get_date): Make pointers 'const' if possible.
5365 Use more-portable code to detect integer overflow.
5366 (main) [TEST]: Adjust to above changes. Test for localtime failure.
5367 Don't use ctime; it's not reliable if the year has >4 digits.
5369 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5370 This is for compatibility with BSD.
5372 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5373 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5374 From coreutils' system.h.
5376 * userspec.c: Don't include "posixver.h".
5377 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5378 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5379 compatible extension. Simplify code by removing a boolean int
5380 that was always nonzero if a string was nonnull.
5382 2004-03-30 Jim Meyering <jim@meyering.net>
5384 Merge from coreutils.
5386 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5388 * readtokens.c (readtoken): Don't leak 64 bytes when reading
5389 an empty input stream.
5391 * readtokens.c: Include <stdbool.h>.
5392 (readtoken): Use `size_t' rather than int/long.
5393 All callers adjusted.
5394 Use `bool' rather than `int' where appropriate.
5395 Use memset rather than an explicit loop.
5396 Use x2nrealloc rather than xrealloc.
5397 Allow the use of `\0' as a delimiter.
5398 (readtokens): Likewise.
5399 * readtokens.h (readtoken, readtokens): Update prototypes.
5401 2004-03-30 Bruno Haible <bruno@clisp.org>
5403 * getloadavg.c (getloadavg): Don't assume setlocale returns
5406 2004-03-29 Paul Eggert <eggert@twinsun.com>
5408 Merge changes to getloadavg.c from coreutils and Emacs.
5410 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5411 Define to an expression, not to the empty string.
5412 Include cloexec.h and xalloc.h.
5413 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5414 Use set_cloexec_flag rather than rolling our own.
5415 * cloexec.c, cloexec.h: New files.
5417 2004-03-18 Paul Eggert <eggert@twinsun.com>
5419 * getopt.h: Sync with libc CVS.
5421 2004-03-18 Paul Eggert <eggert@twinsun.com>
5422 Bruno Haible <bruno@clisp.org>
5424 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5425 not on all platforms that have <wchar.h>.
5426 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5428 2004-03-09 Paul Eggert <eggert@twinsun.com>
5430 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5432 * getopt_int.h: New file, also synced from libc.
5434 2004-03-07 Paul Eggert <eggert@twinsun.com>
5436 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
5437 '#if' expressions. Unlike the code it replaces, it does not
5438 depend on (defined _SC_PAGESIZE). However, it does depend on
5439 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5440 first reported by Jason Andrade in
5441 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5443 2004-01-18 Simon Josefsson <jas@extundo.com>
5445 * strdup.h: New file.
5446 * strdup.c: Include it.
5447 * path-concat.c: Include strdup.h. Drop strdup declaration.
5448 * userspec.c: Include strdup.h. Drop strdup declaration.
5450 2004-02-06 Karl Berry <karl@gnu.org>
5452 * config.charset: update from gettext 0.14.1.
5454 2004-02-05 Paul Eggert <eggert@twinsun.com>
5456 Add comments and code, prompted by suggestions from Bruno Haible
5458 * quotearg.h (quotearg_alloc): New decl. Improve the comments
5459 describing the enum quoting_style values.
5460 * quotearg.c (quotearg_alloc): New function.
5461 (quotearg_buffer_restyled): Treat lone { and } as special.
5462 Treat = as special. Work around bug with older shells
5463 that "see" a '\' that is really the 2nd byte of a multibyte char.
5464 Quote empty string with shell_quoting_style.
5466 2004-02-03 Bruno Haible <bruno@clisp.org>
5468 * pipe.h: New file, from GNU gettext.
5469 * pipe.c: New file, from GNU gettext.
5471 2004-01-27 Bruno Haible <bruno@clisp.org>
5473 * execute.h: New file, from GNU gettext.
5474 * execute.c: New file, from GNU gettext.
5475 * w32spawn.h: New file, from GNU gettext.
5477 2004-01-23 Paul Eggert <eggert@twinsun.com>
5479 Exit-status fix from coreutils.
5481 Use exit_failure consistently in place of EXIT_FAILURE,
5482 so that program exit statuses are consistent on failure.
5484 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5485 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5486 * argmatch.h: Comment fix to match the above.
5487 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5488 Now a macro referring to exit_failure, instead of a separate
5489 variable. Include "exitfail.h" to get it.
5490 * xstrtol.h: Include "exitfail.h".
5491 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5493 * long-options.c (parse_long_options): Use prototype
5494 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
5497 2004-01-21 Jim Meyering <jim@meyering.net>
5499 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5500 so as not to conflict with a different-sized __mktime_internal
5501 function in GNU libc.
5502 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5503 Problem building statically-linked `ls' reported by Michael Brunnbauer.
5505 2004-01-18 Paul Eggert <eggert@twinsun.com>
5507 Merge from diffutils.
5509 * file-type.c (file_type): Add typed memory objects.
5510 * file-type.h (S_TYPEISTMO): New macro.
5512 * c-stack.h (c_stack_action): Remove argv argument.
5513 * c-stack.c (c_stack_action): Likewise. All uses changed.
5514 (die): Don't calculate message unless segv_action returns.
5515 (get_stack_location, min_address_from_argv, max_address_from_argv,
5516 volatile stack_base, volatile_stack_size): Remove.
5517 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5518 that every segmentation violation is a stack overflow. (Ouch!)
5519 See Debian bug 136249 (still outstanding) for more info about why
5520 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5522 2003-11-30 Bruno Haible <bruno@clisp.org>
5524 Safer stack allocation.
5525 * setenv.c: Include allocsa.h.
5526 (alloca): Remove fallback definition.
5527 (freea): Remove macro.
5528 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5531 2003-10-17 Bruno Haible <bruno@clisp.org>
5533 * binary-io.h: Avoid warnings on Cygwin.
5535 2003-12-28 Bruno Haible <bruno@clisp.org>
5537 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5538 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5540 2003-11-28 Bruno Haible <bruno@clisp.org>
5542 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5544 2003-11-27 Bruno Haible <bruno@clisp.org>
5546 * wait-process.c: On Windows, include windows.h. Needed on mingw.
5548 2003-11-17 Bruno Haible <bruno@clisp.org>
5550 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5552 2003-11-24 Bruno Haible <bruno@clisp.org>
5554 * xallocsa.h: New file, from GNU gettext.
5555 * xallocsa.c: New file, from GNU gettext.
5557 2003-11-24 Bruno Haible <bruno@clisp.org>
5559 * allocsa.h: New file, from GNU gettext.
5560 * allocsa.c: New file, from GNU gettext.
5562 2003-11-24 Bruno Haible <bruno@clisp.org>
5564 * eealloc.h: New file.
5566 2004-01-15 Jim Meyering <jim@meyering.net>
5568 Merge from coreutils.
5570 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
5571 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
5572 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5574 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5575 optional configure-time default.
5577 * version-etc.c (version_etc_copyright): Update copyright date.
5579 * xreadlink.c (xreadlink): Correct outdated comment.
5581 2004-01-15 Paul Eggert <eggert@twinsun.com>
5583 Merge from coreutils.
5585 * posixver.c: Include posixver.h.
5587 * same.c: Include <stdbool.h>, <limits.h>.
5588 (_POSIX_NAME_MAX): Define if not defined.
5590 (same_name): If file names are silently truncated, report
5591 that the file names are the same if they are the same after
5592 the silent truncation.
5594 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5595 conversion function.
5596 * xstrtod.c (xstrtod): Likewise. All callers changed to
5597 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
5600 2004-01-14 Paul Eggert <eggert@twinsun.com>
5602 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5603 with like-named macro in fnmatch.c.
5604 (EXT): Use an internal constant instead.
5606 Merge fnmatch patches from glibc.
5607 * fnmatch.c (mbsinit): Remove define.
5608 Add libc_hidden_ver (__fnmatch, fnmatch).
5609 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5610 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5612 2003-12-14 Karl Berry <karl@gnu.org>
5614 * config.charset: update from gettext-runtime.
5616 2003-12-03 Paul Eggert <eggert@twinsun.com>
5618 * getgroups.c (getgroups): xmalloc takes one argument, not two.
5619 Bug reported by Alfred M. Szmidt.
5621 2003-11-29 Karl Berry <karl@gnu.org>
5623 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5625 2003-11-23 Paul Eggert <eggert@twinsun.com>
5626 Bruno Haible <bruno@clisp.org>
5628 * printf-parse.h: Don't include sys/types.h.
5629 (ARG_NONE): New macro.
5630 (char_directive): Change type of *arg_index fields to size_t.
5631 * printf-parse.c: Don't include sys/types.h.
5632 (SSIZE_MAX): Remove macro.
5633 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5634 Remove unnecessary overflow check.
5635 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5638 2003-11-24 Paul Eggert <eggert@twinsun.com>
5640 * alloca.c: Remove dependency on xalloc module.
5641 (xalloc_die): Remove.
5642 (memory_full) [!defined emacs]: New macro.
5643 [!defined emacs]: Don't include xalloc.h.
5644 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5645 address arithmetic overflows. Change datatypes a bit to avoid
5648 2003-11-22 Jim Meyering <jim@meyering.net>
5650 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5652 2003-11-17 Bruno Haible <bruno@clisp.org>
5654 * vasnprintf.c (alloca): Remove fallback definition.
5655 (freea): Remove definition.
5656 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5657 Reported by Paul Eggert.
5659 2003-11-17 Jim Meyering <jim@meyering.net>
5661 On systems without utime and without a utimes function capable of
5662 dealing with a NULL struct utimbuf* argument, this utime replacement
5663 could -- in unusual circumstances -- leak a file descriptor.
5664 * utime.c: Include <unistd.h> and <errno.h>.
5665 (utime_null): Be sure to close `fd' and to preserve errno.
5666 Reported by Geoff Collyer via Arnold Robbins.
5668 2003-11-16 Paul Eggert <eggert@twinsun.com>
5669 Bruno Haible <bruno@clisp.org>
5671 Protect against address arithmetic overflow.
5672 * printf-args.h: Include stddef.h.
5673 (arguments): Change type of field 'count' to size_t.
5674 * printf-args.c (printf_fetchargs): Use size_t instead of
5675 'unsigned int' where appropriate.
5676 * printf-parse.h: Include sys/types.h.
5677 (char_directive): Change type of *arg_index fields to ssize_t.
5678 (char_directives): Change type of fields 'count', max_*_length to
5680 * printf-parse.c: Include sys/types.h and xsize.h.
5681 (SSIZE_MAX): Define fallback value.
5682 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5683 instead of 'int' where appropriate. Check a_allocated, d_allocated
5684 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5685 * vasnprintf.c: Include xsize.h.
5686 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5687 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5688 overflow. Avoid wraparound when converting a width or precision from
5691 2003-11-16 Bruno Haible <bruno@clisp.org>
5693 Update from GNU gettext.
5694 * printf-parse.c: Generalize to it can be compiled for wide strings.
5695 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5696 * vasnprintf.c: Generalize to it can be compiled for wide strings.
5697 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5698 SNPRINTF): New macros.
5699 Don't include <alloca.h> if the file is used inside libintl.
5700 (local_wcslen): New function, for Solaris 2.5.1.
5701 (VASNPRINTF): Use it instead of wcslen.
5703 2003-11-16 Bruno Haible <bruno@clisp.org>
5705 * xsize.h (xmax): New function.
5706 (xsum, xsum3, xsum4): Declare as "pure" functions.
5708 2003-11-12 Paul Eggert <eggert@twinsun.com>
5710 * xalloc.h: Do not include <limits.h> or <stdint.h>.
5711 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5712 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
5713 heuristic is just as accurate as far as we know, and it removes a
5714 dependency on size_max.m4 and ptrdiff_max.m4.
5716 2003-11-12 Paul Eggert <eggert@twinsun.com>
5718 * xstrtol.c (__xstrtol): Remove "break" immediately after
5719 "return", to pacify some unknown compiler. Problem reported
5722 2003-11-11 Bruno Haible <bruno@clisp.org>
5724 * xsize.h (SIZE_MAX): Remove fallback definition.
5725 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5728 2003-11-10 Paul Eggert <eggert@twinsun.com>
5730 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5731 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5732 rejected some allocations of exactly SIZE_MAX - 2 bytes.
5734 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5735 not (size_t) -1, since it's defined here.
5737 2003-11-06 Paul Eggert <eggert@twinsun.com>
5739 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5740 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5741 Reject sizes of exactly SIZE_MAX bytes.
5742 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5743 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5745 2003-11-05 Bruno Haible <bruno@clisp.org>
5747 * xsize.h: Include limits.h, to avoid a possible collision with
5748 SIZE_MAX defined in <limits.h> on Solaris.
5750 2003-11-04 Bruno Haible <bruno@clisp.org>
5752 * xsize.h: New file.
5753 * linebreak.c: Include xsize.h.
5754 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5755 argument for overflow.
5756 Suggested by Paul Eggert.
5758 2003-10-31 Bruno Haible <bruno@clisp.org>
5760 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5761 to avoid (extremely rare) race condition.
5762 Suggested by Paul Eggert.
5764 2003-11-03 Jim Meyering <jim@meyering.net>
5766 * userspec.c: Include "userspec.h".
5767 * userspec.h: New file.
5769 2003-10-31 Paul Eggert <eggert@twinsun.com>
5771 * mountlist.h (struct mount_entry.me_type_malloced): New member.
5772 * mountlist.c (SIZE_MAX): Define if not defined already.
5773 (read_filesystem_list): Set and use me_type_malloced.
5774 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5775 whatever the type happens to be), for brevity and consistency.
5776 Check for size calculation overflow on Alphas running OSF/1.
5778 2003-10-31 Jim Meyering <jim@meyering.net>
5780 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5782 * linebuffer.c: Include <string.h> for declaration of memset.
5784 2003-10-30 Paul Eggert <eggert@twinsun.com>
5785 Bruno Haible <bruno@clisp.org>
5787 * vasprintf.c: Include <limits.h>, <stdlib.h>.
5788 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5790 2003-10-29 Paul Eggert <eggert@twinsun.com>
5792 * xalloc.h (xalloc_oversized): Now a macro, not a function,
5793 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
5795 * quotearg.c (quotearg_n_options): Use it.
5796 * group-member.c: Include <stdbool.h>.
5797 (free_group_info): Arg is now const *; don't free arg.
5798 (get_group_info): Now returns bool and accepts struct group_info *,
5799 rather than returning a malloc'ed struct group_info *.
5800 All uses changed. Check for overflow in internal size calculation.
5802 * getusershell.c (readname): Simplify the code by using x2nrealloc
5803 rather than xmalloc/xrealloc.
5804 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5805 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
5806 conformance bug: the old code used a pointer after freeing the
5807 storage that it addressed.
5808 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5809 rather than doing it by hand.
5810 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5811 the buffer preserved. Use free and xmalloc instead.
5812 * quotearg.c (quotearg_n_options): Likewise.
5813 Use a simpler test for size overflow. Don't use xalloc_oversized
5814 because unsigned int might be wider than size_t (!); this suggests
5815 that we should switch from unsigned int to size_t for slot numbers.
5817 2003-10-27 Bruno Haible <bruno@clisp.org>
5819 * stdbool_.h: Better support for BeOS.
5821 2003-10-27 Paul Eggert <eggert@twinsun.com>
5823 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
5824 to allocate the returned structure. Do not allocate a subarray,
5825 as x2nrealloc will do that.
5826 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
5827 instead of xnrealloc.
5828 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
5830 2003-10-26 Paul Eggert <eggert@twinsun.com>
5832 * xalloc.h (xalloc_oversized): New static inline function, for
5833 callers that want to do their own size-overflow checking. Include
5834 <stdbool.h>, since xalloc_oversized returns bool.
5835 * xalloc.c (array_size_overflow): Remove. All callers changed
5836 to use xalloc_oversized.
5838 Add two functions x2realloc, x2nrealloc, for programs that grow
5839 arrays dynamically by doubling their sizes.
5840 * xalloc.h (x2realloc, x2nrealloc): New decls.
5841 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
5844 Port to C99 semantics for 'inline' of external functions.
5845 Bug reported by Bruno Haible.
5846 * xmalloc.c (xnmalloc_inline): New static inline function,
5847 with the old contents of xnmalloc.
5848 (xnmalloc, xmalloc): Use it.
5849 (xnrealloc_inline): New static inline function,
5850 with the old contents of xnrealloc.
5851 (xnrealloc, xrealloc): Use it.
5853 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
5855 2003-10-25 Paul Eggert <eggert@twinsun.com>
5857 Fix several address-calculation bugs in the hash modules,
5858 plus some minor code cleanup.
5860 * hash.h: Include <stdbool.h>, for bool.
5861 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
5862 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
5863 hash_get_n_entries, hash_get_max_bucket_length,
5864 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
5865 hash_rehash): Use size_t rather than unsigned.
5866 * hash.c (struct hash_table, hash_get_n_buckets,
5867 hash_get_n_buckets_used, hash_get_n_entries,
5868 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
5869 hash_get_entries, hash_do_for_each, hash_string, is_prime,
5870 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
5872 (SIZE_MAX): Define if not defined.
5873 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
5874 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
5876 Use const * when possible.
5877 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
5878 (check_tuning): Fix bug: if tuning parameters were very close to
5879 0 or 1, rounding errors could have caused subscript violations.
5880 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
5881 (hash_initialize): Add 'fail:' label
5882 to free table and return NULL, and use it to simplify code.
5883 Use calloc rather than clearing the storage ourself.
5884 (hash_initialize, hash_rehash): Check for arithmetic overflow in
5885 buffer size calculations.
5886 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
5887 Include <stddef.h>, for size_t.
5888 * hash-pjw.c (hash_pjw): Likewise.
5889 Switch to method described by Bruno Haible.
5890 Include <limits.h>, for CHAR_BIT.
5891 (SIZE_BITS): New macro.
5893 2003-10-21 Paul Eggert <eggert@twinsun.com>
5895 * getndelim2.c (getndelim2): When size calculation overflows,
5896 ceiling the allocation at NMAX bytes rather than silently
5897 discarding input bytes before NMAX is reached. This makes
5898 a difference only if NMAX exceeds SIZE_MAX / 2.
5900 * obstack.c: Merge from glibc.
5901 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
5902 Add libc_hidden_def (_obstack_newchunk).
5903 (_obstack_free) [! defined _LIBC]: Remove.
5904 [defined _LIBC]: Make a strong alias from obstack_free, rather than
5905 a clone of the function body.
5906 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
5907 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
5909 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
5910 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
5913 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
5914 (obstack_ptr_grow_fast, obstack_int_grow_fast):
5915 Don't use lvalue casts, as GCC plans to remove support for them
5916 in GCC 3.5. Reported by Joseph S. Myers. This bug
5917 was also present in the non-GCC version, indicating that this
5918 code had always been buggy and had never been widely used.
5919 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
5920 Use the fast variant of each macro, rather than copying the
5921 definiens of the fast variant; that way, we'll be more likely to
5922 catch future bugs in the fast variants.
5924 2003-10-20 Bruno Haible <bruno@clisp.org>
5926 * wait-process.h: New file, from GNU gettext.
5927 * wait-process.c: New file, from GNU gettext.
5929 2003-10-19 Jim Meyering <jim@meyering.net>
5931 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
5933 2003-10-16 Paul Eggert <eggert@twinsun.com>
5935 * getgroups.c: Include <errno.h>, <stdlib.h>.
5936 (getgroups): First arg is int, not size_t.
5937 Don't let 'free' mangle errno.
5939 2003-10-16 Jim Meyering <jim@meyering.net>
5941 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
5943 2003-10-15 Paul Eggert <eggert@twinsun.com>
5945 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
5947 (new_exclude, add_exclude_file): Initial size no longer needs to
5949 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
5950 our own address arithmetic overflow checking.
5952 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
5953 (fnmatch): Do not alloca more than 2000 wide characters;
5954 instead, use malloc for large buffers.
5955 Check for address arithmetic overflow, and return -1
5956 with errno set to ENOMEM in that case.
5957 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
5958 (NEW_PATTERN): Do not alloca more than 8000 bytes;
5959 instead, return -1. Check for address arithmetic overflow.
5961 2003-10-14 Paul Eggert <eggert@twinsun.com>
5963 Handle invalid suffixes and overflow independently, so that
5964 callers can treat them independently as needed. Fix some bugs in
5965 suffix handling, e.g., "100k@" was not diagnosed as an invalid
5966 suffix for a human-readable blocksize. The major caller-visible
5967 change is the addition of a new
5968 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
5969 that both overflow and suffix chars were found.
5971 * human.c (humblock): Don't check separately for invalid suffix
5972 char; that is xstrtoumax's job (now that its bug is fixed).
5973 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
5974 INTMAX_MAX]: New macros.
5975 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
5976 TYPE_MAXIMUM): New macros.
5977 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
5978 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
5979 if overflow occurs, as it's what __strtol does and it's more useful
5981 (__xstrtol): If __strtol reports some error other than ERANGE,
5982 reflect it to the caller as LONGINT_INVALID. If it reports
5983 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
5984 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
5985 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
5987 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
5988 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
5989 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
5990 [defined UINTMAX_MAX]: New macros.
5992 2003-10-14 Bruno Haible <bruno@clisp.org>
5994 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
5995 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
5996 Also use volatile where needed.
5998 2003-10-12 Paul Eggert <eggert@twinsun.com>
6000 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6001 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6002 and define in terms of the other primitives.
6003 * xmalloc.c: Include stdbool.h; do not include exit.h.
6004 (SIZE_MAX): Define if not already defined.
6005 (array_size_overflow): New function.
6006 (xalloc_die): Abort instead of exiting if 'error' returns.
6007 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6008 (xmalloc, xrealloc): Use them.
6009 (xcalloc): Check for address arithmetic overflow.
6010 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6011 a bit faster than strcpy.
6013 2003-10-08 Paul Eggert <eggert@twinsun.com>
6015 Merge getpass from libc, plus a few fixes.
6017 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6018 Include <stdbool.h>.
6019 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6020 __fsetlocking to empty.
6021 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6022 do include <bits/libc-lock.h>.
6023 Do not include <fcntl.h>; not needed.
6024 [_LIBC]: Include <wchar.h>.
6025 (NOTCANCEL_MODE): New macro.
6026 (flockfile, funlockfile) [_LIBC]: New macros.
6027 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6028 [!_LIBC]: New macros.
6029 (call_fclose): New function.
6030 (getpass): Use it. Save tty stream separately; this simplifies the
6031 code and makes it more reliable if stdin happens to equal stdout.
6032 Invoke __fsetlocking on tty.
6033 Handle thread cancellation if needed.
6034 Namespace cleanup (use __tcgetattr, __getline).
6035 Use bool for Booleans.
6036 [USE_IN_LIBIO]: Handle wide streams.
6037 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6038 stream might go where.
6040 * unlocked-io.h: Include <stdio.h>, so that the caller
6041 doesn't have to include <stdio.h> before us.
6042 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6043 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6044 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6045 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6046 if not declared, so that we can use getpass.c code from libc without
6048 (flockfile, ftrylockfile, funlockfile): New macros.
6050 2003-10-06 Bruno Haible <bruno@clisp.org>
6052 * version-etc-2.h: Remove file.
6053 * version-etc-2.c: Remove file.
6055 2003-09-25 Jim Meyering <jim@meyering.net>
6056 Bruno Haible <bruno@clisp.org>
6058 This lets translators provide better translations for the
6059 "Written by ..." part of --version output.
6060 * version-etc.h: Include stdarg.h.
6061 (version_etc_copyright): Declare as readonly.
6062 (version_etc): Make this function variadic with a NULL-terminated list
6063 of author name strings.
6064 (version_etc_va): New declaration.
6065 * version-etc.c: Include stdarg.h, stdlib.h.
6066 (version_etc_copyright): Declare as readonly.
6067 (version_etc_va): New function. Provide a different translatable string
6068 for each possible number of authors < 10. Abbreviate when there are 10
6070 (version_etc): Make this function variadic. Call version_etc_va.
6071 Suggestion from Gary V. Vaughan.
6073 * long-options.h (parse_long_options): Change prototype: the authors
6074 string is moved to the end and becomes variadic.
6075 * long-options.c: Include stdarg.h.
6076 (parse_long_options): Make this function variadic, too.
6077 Call version_etc_va, not version_etc.
6079 2003-10-06 Bruno Haible <bruno@clisp.org>
6081 * fatal-signal.h: New file, from GNU gettext.
6082 * fatal-signal.c: New file, from GNU gettext.
6084 2003-10-04 Karl Berry <karl@gnu.org>
6086 * argp*: update from libc.
6088 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6090 * getpass.c (getpass): Use a no-op fseek when switching from input to
6091 output mode on the same stream.
6093 2003-09-29 Paul Eggert <eggert@twinsun.com>
6095 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6096 Fix arg typo in previous patch.
6098 2003-09-28 Jim Meyering <jim@meyering.net>
6100 * error.c: Correct cpp indentation.
6102 2003-09-27 Paul Eggert <eggert@twinsun.com>
6104 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6105 Omit the special code that used __typeof__, since we worry that
6106 it could be more trouble than it's worth. See:
6107 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6108 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6112 2003-09-26 Jim Meyering <jim@meyering.net>
6114 * error.c (error_tail): Move some declarations
6115 into inner scope where the local variables are used.
6117 2003-09-26 Bruno Haible <bruno@clisp.org>
6119 * stpncpy.h (gnu_stpncpy): New declaration.
6120 (stpncpy): Define as alias for gnu_stpncpy.
6121 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6123 2003-09-26 Paul Eggert <eggert@twinsun.com>
6125 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6126 (error_tail): Do not loop, reallocating temporary buffer, since
6127 the output cannot contain more wide characters than the input
6128 contains bytes, the size must be big enough already. This avoids
6129 one potential size overflow calculation. Check for size overflow
6130 when calculating temporary buffer size. Free temporary buffer
6131 when done, if it was allocated with malloc; this plugs a memory
6132 leak. Remove casts from void * to pointers, that are no longer
6133 needed now that we're assuming C89 or better.
6135 Merge error changes from glibc.
6137 * error.c, error.h: Update copyright notice header to match glibc.
6138 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6139 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6140 Disable cancellation while printing error.
6141 * error.h: Prepend __ to parameter names.
6143 2003-09-25 Karl Berry <karl@gnu.org>
6145 * argp-fmtstream.c, argp-help.c: update from libc.
6147 2003-09-25 Bruno Haible <bruno@clisp.org>
6149 * version-etc-2.h: New file, from version-etc.h with modifications.
6150 * version-etc-2.c: New file, from version-etc.c with modifications.
6152 2003-09-25 Simon Josefsson <jas@extundo.com>
6154 * xgetdomainname.h: New file.
6155 * xgetdomainname.c: New file.
6157 2003-09-25 Simon Josefsson <jas@extundo.com>
6158 Bruno Haible <bruno@clisp.org>
6160 * getdomainname.h: New file.
6161 * getdomainname.c: New file.
6163 2003-09-24 Paul Eggert <eggert@twinsun.com>
6165 * linebuffer.c (freebuffer): Don't free the argument, just
6166 the buffer associated with the argument. Bug reported by
6169 2003-09-19 Karl Berry <karl@gnu.org>
6171 * argp.h: update from libc.
6173 2003-09-16 Paul Eggert <eggert@twinsun.com>
6175 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6176 input error, instead of returning NULL the next time we are called
6177 (and therefore losing track of errno).
6179 2003-09-15 Paul Eggert <eggert@twinsun.com>
6181 * getndelim2.c (getndelim2): Don't trash errno when a read
6182 fails, so that the caller gets the proper errno.
6184 * readutmp.c (read_utmp): Likewise.
6185 Check for fstat error. Close stream and free storage
6188 2003-09-14 Bruno Haible <bruno@clisp.org>
6190 * fwriteerror.h: New file.
6191 * fwriteerror.c: New file.
6193 2003-09-14 Jim Meyering <jim@meyering.net>
6195 * getloadavg.c: Correct cpp indentation.
6196 * strdup.c: Likewise.
6197 * vasnprintf.c: Likewise.
6199 2003-09-12 Paul Eggert <eggert@twinsun.com>
6201 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6202 * obstack.c [!defined _LIBC]: Likewise.
6203 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6204 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6205 * exitfail.c: Don't include stdlib.h; no longer needed.
6207 More changes to assume C89 or better.
6209 * error.c (error_tail): Assume vprintf.
6211 * argmatch.c (getenv): Remove decl.
6212 * progreloc.c (get_full_program_name): Define via prototype.
6213 * setenv.c (clearenv): Likewise.
6214 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6216 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6217 (malloc, memcpy): Remove decls.
6218 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6219 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6220 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6221 (memcpy): Remove macro.
6222 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6223 (__P): Remove. All uses removed.
6224 (PTR): Remove. All uses changed to void *.
6225 (CHAR_BIT, NULL): Remove.
6226 (spaces, zeros, memset_space, memset_zero)
6227 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6229 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6230 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6231 Define with prototype.
6232 Remove now-unnecessary prototype decl.
6233 (extra_args_spec): Assume ANSI C. All uses changed.
6234 (extra_args_spec_iso): Remove.
6235 (my_strftime, emacs_strftimeu): Define via prototype.
6236 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6238 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6239 * strtoimax.c: Include <stdlib.h> unconditionally.
6240 (strtoul, strtol): Remove decls.
6241 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6243 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6244 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
6245 (LOCALE_PARAM_PROTO): New macro.
6246 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6247 (INTERNAL (strtol), strtol): Define with a prototype.
6248 (PARAMS): Remove. All uses removed.
6249 * tempname.c: Include <string.h> unconditionally.
6250 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6251 * xgethostname.c (main): Define with a prototype.
6252 * xmalloc.c: Include "xalloc.h" first, to check interface.
6253 Include <stdlib.h> unconditionally.
6254 (calloc, malloc, realloc, free): Remove decls.
6255 * xstrtod.c: Include "xstrtod.h" first, to check interface.
6256 Include <stdlib.h> unconditionally. Sort include file names.
6258 (xstrtod): Define with a prototype.
6259 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6260 (strtol, strtoul): Remove decls.
6262 2003-09-11 Paul Eggert <eggert@twinsun.com>
6264 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6265 Include <stdlib.h>, <string.h> unconditionally.
6266 Remove now-unnecessary cast to char *.
6267 * strnlen.c: Include <string.h> unconditionally.
6268 * yesno.c (yesno): Define with a prototype.
6270 2003-09-10 Bruno Haible <bruno@clisp.org>
6272 * strcspn.c: Include <string.h> unconditionally.
6273 * strpbrk.c: Include <string.h> unconditionally.
6274 * strstr.c: Include <string.h> unconditionally.
6275 * unicodeio.c: Include <string.h> unconditionally.
6276 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6277 * unsetenv.c: Likewise.
6278 * xreadlink.c: Include <stdlib.h> unconditionally.
6279 * yesno.c: Include <stdlib.h> unconditionally.
6280 (rpmatch): Add prototype.
6282 2003-09-10 Jim Meyering <jim@meyering.net>
6284 * error.c: Correct indentation of cpp directives.
6286 2003-09-09 Paul Eggert <eggert@twinsun.com>
6290 * acosl.c (main): Use a prototype.
6291 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6294 * getloadavg.c (getloadavg, main): Define via prototypes.
6296 * getopt.h (struct option.name): Assume C89, and use 'const'.
6297 (getopt, etopt_long, getopt_long_only, _getopt_internal)
6298 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6300 * getopt.c (const): Remove macro.
6301 Include <string.h> unconditionally.
6302 (my_index): Remove; all uses changed to strchr.
6303 (strlen): Remove decl.
6304 (exchange): Remove forward decl; no longer needed.
6305 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6306 Define with prototype.
6307 * getopt1.c (const): Remove macro.
6308 (getopt_long, getopt_long_only, main): Define with prototype.
6310 * getugroups.c: Include <string.h> unconditionally.
6312 * getusershell.c: Include <stdlib.h> unconditionally.
6313 (getusershell, setusershell, endusershell, readname, main):
6314 Define with prototypes.
6316 * group-member.c: Include group-member.h first.
6317 Include <stdlib.h> unconditionally.
6319 * hard-locale.c: Include hard-locale.h first.
6320 Include <stdlib.h>, <string.h> unconditionally.
6322 * hash.c (free, malloc): Remove decls.
6323 Include <stdlib.h> unconditionally.
6325 * human.c: Include <stdlib.h>, <string.h> unconditionally.
6326 (getenv): Do not declare.
6328 * idcache.c: Include <string.h> unconditionally.
6330 * long-options.c: Include long-options.h first, to test interface.
6331 Include <stdlib.h> unconditionally.
6333 * makepath.c: Include makepath.h first, to test interface.
6334 Include <stdlib.h> and <string.h> unconditionally.
6336 * linebuffer.c: Include <stdlib.h>.
6337 (free): Remove decl.
6339 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6340 rpl_malloc returns void *, not char *.
6341 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
6343 * md5.h: Include <limits.h> unconditionally.
6344 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6345 (__P): Remove; all uses removed.
6346 * md5.c: Include "md5.h" first.
6347 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6348 md5_buffer, md5_process_bytes, md5_process_block):
6349 Define with prototypes.
6350 * sha.h (__P): Remove all uses. (It wasn't defined??)
6351 * sha.c: Include "sha.h" first.
6352 Include <stdlib.h>, <string.h> unconditionally.
6354 * memchr.c (__ptr_t): Remove; all uses changed to void *.
6355 * memcmp.c (__ptr_t): Likewise.
6356 * memrchr.c (__ptr_t): Likewise.
6357 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6358 Include <string.h> unconditionally.
6359 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6360 * memchr.c: Include <stdlib.h> unconditionally.
6361 * memchr.c (LONG_MAX): Remove.
6362 * memrchr.c (LONG_MAX): Likewise.
6363 * memchr.c (__memchr): Define via a prototype.
6364 * memrchr.c (__memrchr): Likewise.
6365 * memcmp.c (__P): Remove, and remove all uses.
6366 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6367 Remove forward decls; no longer needed.
6368 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6369 Use types required by C89 in prototype.
6371 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6372 * savedir.c: Likewise.
6373 * mkdir.c (free): Remove decl.
6374 * rmdir.c (rmdir): Define with a prototype.
6375 * savedir.c: Include savedir.h first, to test interface.
6377 * mktime.c (STDC_HEADERS): Remove.
6378 Include <stdlib.h>, <string.h> unconditionally.
6380 * modechange.c: Include <stdlib.h> unconditionally.
6381 (malloc): Remove decl.
6383 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6384 (free): Remove decl.
6386 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6387 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6388 (This type really should be intptr_t, but that's a C99ism.)
6389 (_obstack_memcpy): Remove: all uses changed to memcpy.
6390 Include <string.h> unconditionally.
6391 (struct obstack): Assume __STDC__ for types of members
6392 chunkfun, freefun, extra_arg.
6393 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6394 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6395 obstack_begin, obstack_specify_allocation,
6396 obstack_specify_allocation_with_arg, obstack_chunkfun,
6397 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6398 Remove unprototyped decls and the macros that use them.
6399 * obstack.c (POINTER): Remove. All uses changed to void *.
6400 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6401 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6402 (defined __STDC__ && __STDC__)]:
6403 Remove nonprototyped code.
6404 Include <stdlib.h> unconditionally.
6405 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6406 _obstack_allocated_p, _obstack_free, obstack_free,
6407 _obstack_memory_used, print_and_abort):
6408 Define using prototypes.
6409 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6410 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6411 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6412 obstack_next_free, obstack_object_size, obstack_room) [0]:
6413 Remove unused, unprototyped code.
6415 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6417 * physmem.c (physmem_total, physmem_available, main): Define
6420 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6421 (main): Define with a prototype.
6423 * posixver.c (getenv): Remove decl.
6425 * putenv.c (malloc): Returns void *, not char *.
6426 Include <string.h> unconditionally.
6427 (strchr, memcpy, NULL): Do not define.
6429 * readtokens.c: Include readtokens.h first, to test interface.
6430 Include <stdlib.h>, <string.h> unconditionally.
6431 (init_tokenbuffer): Define with a prototype.
6433 * regex.c (PARAMS): Remove. All uses removed.
6434 All uses of _RE_ARGS removed, too.
6435 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6437 (bzero): Assume memset exists.
6438 (memcmp, memcpy, NULL): Remove.
6439 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6440 char, or assignments to local vars of type signed char.
6441 (init_syntax_once, PREFIX(extract_number_and_incr),
6442 PREFIX(print_partial_compiled_pattern),
6443 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6444 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6445 PREFIX(regex_grow_registers), PREFIX(regex_compile),
6446 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6447 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6448 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6449 wcs_compile_range, byte_compile_range, truncate_wchar,
6450 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6451 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6452 count_mbs_length, wcs_re_match_2_internal,
6453 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6454 PREFIX(alt_match_null_string_p),
6455 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6456 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6457 regfree, PREFIX(extract_number)): Define with prototype. Remove
6458 now-unnecessary declaration, if any.
6459 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6461 Remove now-unnecessary casts among pointer types.
6462 * regex.h (_RE_ARGS): Remove. All uses removed.
6464 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6465 (free): Remove decl.
6467 * rpmatch.c: Include <stdlib.h> unconditionally.
6469 * same.c: Include <stdlib.h>, <string.h> unconditionally.
6470 (free): Remove decl.
6472 * save-cwd.c: Include <stdlib.h> unconditionally.
6473 * xgetcwd.c: Likewise.
6475 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6476 (free): Remove decl.
6478 * strchrnul.c (strchrnul): Define with a prototype.
6479 Fix bug: c_in was not converted to char before searching.
6481 The following changes are not K&R related:
6483 * group-member.h: Include <sys/types.h>, so that this file is
6485 * makepath.h: Likewise.
6487 * getusershell.c (readname, default_index, line_size, readname):
6488 Use size_t, not int, for sizes.
6489 (readname): If the size overflows, report an error instead of
6492 2003-09-09 Derek Robert Price <derek@ximbiot.com>
6494 * getndelim2.c: Assume stdlib.h per the C89 spec.
6496 2003-09-08 Paul Eggert <eggert@twinsun.com>
6498 Assume C89 or better; remove K&R cruft.
6499 A few of these changes were first proposed by Derek Robert Price
6500 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6502 * addext.c: Include <string.h> unconditionally.
6503 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6504 Don't declare getenv or malloc.
6506 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6507 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6509 (find_stack_direction, alloca): Use prototypes.
6511 * atexit.c (atexit): Define using a prototype.
6513 * basename.c, dirname.c, stripslash.c:
6514 Include <string.h> unconditionally.
6516 * bcopy.c: Include <stddef.h>.
6517 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6519 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6521 * error.h (error, error_at_line, error_print_progname)
6522 [! (defined (__STDC__) && __STDC__)]: Remove decls.
6523 * error.c: Include error.h first, to check interface.
6524 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6525 (VA_START): Remove; all uses changeed to va_start.
6526 (exit, strerror): Remove decls.
6527 (error_print_progname): Prototype uncondionally.
6528 Don't include <errno.h>; no longer needed.
6529 (private_strerror): Remove.
6530 (error_tail): Always define.
6531 (error, error_at_line): Assume C89 or better; always use prototypes.
6532 * fatal.c: Include "fatal.h" first, to test interface.
6533 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6534 (VA_START): Remove; all uses changed to va_start.
6535 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6537 (exit): Remove decl.
6538 (fatal): Prototype unconditionally. Assume va_start works.
6539 Abort at end, to pacify gcc.
6541 * euidaccess.c (main): Define with a prototype.
6543 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6545 * exitfail.c: Include <stdlib.h> unconditionally.
6547 * fnmatch_.h (__P): Remove. All uses changed to assume
6549 * fnmatch.c: Include fnmatch.h first, to test interface.
6550 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6551 (getenv): Remove decl.
6552 (fnmatch): Define using a prototype.
6553 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6554 (FCT): Define using a prototype.
6556 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6558 * gethostname.c: Include <stddef.h>.
6559 (gethostname): Define with prototype. Length is size_t, not int.
6561 2003-09-08 Paul Eggert <eggert@twinsun.com>
6563 * getversion.c: Remove; was migrated to backupfile.c in 1997.
6564 getversion.c should have been removed then, but was accidentally
6567 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6568 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6570 2003-09-07 Paul Eggert <eggert@twinsun.com>
6572 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6573 copy_tm_result. Bug reported by Simon Josefsson in
6574 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6576 2003-09-06 Paul Eggert <eggert@twinsun.com>
6578 * time_r.c, time_r.h: New files.
6580 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6582 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
6583 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6585 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6587 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6588 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6591 * timegm.c: Switch to glibc implementation, with the following changes:
6592 [defined HAVE_CONFIG_H]: Include <config.h>.
6593 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6594 (__mktime_internal) [!defined _LIBC]: New decl.
6595 (__gmtime_r) [!defined _LIBC]: New macro and function.
6596 (timegm): Use a prototype, since gnulib assumes C89.
6597 Do not bother declaring tmp to be const, as it's not really usefu.
6598 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6599 (timegm): Declare only if HAVE_DECL_TIMEGM.
6601 2003-09-03 Paul Eggert <eggert@twinsun.com>
6603 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6604 Bug reported by Lute Kamstra in
6605 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6607 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6608 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
6609 course with correspondingly smaller numbers for tomorrow and
6610 yesterday. From Tadayoshi Funaba. Originally installed into
6611 sh-utils on 1999-08-07, but the patch got lost (I guess during the
6614 2003-08-31 Simon Josefsson <jas@extundo.com>
6616 * timegm.h: New file.
6617 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
6619 2003-08-31 Karl Berry <karl@gnu.org>
6621 * argp.h: update from libc.
6623 2003-08-28 Bruno Haible <bruno@clisp.org>
6625 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6626 warning on QNX, which defines O_BINARY to 000000.
6628 2003-08-24 Bruno Haible <bruno@clisp.org>
6630 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6631 MSVC7 <stdio.h> is included later.
6633 2003-08-20 Bruno Haible <bruno@clisp.org>
6635 * progname.h: New file, from GNU gettext.
6636 * progname.c: New file, from GNU gettext.
6637 * progreloc.c: New file, from GNU gettext.
6639 2003-08-19 Bruno Haible <bruno@clisp.org>
6641 * xstrdup.c: Assume <string.h> exists.
6643 2003-08-18 Jim Meyering <jim@meyering.net>
6645 * setenv.h: Indent nested cpp directive.
6646 * vasnprintf.c: Remove trailing blanks.
6648 2003-08-17 Simon Josefsson <jas@extundo.com>
6649 Bruno Haible <bruno@clisp.org>
6651 * xstrndup.h: New file.
6652 * xstrndup.c: New file.
6654 2003-08-17 Bruno Haible <bruno@clisp.org>
6656 * strndup.h: New file.
6658 2003-08-16 Paul Eggert <eggert@twinsun.com>
6660 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6661 space, undoing this 2003-08-12 change:
6662 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6664 2003-08-16 Jim Meyering <jim@meyering.net>
6666 Merge from coreutils.
6667 * xstrtoimax.c: #else #if -> #elif.
6668 * xstrtoumax.c: Likewise.
6670 2003-08-15 Paul Eggert <eggert@twinsun.com>
6672 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6673 rather than tab, after '#' in shell-script copyright notices.
6674 Suggested by Bruno Haible.
6676 2003-08-15 Jim Meyering <jim@meyering.net>
6677 and Paul Eggert <eggert@twinsun.com>
6679 Merge from coreutils.
6680 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6681 member but strut utmpx does not. Needed for AIX 4.3.3.
6682 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6684 2003-08-15 Jim Meyering <jim@meyering.net>
6686 Merge from coreutils.
6687 * xgethostname.c: Include <stdlib.h>.
6688 (xghostname): Don't exit for anything other than memory-related
6689 failure; just return NULL.
6690 * userspec.c: Include "posixver.h".
6691 (parse_user_spec): Accept `.' as a separator only
6692 in pre-POSIX-200112 mode.
6693 * strtoimax.c: Use #elif rather than #else #if.
6694 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6695 Remove function, now that we can rely on a working tzset function.
6696 [!_LIBC]: Ensure that the required autoconf test has been run.
6697 [!defined _NL_CURRENT && HAVE_STRFTIME]:
6698 Use underlying_strftime for %r.
6699 * sha.c: Merge in some clean-up and optimization changes from glibc.
6700 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6701 Ensure that it is a multiple of 64.
6702 Rearrange loop exit tests so as to avoid performing an
6703 additional fread after encountering an error or EOF.
6704 * realloc.c: Update copyright date.
6706 2003-08-14 Jim Meyering <jim@meyering.net>
6708 Merge from coreutils.
6709 * obstack.h: Whitespace changes.
6710 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6711 and xcalloc return values.
6712 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6713 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
6714 hang on OSF/1 5.1 for DIR on both local and remote file systems.
6715 Reported by (and fix confirmed by) Nelson H. F. Beebe.
6716 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6718 Use mntctl's return value to drive the entry-processing loop, since
6719 we can't rely on the value of the vmt_length member in the last
6720 entry. On some systems doing so could result in exhausting
6721 virtual memory. Based in part on a patch from Mike Jetzer.
6723 2003-08-14 Jim Meyering <jim@meyering.net>
6724 and Paul Eggert <eggert@twinsun.com>
6726 Merges from coreutils, plus other fixes.
6727 * physmem.c: Merge in portability changes from gcc/libiberty
6728 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
6729 for credits and details. Thanks to Kaveh Ghazi for helping
6730 to keep these files in sync.
6731 (ARRAY_SIZE): Define it.
6732 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6733 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6734 (memcasecmp): Don't assume size_t fits in unsigned int.
6735 Remove casts and duplicate code.
6736 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6737 (memcpy): Remove definition.
6738 Merge in some clean-up and optimization changes from glibc.
6739 [BLOCKSIZE]: Move definition to top of file.
6740 Ensure that it is a multiple of 64.
6741 Rearrange loop exit tests so as to avoid performing an
6742 additional fread after encountering an error or EOF.
6743 * md5.h (md5_uintptr): Define.
6744 * makepath.c (CLEANUP_CWD): Report an error if we failed to
6745 return to the initial working directory. Preserve errno
6747 * idcache.c: Include "xalloc.h".
6748 (xmalloc, xrealloc): Remove decls.
6749 (getuser): Remove casts no longer required in C89.
6750 * human.c: Include stdio.h, for sprintf.
6751 * group-member.c: Include "xalloc.h".
6752 (xmalloc, xrealloc): Remove decls.
6753 (get_group_info): Remove casts no longer required in C89.
6754 * getusershell.c (readname): Remove casts no longer required in C89.
6755 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6756 * getline.c: Whitespace fix, from coreutils.
6758 2003-08-13 Paul Eggert <eggert@twinsun.com>
6760 * exclude.c: Include <ctype.h>
6761 (IN_CTYPE_DOMAIN): New macro.
6763 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6766 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6767 Undo previous (whitespace-only) change.
6769 2003-08-12 Paul Eggert <eggert@twinsun.com>
6771 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6772 Normalize leading white space and remove trailing white space.
6773 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6774 notice, as per ../config/srclist-update.
6776 Merge from coreutils.
6777 * euidaccess.h: New file.
6778 * euidaccess.c: Include it.
6779 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6780 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
6781 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6783 2003-08-11 Bruno Haible <bruno@clisp.org>
6785 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6786 (vasnprintf): Use it instead of wcslen.
6788 2003-08-11 Bruno Haible <bruno@clisp.org>
6790 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6791 value to ensure that _Bool promotes to int. Use #define for _Bool when
6792 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6794 2003-08-10 Karl Berry <karl@gnu.org>
6796 * regex.h: update from libc (whitespace fix).
6798 2003-08-09 Paul Eggert <eggert@twinsun.com>
6800 Merge some files from coreutils. These changes were
6801 originally made by Jim Meyering.
6802 * acl.c: Include <sys/types.h> before <sys/stat.h>;
6803 many older Unixes require this.
6804 * alloca.c (alloca): Remove cast to argument of free;
6805 no longer needed in C89.
6806 * alloca_.h, regex.h: Fix white space to match
6807 what GNU indent does.
6809 2003-08-05 Paul Eggert <eggert@twinsun.com>
6811 * bumpalloc.h: Remove.
6813 2003-08-04 Paul Eggert <eggert@twinsun.com>
6815 * getloadavg.c: Change copyright notice and spacing to conform to
6818 Merge from coreutils.
6819 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6821 * getdate.y (date): Also accept dates like May-23-2003; suggestion
6822 from Karl Berry, implemented by Jim Meyering.
6823 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
6824 from Dmitry V. Levin.
6825 Remove anachronistic cast of xrealloc.
6826 * fnmatch_.h (__const): Remove. Use 'const'.
6827 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
6828 type. Otherwise, it wouldn't compile with at least /bin/cc on
6829 ymp-cray-unicos9.0.2.X.
6830 Combine two mostly-identical uses of alloca into one.
6831 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
6833 2003-08-04 Dave Love <d.love@dl.ac.uk>
6837 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
6838 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
6839 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
6840 obsolete NLIST_NAME_UNION.
6841 [__GNU__]: Undef BSD and FSCALE.
6842 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
6844 2003-08-03 Paul Eggert <eggert@twinsun.com>
6846 * stdbool_.h (_Bool): Make it signed char, instead of
6847 an enum type, so that it's guaranteed to promote to int. See:
6848 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
6850 2003-07-31 Paul Eggert <eggert@twinsun.com>
6852 * strerror.c: Include config.h, limits.h. Declare sprintf.
6853 (strerror): Don't assume that a printable int fits in 14 bytes.
6855 2003-07-24 Derek Robert Price <derek@ximbiot.com>
6856 Bruno Haible <bruno@clisp.org>
6858 * getline.h (getline, getdelim): Change return type to ssize_t.
6859 * getline.c (getline, getdelim): Likewise.
6860 Remove _GNU_SOURCE define; now it's defined in config.h through
6863 2003-07-22 Paul Eggert <eggert@twinsun.com>
6865 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
6866 over-parenthesization in macros.
6868 Sync with coreutils.
6870 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
6873 Use `exit_failure' for xalloc and xmemcoll instead of their own
6874 private exit-failure variables.
6875 * xalloc.h (xalloc_exit_failure): Remove.
6876 * xmalloc.c: Likewise. Include exitfail.h.
6877 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
6878 * xmemcoll.h (xmemcoll_exit_failure): Remove.
6879 * xmemcoll.c: Likewise. Include exitfail.h.
6880 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
6882 2003-07-18 Paul Eggert <eggert@twinsun.com>
6884 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
6885 * closeout.c: Likewise. Include "closeout.h" right after config.h,
6886 to test that it can stand by itself. Include "exitfail.h".
6887 Clients should set exit_failure instead.
6888 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
6890 2003-07-18 Andreas Schwab <schwab@suse.de>
6892 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
6894 2003-07-18 Bruno Haible <bruno@clisp.org>
6896 * getndelim2.h: New file.
6897 * getndelim2.c: Make into a module of its own. Include config.h,
6899 (getndelim2): Make non-static. Change return type to ssize_t.
6900 * getline.h: Change argument names.
6901 * getline.c: Include getndelim2.h instead of getndelim2.c.
6902 * getnline.c: Include getndelim2.h.
6904 2003-07-17 Bruno Haible <bruno@clisp.org>
6906 * Makefile.am: Remove file.
6907 * Makefile.in: Remove file.
6909 2003-07-17 Bruno Haible <bruno@clisp.org>
6911 * getnline.h: New file.
6912 * getnline.c: New file.
6913 * getndelim2.c: New file, extracted from getline.c.
6914 (getndelim2): Renamed from getdelim2, with added nmax argument.
6915 * getline.c: Include getndelim2.c.
6916 (getdelim2): Moved out to getndelim2.c.
6917 (getline, getdelim): Update.
6919 2003-07-15 <karl@gnu.org>
6921 * vasnprintf.c: update from gettext.
6923 2003-07-15 Jim Meyering <jim@meyering.net>
6925 * makepath.c (make_path): Enclose diagnostic in _(...).
6927 2003-07-14 Paul Eggert <eggert@twinsun.com>
6929 * asnprintf.c, asprintf.c, config.charset, gettext.h,
6930 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
6931 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
6932 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
6933 vasprintf.c, vasprintf.h: Regenerate. These files are now being
6934 updated automatically by ../config/srclist-update. This changes
6935 their license from LPGL to GPL.
6937 2003-07-14 Jim Meyering <jim@meyering.net>
6939 Don't emit diagnostics. Let callers do that.
6940 * save-cwd.c: Don't include "error.h".
6941 (save_cwd): Don't call error. Ensure that errno is valid
6942 when returning nonzero.
6944 * save-cwd.h (restore_cwd): Update prototype.
6945 * save-cwd.c (restore_cwd): Remove two parameters.
6946 Simplify. Don't call error upon failure. Let callers do that.
6947 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
6948 when auditing is enabled. But don't bother updating the #if.
6950 2003-07-14 Simon Josefsson <jas@extundo.com>
6952 * mempcpy.h: New file.
6953 * mempcpy.c: New file.
6955 2003-07-14 Paul Eggert <eggert@twinsun.com>
6957 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
6958 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
6959 unicodeio.c, unicodeio.h, unlocked-io.h:
6960 Switch from LGPL to GPL.
6962 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
6964 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
6965 it breaks C++ compilation.
6966 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
6968 2003-07-10 Jim Meyering <jim@meyering.net>
6970 * vasnprintf.c: Remove trailing blanks.
6971 Make cpp indentation consistent.
6973 2003-07-09 Paul Eggert <eggert@twinsun.com>
6975 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
6976 posixver.c, strftime.c, strnlen.c, strverscmp.c:
6977 Switch from LGPL to GPL.
6979 2003-07-07 Paul Eggert <eggert@twinsun.com>
6981 * mktime.c: Fix some boundary cases and remove need for floating point.
6983 Issue a compile-time diagnostic if time_t is floating point, or if
6984 two's complement arithmetic is not in effect, or if arithmetic
6985 right shift does not propagate the sign. These assumptions were
6986 all in the original code but they weren't checked.
6988 (TIME_T_MIDPOINT, verify): New macros.
6989 (__isleap): Remove; it has integer overflow problems.
6990 (leapyear): New function, without those problems.
6991 (ydhms_tm_diff): Remove; splitting into two parts.
6992 (ydhms_diff): New function, containing the arithmetic part of
6993 the old ydhms_tm_diff function. Issue a compile-time
6994 diagnostic if we are not using C99 integer division.
6995 Avoid casts when possible.
6996 (guess_time_tm): New function, containing the checking part of
6997 the old ydhms_tm_diff function. Return the new value, rather than
6998 the difference between it and the old. Accept a new argument T
6999 so that *T specifies the old value. Check for overflow in the result.
7001 (__mktime_internal): Use a time_t offset, not a long int offset.
7002 This undoes the 2003-06-04 change, which is no longer needed now
7003 that we have better overflow checking.
7004 (localtime_offset): Likewise.
7006 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7007 and long are 64-bit but int is only 32-bit.
7008 (ydhms_diff): Use long int to store year1 and yday1.
7009 Issue a compile-time diagnostic if long int is not wide enough.
7011 (__mktime_internal): Use long int to store adjusted year and yday.
7012 Use plain C rather than preprocessor commands, if that doesn't
7014 Check for overflow (and try to repair) after each probe
7015 rather than checking only at the very end. This avoids some bugs
7016 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7017 does not equal GMT offset at maximum time).
7018 Use integer to check for overflow rather than floating point; this
7019 is more portable to non-IEEE hosts, and is a tad faster.
7020 When we detect that we are oscillating between two values,
7021 don't check whether tm_isdst has the requested value, since
7022 we already know the answer. When tm_isdst has the wrong value,
7023 use a different heuristic to find the right one, based on the
7024 extreme values actually observed in practice in tz2003a,
7025 rather than the (overly optimistic) "previous 3 calendar quarters".
7027 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7028 "T const" to accommodate glibc style.
7029 (check_result): Use less-confusing report format. "long" -> "long int.
7031 Don't loop if the iteration overflows time_t.
7032 Allow a negative step in the iteration.
7034 2003-07-01 Paul Eggert <eggert@twinsun.com>
7036 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7037 having it depend on HAVE_SYS_TYPES_H.
7039 2003-06-25 Bruno Haible <bruno@clisp.org>
7041 * readlink.c: New file.
7043 2003-06-20 Bruno Haible <bruno@clisp.org>
7045 Assume C89, so PARAMS isn't needed.
7046 * unicodeio.h (PARAMS): Remove.
7047 * unicodeio.c: Don't use PARAMS.
7049 2003-06-18 Jim Meyering <jim@meyering.net>
7051 Merge changes from coreutils.
7052 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7053 Remove explicit declarations of xmalloc and realloc.
7055 (read_utmp): Remove anachronistic cast of xmalloc.
7057 2003-06-17 Paul Eggert <eggert@twinsun.com>
7059 Assume C89, so PARAMS isn't needed.
7060 * backupfile.h (PARAMS): Remove. All uses removed.
7061 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7062 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7063 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7064 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7065 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7066 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7067 xstrtol.h: Likewise.
7068 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7069 same.h, strverscmp.h: Do not include config.h; no longer needed.
7070 Anyway, config.h should always be included before any other file.
7072 2003-06-11 Simon Josefsson <jas@extundo.com>
7074 * sysexit_.h: New file.
7076 2003-05-20 Derek Price <derek@ximbiot.com>
7078 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7080 2003-06-10 Simon Josefsson <jas@extundo.com>
7082 * strchrnul.h: New file.
7083 * strchrnul.c: New file.
7085 2003-06-10 Simon Josefsson <jas@extundo.com>
7087 * argp.h: New file, from glibc.
7088 * argp-ba.c: New file, from glibc.
7089 * argp-eexst.c: New file, from glibc.
7090 * argp-fmtstream.c: New file, from glibc.
7091 * argp-fmtstream.h: New file, from glibc.
7092 * argp-fs-xinl.c: New file, from glibc.
7093 * argp-help.c: New file, from glibc.
7094 * argp-namefrob.h: New file, from glibc.
7095 * argp-parse.c: New file, from glibc.
7096 * argp-pv.c: New file, from glibc.
7097 * argp-pvh.c: New file, from glibc.
7098 * argp-xinl.c: New file, from glibc.
7100 2003-06-07 Jim Meyering <jim@meyering.net>
7102 * readtokens.h: Put `Free Software Foundation, Inc.'
7103 in place of my name in the copyright comment.
7104 Remove definition and uses of __P.
7107 * stat.c: Don't declare xmalloc explicitly.
7108 Instead, include "xalloc.h".
7109 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7110 xrealloc, and xcalloc return values.
7111 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7113 * xgetcwd.h: Remove definition/uses of PARAMS.
7115 2003-06-06 Jim Meyering <jim@meyering.net>
7117 * stdbool_.h: Renamed from stdbool.h.in.
7119 2003-06-06 Jim Meyering <jim@meyering.net>
7121 Merge from coreutils.
7122 * same.c: (same_name): Declare *_basename locals to be `const'.
7123 Consolidate declarations and initializations of *_base* locals.
7125 Merge from coreutils.
7126 This avoids a core dump on systems without GNU putenv,
7127 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7128 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7129 (unsetenv): New static function, from GNU libc.
7130 (rpl_putenv): Use it.
7132 * modechange.c: Remove trailing blanks.
7134 Merge from coreutils.
7135 * fsusage.c: Remove declaration of statfs.
7136 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7138 * posixtm.c: Include <stdbool.h> unconditionally.
7140 2003-06-05 Paul Eggert <eggert@twinsun.com>
7142 * mktime.c (__mktime_internal): When resolving a tm_isdst
7143 mismatch, look in future quarters as well as past. This fixes a
7144 bug when processing fall-backwards gaps immediately after a long
7145 period of daylight-saving time.
7147 * mktime.c: Assume freestanding C89 or better.
7148 (HAVE_LIMITS_H): Remove. Assume it's 1.
7149 (__P): Remove; not used.
7150 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7151 (mktime, not_equal_tm, print_tm, check_result,
7152 main): Use prototypes. Use const * where appropriate.
7153 (main): Fix typo in testing code that uncovered by above changes.
7154 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7156 2003-06-04 Paul Eggert <eggert@twinsun.com>
7158 * mktime.c: Fix Debian bug 177940
7159 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7160 (localtime_offset): Now long int, not time_t, because we want it
7161 to be guaranteed to be signed. All uses changed.
7162 (__mktime_internal): If overflow would occur when adding offset,
7165 Merge 'human' changes from coreutils. Rewrite to support
7166 locale-specific notations like thousands separators.
7167 * human.c: Simplify authorship notice.
7168 Include human.h immediately after config.h.
7169 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7170 <limits.h>: Do not include, since human.h does.
7171 (SIZE_MAX, UINTMAX_MAX): New macros.
7172 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7173 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7174 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7175 (power_letter): Renamed from suffixes.
7176 (generate_suffix_backwards): Remove.
7177 (adjust_value): Now takes int style (because of human.h changes)
7178 and long double value (for greater precision on some platforms).
7179 (group_number): New function.
7180 (human_readable): Use it. Use integer options, not enum.
7181 Put the options before the sizes in the arg list.
7182 Support all the new options.
7183 The old human_readable function has been removed;
7184 use inttostr.h instead.
7185 (human_readable, default_block_size, humblock):
7186 Use uintmax_t, not int, for block sizes.
7187 (human_readable_inexact, block_size_types): Remove.
7188 (block_size_opts): New constant.
7189 (human_options): Renamed from human_block_size, with new signature
7190 that allows block sizes up to UINTMAX_MAX. All callers changed.
7191 * human.h: Add copyright and authorship notice.
7192 Include <limits.h> and <stdbool.h> unconditionally.
7193 (PARAMS): Remove. All uses removed.
7194 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7195 (enum human_inexact_style): Remove tag; now a nameless enum.
7196 (human_floor, human_ceiling, human_round_to_even): Now have
7197 values 2, 0, 1 rather than -1, 1, 0.
7198 (human_group_digits, human_suppress_point_zero, human_autoscale,
7199 human_base_1024, human_SI, human_B): New constants.
7200 (human_readable_inexact, human_block_size): Remove.
7201 (human_readable): Size args are now uintmax_t, not int.
7202 (human_options): New decl.
7204 * exclude.c: (new_exclude, add_exclude): Remove casts that are
7205 unnecessary now that we assume C89 or better. This change
7206 imported from coreutils.
7208 * mktime.c (__mktime_internal): Do not reject negative timestamps
7209 arbitrarily. This is the same patch as 2003-05-28, but it got lost
7210 in the 2003-05-30 sync from glibc.
7212 .h files should stand alone, but we shouldn't include <sys/types.h>
7213 if we can get away with just <stddef.h>.
7215 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7216 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7217 rather than <sys/types.h>, as we merely need size_t.
7218 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7220 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7221 Include <stdio.h>, to get FILE.
7222 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7223 memcasecmp.h has included <stddef.h> and all we need is size_t.
7224 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7225 our interface, instead of including <sys/types.h>
7227 2003-06-02 Paul Eggert <eggert@twinsun.com>
7230 Fix some minor time-related bugs with POSIX time arguments.
7231 Some valid time stamps were being rejected (notably -1, and
7232 time stamps before 1900 on 64-bit hosts). And some invalid
7233 time stamps were being accepted, e.g. September 31.
7235 * posixtm.h (posixtime): Return bool instead of time_t, so
7236 that we can return (time_t) -1 successfully.
7237 * posixtm.c: Likewise.
7238 [HAVE_STDBOOL_H]: Include <stdbool.h>.
7239 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7240 (t): Remove static var.
7241 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7242 of static var. All uses changed.
7243 (year): Do not reject years before 1900; they can occur with
7245 (posix_time_parse): Do not check for out-of-range components;
7246 that is now the caller's responsibility, since our checks were
7247 only approximations.
7248 (posixtime): Use mktime to check for out-of-range components,
7249 since it knows them exactly.
7250 If mktime returns (time_t) -1, check whether an error actually occurred
7251 by invoking localtime on -1.
7252 (main) [TEST_POSIXTIME]: Check for input data errors, and report
7253 posixtime failures better.
7254 Improve the test data (in comments only).
7256 2003-05-30 <karl@gnu.org>
7258 * mktime.c: update from libc.
7260 2003-05-30 Bruno Haible <bruno@clisp.org>
7262 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7263 * localcharset.h: Likewise.
7264 * localcharset.c: Likewise.
7266 2003-05-28 Paul Eggert <eggert@twinsun.com>
7268 Assume the headers required for C89 freestanding compilers.
7269 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7270 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7271 without checking for HAVE_LIMITS_H.
7272 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7273 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7275 * fatal.c: Include <stdarg.h> without checking for __STDC__.
7276 * exclude.c: Include <stdbool.h> unconditionally.
7277 * tempname.c: Include <stddef.h> unconditionally.
7278 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7279 * modechange.c, rpmatch.c (NULL): Don't define, since
7280 <stddef.h> does that.
7281 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7282 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7283 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7284 * xstrtol.c: Likewise.
7285 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7286 * savedir.c: Include <stddef.h> instead of defining NULL.
7288 * addext.c (addext): Use assignment rather than cast, to avoid
7289 warnings on some platforms.
7291 * mktime.c (__mktime_internal): Do not reject negative timestamps
7294 2003-05-10 Bruno Haible <bruno@clisp.org>
7296 * linebreak.c (iconv_string_length): Don't return -1 just because the
7297 string is longer than 4 KB.
7299 2003-05-12 Jim Meyering <jim@meyering.net>
7301 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7302 the space-padded-by-default conversion specifiers, %e, %k, %l.
7304 2003-05-03 Bruno Haible <bruno@clisp.org>
7306 Upgrade to Unicode-4.0.
7307 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7308 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7309 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7310 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7311 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7312 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7313 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7314 Change width of U+E0100..U+E01EF from 1 to 0.
7316 2003-04-25 Bruno Haible <bruno@clisp.org>
7318 * copy-file.c: Include <stddef.h>, for size_t.
7320 2003-04-25 Jim Meyering <jim@meyering.net>
7322 * copy-file.c (copy_file_preserving): Declare buf_size to be
7323 of type size_t, not int.
7325 2003-04-11 Jim Meyering <jim@meyering.net>
7327 Merge changes from Coreutils.
7329 2003-03-22 Jim Meyering <jim@meyering.net>
7331 * strftime.c (widen): Cast alloca return value to proper type.
7333 2003-01-19 Ulrich Drepper <drepper@redhat.com>
7336 * strftime.c (my_strftime): Handle very large width
7337 specifications for numeric values correctly. Improve checks for
7340 2003-01-19 Jim Meyering <jim@meyering.net>
7342 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7343 (nl_get_alt_digit) [! defined my_strftime]: Define.
7344 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7345 _nl_get_alt_digit and _nl_get_walt_digit.
7347 * strftime.c (my_strftime): Merge in locale-related changes from libc.
7348 These changes have no effect outside of _LIBC.
7350 2003-04-10 Bruno Haible <bruno@clisp.org>
7352 * findprog.h: New file, from GNU gettext.
7353 * findprog.c: New file, from GNU gettext.
7355 2003-04-05 Jim Meyering <jim@meyering.net>
7357 Merge changes from Coreutils.
7359 * exclude.h (PARAMS): Remove definition and uses.
7360 * exclude.c: Remove uses of `PARAMS'.
7362 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7363 Add test-cases for DOS filenames. Declare program_name.
7364 (main): Set up program_name. Patch by Rich Dawe.
7366 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7368 Use mntctl's return value to drive the entry-processing loop, since
7369 we can't rely on the value of the vmt_length member in the last
7370 entry. On some systems doing so could result in exhausting
7371 virtual memory. Based in part on a patch from Mike Jetzer.
7373 2003-04-04 Bruno Haible <bruno@clisp.org>
7375 * linebreak.h: New file, from GNU gettext.
7376 * linebreak.c: New file, from GNU gettext with slight modifications.
7377 * lbrkprop.h: New file, from GNU gettext.
7379 2003-04-03 Bruno Haible <bruno@clisp.org>
7381 * utf8-ucs4.h: New file, from GNU gettext.
7382 * utf16-ucs4.h: New file, from GNU gettext.
7383 * ucs4-utf8.h: New file, from GNU gettext.
7384 * ucs4-utf16.h: New file, from GNU gettext.
7386 2003-04-02 Bruno Haible <bruno@clisp.org>
7388 * binary-io.h: New file, from GNU gettext.
7390 2003-04-01 Bruno Haible <bruno@clisp.org>
7392 * pathname.h: New file, from GNU gettext.
7393 * concatpath.c: New file, from GNU gettext.
7395 2003-03-30 Bruno Haible <bruno@clisp.org>
7397 * copy-file.c (copy_file_preserving): Don't set owner if the function
7398 chown() doesn't exist.
7400 2003-03-28 Bruno Haible <bruno@clisp.org>
7402 * copy-file.h: New file, from GNU gettext.
7403 * copy-file.c: New file, from GNU gettext.
7405 2003-03-18 Jim Meyering <jim@meyering.net>
7407 * quote.c (quote_n): Fix typo in comment.
7409 2003-03-14 Jim Meyering <jim@meyering.net>
7411 Merge changes from Coreutils.
7412 * obstack.h (obstack_object_size): Declare temporary, __o,
7413 to be const, in order to avoid warnings.
7414 (obstack_room): Likewise.
7415 (obstack_empty_p): Likewise.
7417 2003-03-13 Paul Eggert <eggert@twinsun.com>
7419 Merge changes from Bison.
7420 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7421 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7422 when compiling Bison 1.875's `bitset bset = obstack_alloc
7423 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7424 * hash.c: Include <stdbool.h> unconditionally.
7426 2003-03-09 Paul Eggert <eggert@twinsun.com>
7428 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7429 Reported by Bruce Becker; see:
7430 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7432 2003-03-03 Paul Eggert <eggert@twinsun.com>
7433 Bruno Haible <bruno@clisp.org>
7435 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7436 Reported by John Hughes, see
7437 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7439 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
7441 * poll_.h: New file.
7444 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
7446 * mathl.h: New file.
7447 * acosl.c: New file.
7448 * asinl.c: New file.
7449 * atanl.c: New file.
7450 * ceill.c: New file.
7453 * floorl.c: New file.
7454 * frexpl.c: New file.
7455 * ldexpl.c: New file.
7457 * sincosl.c: New file.
7459 * sqrtl.c: New file.
7461 * trigl.c: New file.
7462 * trigl.h: New file.
7464 2003-02-17 Bruno Haible <bruno@clisp.org>
7466 * mkdtemp.h: New file, from GNU gettext.
7467 * mkdtemp.c: New file, from GNU gettext.
7469 2003-01-31 Bruno Haible <bruno@clisp.org>
7471 * rename.c: #undef rename before defining rpl_rename.
7472 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7474 2003-01-30 Bruno Haible <bruno@clisp.org>
7476 * printf-args.h: New file, from GNU gettext.
7477 * printf-args.c: New file, from GNU gettext.
7478 * printf-parse.h: New file, from GNU gettext.
7479 * printf-parse.c: New file, from GNU gettext.
7480 * vasnprintf.h: New file, from GNU gettext.
7481 * vasnprintf.c: New file, from GNU gettext.
7482 * asnprintf.c: New file, from GNU gettext.
7483 * vasprintf.h: New file, from GNU gettext with modifications.
7484 * vasprintf.c: New file, from GNU gettext.
7485 * asprintf.c: New file, from GNU gettext.
7487 2003-01-29 Bruno Haible <bruno@clisp.org>
7489 * stpncpy.h: New file, from GNU gettext with modifications.
7490 * stpncpy.c: New file, from GNU gettext with modifications.
7492 2003-01-28 Bruno Haible <bruno@clisp.org>
7494 * c-ctype.h: New file, from GNU gettext, with changes suggested by
7496 * c-ctype.c: New file, from GNU gettext, with changes suggested by
7499 2003-01-27 Bruno Haible <bruno@clisp.org>
7501 * xsetenv.h: New file, from GNU gettext.
7502 * xsetenv.c: New file, from GNU gettext.
7504 2003-01-23 Bruno Haible <bruno@clisp.org>
7506 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7508 2003-01-22 Bruno Haible <bruno@clisp.org>
7510 * exit.h: New file, from GNU gettext.
7512 2003-01-11 Bruno Haible <bruno@clisp.org>
7514 * stpcpy.h (stpcpy): Use ANSI C function declarations.
7515 * strcase.h (strcasecmp, strncasecmp): Likewise.
7517 2003-01-14 Jim Meyering <jim@meyering.net>
7519 * same.c (same_name): Tweak a comment.
7521 2003-01-11 Bruno Haible <bruno@clisp.org>
7523 * same.c (same_name): Reorder tests so as to avoid calling stat()
7524 when a string comparison is sufficient.
7526 2003-01-11 Bruno Haible <bruno@clisp.org>
7528 * readtokens.c (readtoken): Cast character to 'unsigned char', not
7531 2003-01-11 Bruno Haible <bruno@clisp.org>
7533 * hash-pjw.c: Add comment about low quality of this function.
7535 2003-01-12 Paul Eggert <eggert@twinsun.com>
7537 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7538 to avoid collisions with libcurses and libreadline.
7540 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7541 * getstr.h, getstr.c: Remove.
7542 * getline.c: Include "getline.h", to check interface.
7543 Move body of old getstr.c here: this defines MIN_CHUNK and
7544 declares getdelim2, which is renamed from getstr.
7545 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7547 * linebuffer.c (readlinebuffer): Renamed from readline.
7549 * linebuffer.h: Likewise.
7550 (readline): Remove backward-compatibility macro.
7552 2003-01-12 Jim Meyering <jim@meyering.net>
7554 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
7556 2003-01-10 Bruno Haible <bruno@clisp.org>
7558 * alloca_.h: New file.
7559 * getdate.y: Unconditionally include alloca.h.
7560 * makepath.c: Likewise.
7561 * setenv.c: Likewise.
7562 * userspec.c: Likewise.
7564 2003-01-09 Bruno Haible <bruno@clisp.org>
7566 * stdbool.h.in: New file.
7568 2003-01-08 Bruno Haible <bruno@clisp.org>
7570 * safe-read.c: Include specification header first, to ensure its
7572 * full-write.c: Likewise.
7574 2003-01-08 Jim Meyering <jim@meyering.net>
7576 * full-write.c: Undefine and define-away `const' after inclusion
7577 of errno.h, not before. Suggestion from Bruno Haible.
7579 2003-01-07 Jim Meyering <jim@meyering.net>
7581 * full-write.c: Rework so that it may serve to define full_read, too.
7582 * full-read.c: Simply #define FULL_READ and include full-write.c.
7584 2003-01-06 Jim Meyering <jim@meyering.net>
7586 * version-etc.c: Update year in translatable copyright string.
7588 2002-12-25 Bruno Haible <bruno@clisp.org>
7590 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7591 * xstrtol.h: Likewise.
7592 * xstrtoimax.c: Likewise.
7593 * xstrtoumax.c: Likewise.
7594 * human.h: Likewise.
7596 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7597 on systems that have <inttypes.h> but not <stdint.h>.
7599 2002-12-31 Paul Eggert <eggert@twinsun.com>
7601 * memcoll.c (memcoll): Fall back on a simple algorithm using
7602 memcmp if strcoll doesn't work.
7604 2002-12-23 Bruno Haible <bruno@clisp.org>
7606 * localcharset.h: New file.
7607 * localcharset.c: Include it.
7608 * unicodeio.c: Likewise.
7610 2002-12-22 Bruno Haible <bruno@clisp.org>
7612 * utime.c (utime_null): No need to call ftruncate if the file was
7615 2002-12-23 Bruno Haible <bruno@clisp.org>
7617 * memcoll.c (STRCOLL): New macro.
7620 2002-12-22 Bruno Haible <bruno@clisp.org>
7622 * getstr.h (getstr): Define, to avoid clash with libcurses.
7623 * linebuffer.h (readline): Define, to avoid clash with libreadline.
7625 2002-12-22 Bruno Haible <bruno@clisp.org>
7627 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7629 2002-12-23 Bruno Haible <bruno@clisp.org>
7631 * getline.h: Include <stddef.h>, for size_t.
7633 * unicodeio.h: Include <stddef.h>, for size_t.
7634 * unicodeio.c: Don't include <stddef.h>.
7636 2002-12-17 Bruno Haible <bruno@clisp.org>
7638 * canon-host.c (strdup): Remove unused declaration.
7640 * fsusage.c: Include full_read.h.
7641 (get_fs_usage): Use full_read instead of safe_read.
7643 * utime.c (utime_null): Use SAFE_READ_ERROR.
7645 2002-12-11 Bruno Haible <bruno@clisp.org>
7647 * setenv.h: Rewritten to cope with systems that have setenv() but not
7649 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7652 2002-12-11 Bruno Haible <bruno@clisp.org>
7654 * setenv.c (alloca): Fall back to malloc.
7656 (setenv): Use freea() to free memory allocated with alloca().
7658 2002-11-13 Bruno Haible <bruno@clisp.org>
7660 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7661 function declarations.
7662 * unsetenv.c (unsetenv): Likewise.
7664 2002-03-04 Bruno Haible <bruno@clisp.org>
7666 Portability to AIX 4.3.3.
7667 * unsetenv.c: New file, extracted from setenv.c.
7668 * setenv.c: Move the unsetenv() function to unsetenv.c.
7670 2001-12-20 Bruno Haible <bruno@clisp.org>
7672 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7673 use malloc instead. For SunOS 4.
7675 2001-12-11 Bruno Haible <bruno@clisp.org>
7677 * setenv.c: Declare alloca.
7678 (compar_fn_t): New typedef.
7679 (KNOWN_VALUE, STORE_VALUE): Use it.
7681 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7684 2002-12-10 Paul Eggert <eggert@twinsun.com>
7686 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7687 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7688 Choose values that are less likely to collide with system fnmatch
7690 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7691 defined (e.g., a pure POSIX system).
7692 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7693 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7695 2002-12-06 Jim Meyering <jim@meyering.net>
7697 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7699 Merge in changes from libc's misc/error.c, in preparation
7700 for the merge of gnulib's changes back into libc.
7702 * error.c (_): Define only if not already defined.
7703 Move definition to follow all #include directives.
7704 Include unlocked-io.h only if !_LIBC.
7705 [_LIBC]: Include <libio/libioP.h>.
7706 [USE_IN_LIBIO]: Include <libio/iolibio.h>
7707 (fflush): Tweak definition to use INTUSE.
7710 2002-12-05 Paul Eggert <eggert@twinsun.com>
7712 * alloca.c [defined emacs]: Include "lisp.h".
7713 (xalloc_die) [defined emacs]: New macro.
7714 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7715 [! defined emacs]: Include <xalloc.h>.
7716 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7717 (pointer): Typedef to POINTER_TYPE *.
7718 (malloc): Remove decl; we now always use xmalloc.
7719 (alloca): Use old-style definition, since Emacs needs this.
7720 Check for arithmetic overflow when computing combined size.
7722 2002-12-04 Paul Eggert <eggert@twinsun.com>
7724 Do not generate unlocked-io.h automatically, since it's easier to
7725 maintain it by hand.
7727 * unlocked-io.h: New file, from GNU diffutils,
7728 but with proper copyright notice and attribution.
7730 * Makefile.am: Add copyright notice.
7731 (libfetish_a_SOURCES): Add unlocked-io.h.
7732 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7733 (DISTCLEANFILES, io_functions): Remove macros.
7734 (EXTRA_DIST): Remove gen_uio.
7735 (unlocked-io.h): Remove rule.
7737 2002-12-04 Jim Meyering <jim@meyering.net>
7739 Reflect the fact that stat.c and lstat.c are no longer generated.
7740 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7741 (DISTCLEANFILES): Likewise.
7742 (EXTRA_DIST): Likewise.
7743 (all_local): Don't depend on stat.c or lstat.c.
7744 (stat.c, lstat.c): Remove rules.
7745 (EXTRA_DIST): Remove xstat.in.
7747 * xstat.in: Remove file. Contents moved into stat.c.
7748 * stat.c: New file. Contents mostly from xstat.in.
7749 * stat.c: Rework so that it may serve to define rpl_lstat, too.
7750 * lstat.c: New file. Simply #define LSTAT and include stat.c.
7752 * safe-read.c: Rework so that it may serve to define safe_write, too.
7753 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7755 2002-12-03 Jim Meyering <jim@meyering.net>
7757 * safe-read.c, safe-write.c: Change variable names and comments, but
7758 not semantics, to minimize the differences between these two files.
7759 (safe_read): Change comment to mention SAFE_READ_ERROR.
7761 * safe-read.c (IS_EINTR): Define.
7762 (safe_read): Use IS_EINTR in place of in-function cpp directives.
7764 2002-12-02 Bruno Haible <bruno@clisp.org>
7766 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7767 Define, taken from safe-read.c.
7768 (INT_MAX): Provide fallback.
7769 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7770 * safe-write.h (SAFE_WRITE_ERROR): Define.
7772 * safe-read.c (EINTR): Remove definition.
7773 (safe_read): Don't use EINTR if it is absent.
7775 2002-12-02 Jim Meyering <jim@meyering.net>
7777 * safe-read.c (EINTR): Define.
7778 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7779 (INT_MAX): Provide fallback.
7780 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7782 * safe-read.h (SAFE_READ_ERROR): Define.
7784 2002-12-01 Jim Meyering <jim@meyering.net>
7786 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7787 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7789 2002-11-27 Paul Eggert <eggert@twinsun.com>
7791 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7792 hash_rehash): Replace `if (limit <= value) abort ();' with
7793 `if (! (value < limit)) abort ();', for readability.
7795 2002-11-26 <karl@gnu.org>
7797 * strdup.c: copy from libc again, with jim's ok.
7798 * .cppi-disable: re-add strdup.c
7800 2002-11-25 <karl@gnu.org>
7802 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7803 instead of "strtol.c".
7805 2002-11-25 Jim Meyering <jim@meyering.net>
7807 * mktime.c: Sync from libc, now that it has the latest fix.
7809 2002-11-24 <karl@gnu.org>
7811 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7812 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7814 2002-11-24 Jim Meyering <jim@meyering.net>
7816 Update from coreutils:
7818 * mktime.c: Merge in changes from libc.
7820 Avoid a link-time failure on some Linux systems.
7821 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7822 (__mon_yday): Declare with the STATIC attribute.
7823 (__mktime_internal): Likewise.
7824 Based on a report from Greg Schafer.
7826 2002-11-23 Jim Meyering <jim@meyering.net>
7828 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
7829 Use `unsigned', not `int', as type of index.
7831 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
7833 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
7835 2002-11-22 Paul Eggert <eggert@twinsun.com>
7837 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
7838 hint that one should use `if (! x) abort ();' rather than `assert
7839 (x);', and anyway it's one less thing to worry about configuring.
7840 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7841 hash_rehash, hash_insert): Use abort rather than assert.
7843 2002-11-22 Paul Eggert <eggert@twinsun.com>
7845 * quotearg.h: Allow multiple inclusion by surrounding with
7846 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
7847 so that we can be included first.
7848 (PARAMS): Remove; we now assume C89 or later. All uses removed.
7849 * quotearg.c: Include quotearg.h immediately after config.h.
7850 No need to include stddef.h or sys/types.h any more.
7851 Surround local include files with "", not "<>".
7852 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
7853 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
7854 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
7855 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7856 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7857 (ISPRINT): Remove; no longer needed now that we assume C89.
7859 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
7862 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
7863 quotearg_char): Use SIZE_MAX rather than
7864 (size_t) -1 when we are talking about "infinity".
7866 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
7868 2002-11-22 Bruno Haible <bruno@clisp.org>
7870 * safe-read.h: Assume C89. Add comments.
7871 (safe_read): Change return type to size_t.
7872 * safe-read.c (safe_read): Change return type to size_t. Handle byte
7873 counts > SSIZE_MAX correctly.
7874 * safe-write.h: New file.
7875 * safe-write.c: New file.
7876 * full-read.h: New file.
7877 * full-read.c: New file.
7878 * full-write.h: Assume C89. Add comments.
7879 * full-write.c: Include safe-write.h.
7880 (full_write): Rewritten to use safe_write.
7881 Suggested by Jim Meyering and Paul Eggert.
7883 2002-11-21 Bruno Haible <bruno@clisp.org>
7885 Remove case insensitive option matching.
7886 * argmatch.h (argcasematch): Remove declaration.
7887 (ARGCASEMATCH): Remove macro.
7888 (__xargmatch_internal): Remove case_sensitive argument.
7889 (XARGMATCH): Update.
7890 (XARGCASEMATCH): Remove macro.
7891 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
7892 case_sensitive argument.
7893 (argcasematch): Remove function.
7894 (__xargmatch_internal): Remove case_sensitive argument.
7895 (main): Use XARGMATCH instead of XARGCASEMATCH.
7897 * xmalloc.c: Change compile-time error message. Add comment about
7898 required autoconf version.
7900 2002-11-21 Jim Meyering <jim@meyering.net>
7902 * strdup.c (strdup): Tweak comment and initial #if/#include.
7904 Merge in changes from the coreutils.
7906 2002-09-25 Paul Eggert <eggert@twinsun.com>
7907 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
7908 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
7909 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
7910 int. Work more efficiently if X is the same width as uintmax_t.
7911 Do not compare X to -1, to avoid bogus compiler warning.
7912 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
7913 Don't assume that f_frsize and f_bsize are the same type.
7915 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
7918 * makepath.c (make_path): Restore umask *before* creating the final
7920 (make_path): Minor reformatting.
7922 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
7923 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
7925 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
7926 ones. At least on GNU/Linux systems, `auto' means something else.
7929 2002-11-20 Paul Eggert <eggert@twinsun.com>
7931 Merge argmatch cleanups from Bison. Assume C89.
7933 * argmatch.c: Include config.h here, not in argmatch.h.
7934 Include stdlib.h, for EXIT_FAILURE.
7935 Always include <string.h>, since we assume C89.
7936 (EXIT_FAILURE): Remove pre-C89 bug workaround.
7937 * argmatch.h: Do not include <config.h> or <sys/types.h>.
7938 Include <stddef.h> instead, since it's all we need for size_t.
7939 (PARAMS): Remove. All uses removed.
7940 (ARRAY_CARDINALITY): Do not bother to #undef.
7941 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
7942 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7943 Remove unnecessary parentheses.
7944 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7945 Insert necessary parentheses.
7946 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
7947 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
7949 2002-11-19 Bruno Haible <bruno@clisp.org>
7951 * mbswidth.c: Include mbswidth.h right at the beginning.
7952 * mbswidth.h: Include <stddef.h>, for size_t.
7954 * mbswidth.h (PARAMS): Remove macro.
7955 (mbswidth, mbsnwidth): Use ANSI C function declarations.
7956 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
7958 * gcd.h (PARAMS): Remove macro.
7959 (gcd): Use ANSI C function declarations.
7960 * gcd.c (gcd): Likewise.
7962 2002-11-15 Bruno Haible <bruno@clisp.org>
7964 * strcspn.c: Include <stddef.h>.
7965 (strcspn): Use ANSI C function declaration. Change return type to
7967 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
7968 (strpbrk): Use NULL.
7969 * strpbrk.h (PARAMS): Remove macro.
7970 (strpbrk): Use ANSI C function declaration.
7971 * strstr.c: Don't include <sys/types.h>.
7972 * strstr.h (PARAMS): Remove macro.
7973 (strstr): Use ANSI C function declarations.
7975 2002-11-06 Bruno Haible <bruno@clisp.org>
7977 * gcd.h (gcd): Change argument type to 'unsigned long'.
7978 * gcd.c (gcd): Likewise.
7980 2002-11-05 Bruno Haible <bruno@clisp.org>
7982 * gcd.h: New file, from gettext-0.11.5.
7983 * gcd.c: New file, from gettext-0.11.5.
7985 2002-11-05 Bruno Haible <bruno@clisp.org>
7987 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7988 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7989 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7990 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7992 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7993 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7995 * closeout.c: Include gettext.h instead of <libintl.h>.
7996 * human.c: Include gettext.h instead of <libintl.h>.
7997 * quotearg.c: Include gettext.h instead of <libintl.h>.
7998 * rpmatch.c: Include gettext.h instead of <libintl.h>.
7999 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8000 * userspec.c: Include gettext.h instead of <libintl.h>.
8001 * version-etc.c: Include gettext.h instead of <libintl.h>.
8002 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8003 (textdomain): Remove definition.
8004 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8006 * long-options.c: Remove include of <libintl.h> and definition of _.
8007 * same.c: Remove include of <libintl.h> and definition of _.
8009 2002-11-04 Bruno Haible <bruno@clisp.org>
8011 * stpcpy.h: New file, from GNU gettext-0.11.5.
8012 * strcase.h: New file, from GNU gettext-0.11.5.
8013 * strpbrk.h: New file, from GNU gettext-0.11.5.
8014 * strstr.h: New file, from GNU gettext-0.11.5.
8015 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8017 2002-05-09 Bruno Haible <bruno@clisp.org>
8019 * config.charset: Update for newest glibc. Add canonical names
8020 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8022 2002-05-09 Bruno Haible <bruno@clisp.org>
8024 * localcharset.c (get_charset_aliases): Add more Windows specific
8027 2002-05-08 Owen Taylor <otaylor@redhat.com>
8029 * config.charset: A few additions for Solaris.
8031 2001-12-05 Bruno Haible <bruno@clisp.org>
8033 * localcharset.c (locale_charset): Don't return an empty string.
8035 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8037 * config.charset: msdos in uk_UA uses CP1125.
8039 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8041 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8042 * localcharset.c (locale_charset): Declare as extern "C".
8044 2002-02-15 Bruno Haible <bruno@clisp.org>
8046 * config.charset [msdosdjgpp]: For Russian, use CP866.
8048 2002-02-11 Bruno Haible <bruno@clisp.org>
8050 * config.charset: Add support for NetBSD.
8052 2002-09-25 <karl@gnu.org>
8054 * strdup.c: copy from libc/string (via ../config/srclist*).
8055 * getopt*: copy from libc/posix.
8056 * gettext.h: copy from gettext.
8057 * .cppi-disable: add strdup.c, gettext.h.
8059 2002-07-01 Jim Meyering <meyering@lucent.com>
8061 * c-stack.c: Include sys/time.h.
8062 From Volker Borchert.
8064 2002-06-11 Paul Eggert <eggert@twinsun.com>
8066 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8067 New macro. Use it uniformly instead of
8068 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8069 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8070 reported by Vin Shelton.
8072 2002-06-22 Jim Meyering <meyering@lucent.com>
8074 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8075 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8077 2002-06-22 Paul Eggert <eggert@twinsun.com>
8079 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8080 Do not assume SA_SIGINFO behavior.
8081 Bug reported by Jim Meyering on NetBSD 1.5.2.
8083 2002-06-22 Jim Meyering <meyering@lucent.com>
8085 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8087 * exitfail.c, exitfail.h: Likewise.
8088 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8090 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8092 (EXTRA_DIST): Add fnmatch_loop.c.
8093 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8095 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8096 * fnmatch.c: Update from diffutils-2.8.2.
8097 * fnmatch_.h: New file. From diffutils-2.8.2.
8098 * fnmatch.h: Remove file.
8100 2002-06-18 Paul Eggert <eggert@twinsun.com>
8102 * file-type.h: Report an error if neither S_ISREG nor
8103 S_IFREG is defined, instead of using a test specific to glibc
8104 2.2. This should be safe, since POSIX requires S_ISREG and
8105 Unix Version 7 had S_IFREG. We don't need to check for
8106 <sys/types.h> since we don't use any symbols that it defines.
8108 2002-06-15 Jim Meyering <meyering@lucent.com>
8110 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8111 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8112 have been included before this file.
8114 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8116 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8117 so that each temporary file name is unique and valid in the first
8118 8 characters, for operation under DOS.
8120 2002-06-15 Jim Meyering <meyering@lucent.com>
8122 Work even with DJGPP 2.03, which lacks support for symlinks.
8124 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8126 * lchown.c (S_ISLNK): Likewise.
8128 2002-06-14 Jim Meyering <meyering@lucent.com>
8130 * file-type.h: Use the version from diffutils-2.8.2.
8131 * file-type.c: Likewise.
8133 2002-05-27 Jim Meyering <meyering@lucent.com>
8135 Fix a problem seen only on nonconforming systems whereby ls.c's
8136 use of localtime, and then of gettimeofday would cause trouble:
8137 the localtime call used to initialize rpl_gettimeofday's save
8138 mechanism would clobber ls's current local time information so
8139 that in any long listing the first file would always be listed
8140 with date 1970-01-01. Analysis by Volker Borchert.
8142 * gettimeofday.c (localtime): Undefine.
8143 (rpl_localtime): New function.
8145 2002-05-22 Jim Meyering <meyering@lucent.com>
8147 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8148 * file-type.h: New file.
8149 * file-type.c (file_type): New file/function. Extracted from diffutils.
8151 2002-04-29 Paul Eggert <eggert@twinsun.com>
8153 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8155 2002-04-28 Paul Eggert <eggert@twinsun.com>
8157 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8158 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8159 of 127, since 64 is the largest conceivable number for ancient
8161 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8163 2002-04-28 Jim Meyering <meyering@lucent.com>
8165 * sig2str.c (WTERMSIG): Remove definition (unused).
8167 2002-04-28 Paul Eggert <eggert@twinsun.com>
8169 * sig2str.h, sig2str.c: New files.
8170 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8172 2002-04-24 Jim Meyering <meyering@lucent.com>
8174 * gettext.h: New file, from Gettext.
8175 * Makefile.am (INCLUDES): Remove -I../intl.
8176 (libfetish_a_SOURCES): Add gettext.h.
8178 2002-04-16 Jim Meyering <meyering@lucent.com>
8180 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8181 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8182 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8184 2002-04-12 Jim Meyering <meyering@lucent.com>
8186 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8188 2002-03-10 Jim Meyering <meyering@lucent.com>
8190 * makepath.c (make_path): Remove a comma from a diagnostic.
8191 Suggestion from Santiago Vila.
8193 2002-03-08 Jim Meyering <meyering@lucent.com>
8195 * rename.c: Mention that this wrapper is needed also on
8196 mips-dec-ultrix4.4 systems.
8198 2002-03-02 Jim Meyering <meyering@lucent.com>
8200 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8201 not HAVE_CLOCK_SETTIME.
8203 2002-02-27 Paul Eggert <eggert@twinsun.com>
8205 * nanosleep.h: Rename to....
8206 * timespec.h: New name for nanosleep.h. All uses changed.
8208 * gettime.c: New file.
8209 * settime.c: New file.
8212 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8213 timespec.h. Remove nanosleep.h.
8215 2002-02-25 Paul Eggert <eggert@twinsun.com>
8217 * acl.c, acl.h: New files.
8218 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8220 2002-02-24 Jim Meyering <meyering@lucent.com>
8222 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8223 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8224 cause trouble. Reported by Nelson Beebe.
8226 2002-02-23 Paul Eggert <eggert@twinsun.com>
8228 * path-concat.c (xpath_concat): Reorder code to pacify
8229 compilers that don't know that xalloc_die never returns.
8231 2002-02-20 Jim Meyering <meyering@lucent.com>
8233 * getdate.c: Regenerate using bison-1.33.
8235 2002-02-15 Paul Eggert <eggert@twinsun.com>
8237 * posixver.c, posixver.h: New files.
8238 * Makefile.am (libfetish_a_SOURCES): Add them.
8240 2002-02-02 Paul Eggert <eggert@twinsun.com>
8241 Bruno Haible <bruno@clisp.org>
8243 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8244 (fwrite_success_callback): New declaration.
8245 * unicodeio.c (unicode_to_mb): New function, extracted from
8246 print_unicode_char. Call failure callback instead of error.
8247 (fwrite_success_callback): New function.
8248 (exit_failure_callback): New function.
8249 (fallback_failure_callback): New function.
8250 (print_unicode_char): Call unicode_to_mb.
8252 2002-01-26 Jim Meyering <meyering@lucent.com>
8254 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8256 2002-01-22 Jim Meyering <meyering@lucent.com>
8258 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8259 Otherwise, some versions of automake would omit the rule that makes
8260 Makefile from Makefile.in.
8262 2001-01-21 Paul Eggert <eggert@twinsun.com>
8264 * xmemcoll.h, xmemcoll.c: New files.
8265 * Makefile.am (libfetish_a_SOURCES): Add them.
8266 * memcoll.c: Include errno.h, and declare errno if not defined.
8267 (memcoll): Set errno to zero if there is no error.
8269 * quotearg.c (quotearg_buffer_restyled):
8270 Fix bug with quoting buffers containing NUL when backslashing escapes.
8271 This bug was exposed by the other changes in this patch.
8272 (quotearg_n_options): New arg ARGSIZE.
8273 All callers changed.
8274 (quoting_options_from_style): New function.
8275 (quotearg_n_style): Use it.
8276 (quotearg_n_style_mem): New function.
8278 * quotearg.h (quotearg_n_style_mem): New function.
8280 2002-01-16 Jim Meyering <meyering@lucent.com>
8282 * getdate.y: Add three semicolons, each just before a closing brace.
8283 Bison (as of version 1.31) no longer papers over that mistake.
8285 2002-02-14 Paul Eggert <eggert@twinsun.com>
8287 * backupfile.c (ISDIGIT): Comment fix.
8288 * getdate.y (ISDIGIT): Likewise.
8289 * posixtm.c (ISDIGIT, year): Likewise.
8290 * strverscmp.c (ISDIGIT): Likewise.
8291 * userspec.c (ISDIGIT): Likewise.
8293 2002-01-05 Jim Meyering <meyering@lucent.com>
8295 * version-etc.c (version_etc_copyright): Update copyright year.
8297 2001-01-19 Paul Eggert <eggert@twinsun.com>
8299 * closeout.c (close_stdout_status): If ferror (stdout), do
8300 not silently exit merely because the output buffer happens to
8301 have nothing pending.
8303 2001-12-18 Paul Eggert <eggert@twinsun.com>
8305 See the big note in ../ChangeLog.
8306 * human.c (suffixes): Prefer K to k for 1024.
8307 (generate_suffix_backwards): New function.
8308 (human_readable_inexact): Use it.
8309 * xstrtol.c (__xstrtol): If there is no number but there
8310 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
8311 Accept 'K' as well as 'k'.
8313 2001-12-15 Jim Meyering <meyering@lucent.com>
8315 * regex.h (__restrict_arr): Update from libc.
8317 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8318 as `remote' if the name starts with `//'. Suggested by Michael Stone.
8321 2001-12-10 Jim Meyering <meyering@lucent.com>
8323 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8324 Instead, include "xalloc.h".
8325 (initbuffer): Don't cast xmalloc return value to char*.
8326 (readline): Reword comment.
8327 Don't cast xrealloc return value to char*
8330 2001-12-09 Jim Meyering <meyering@lucent.com>
8332 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8333 `signed and unsigned type in conditional expression'.
8334 * posixtm.c (posix_time_parse): Likewise.
8336 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8338 * readtokens.c (readtoken): Declare an index to be of type unsigned
8339 to avoid a pedantic warning.
8341 * getstr.c: Don't include assert.h.
8342 (getstr): Remove warning-evoking assertions.
8343 Return -1 if offset parameter is out of bounds.
8344 Change the type of a local from int to size_t.
8346 * strftime.c (my_strftime_localtime_r): Include this function
8347 definition in the `#if ! HAVE_TM_GMTOFF' block.
8349 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8350 Include xalloc.h instead.
8352 2001-12-02 Jim Meyering <meyering@lucent.com>
8354 * tempname.c: Don't declare getenv, thus reverting the change of
8355 2001-11-18. It's no longer necessary, now that stdlib.h is always
8358 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8359 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
8361 2001-11-30 Akim Demaille <akim@epita.fr>
8363 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8364 before being defined.
8366 2001-11-27 Paul Eggert <eggert@twinsun.com>
8368 * quotearg.h (quotearg_n, quotearg_n_style):
8369 First arg is int, not unsigned.
8370 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8371 (SIZE_MAX, UINT_MAX): New macros.
8372 (quotearg_n_options): Abort if N is negative.
8373 Avoid overflow check on hosts where size_t is 64 bits and int
8374 is 32 bits, as overflow is impossible there.
8375 Fix off-by-one typo that caused unnecessary reallocation.
8377 2001-11-27 Jim Meyering <meyering@lucent.com>
8379 * tempname.c: Merge with version from libc.
8380 * regex.c: Likewise.
8382 * tempname.c: Include stdlib.h unconditionally. On some old systems
8383 for which STDC_HEADERS is 0, it was not included, resulting in a
8384 warning about an integer-to-pointer conversion problem with getenv.
8385 Reported by Volker Borchert.
8387 2001-11-26 Jim Meyering <meyering@lucent.com>
8389 * gtod.h: Remove file.
8390 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8391 * gettimeofday.c: Don't include gtod.h.
8392 (GTOD_init): Remove function.
8393 (rpl_gettimeofday): Do its job here instead, rather than aborting.
8394 Suggestion from Volker Borchert.
8396 2001-11-23 Jim Meyering <meyering@lucent.com>
8398 * hash.h (struct hash_table): Don't define here. Merely declare it.
8399 * hash.c (struct hash_table): Define it here instead.
8401 2001-11-22 Jim Meyering <meyering@lucent.com>
8403 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8405 2001-11-18 Paul Eggert <eggert@twinsun.com>
8407 * tempname.c (TMP_MAX): Remove; no longer needed.
8408 (TEMPORARIES): New macro.
8409 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
8410 removes an artificial limitation (e.g. HP-UX 10.20, where
8413 2001-11-18 Jim Meyering <meyering@lucent.com>
8415 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8418 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8419 files will be created before anything else.
8421 2001-11-17 Jim Meyering <meyering@lucent.com>
8423 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8424 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8425 rather than group writable. Patch by Juan F. Codagnone.
8427 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8428 Instead, include "xalloc.h".
8430 * mountlist.c: Include unlocked-io.h after all system headers.
8431 Remove explicit declarations of xmalloc, xrealloc,
8432 and xstrdup. Instead, include "xalloc.h".
8434 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8435 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8436 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8438 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8439 Reported by Padraig Brady.
8441 * mkstemp.c: #undef mkstemp.
8443 (rpl_mkstemp): Rename from mkstemp.
8446 2001-11-16 Jim Meyering <meyering@lucent.com>
8448 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8449 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8450 determine the amount of total physical memory, use pstat_getstatic.
8451 HPUX-11 doesn't define _SC_PHYS_PAGES.
8452 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8453 If sysconf couldn't be used to determine the amount of available
8454 physical memory, use both pstat_getstatic and pstat_getdynamic.
8455 Based on a patch from Bob Proulx.
8457 2001-11-05 Jim Meyering <meyering@lucent.com>
8459 * xstat.in (slash_aware_lstat): Correct a misleading comment.
8461 2001-11-03 Jim Meyering <meyering@lucent.com>
8463 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8464 in argmatch_to_argument call.
8466 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8469 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8470 e.g., a fault due to an attempt to free a NULL pointer.
8472 2001-11-01 Jim Meyering <meyering@lucent.com>
8474 * dirfd.c, dirfd.h: New files.
8475 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8477 * hash.c (hash_print) [TESTING]: Clean up.
8479 2001-10-22 Paul Eggert <eggert@twinsun.com>
8481 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8482 to avoid a warning if -Wall.
8484 2001-10-21 Paul Eggert <eggert@twinsun.com>
8486 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8488 2001-10-21 Jim Meyering <meyering@lucent.com>
8490 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
8491 this code would end up calling gettext even in packages built
8493 * getopt.c (_): Likewise.
8494 * regex.c (_): Likewise.
8496 2001-10-20 Paul Eggert <eggert@twinsun.com>
8498 * error.c (strerror_r): Do not declare unless !_LIBC.
8499 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8500 Use strerror_r that is only a macro, even if it is not a function.
8501 (strerror): Check for HAVE_DECL_STRERROR before declaring.
8502 (private_strerror): Use prototypes, not old-style function definition.
8503 (print_errno_message): New function.
8504 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8506 (error_tail, error, error_at_line): Use it.
8508 2001-10-11 Jim Meyering <meyering@lucent.com>
8510 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8511 and quote_n (1, ... to avoid clobbering a buffer.
8513 2001-10-05 Jim Meyering <meyering@lucent.com>
8515 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8516 * hash-pjw.c: New file (factored out of fileutils' remove.c).
8517 * hash-pjw.h: New file.
8519 2001-09-30 Jim Meyering <meyering@lucent.com>
8521 * mountlist.c [MOUNTED_GETFSSTAT]:
8522 Include <sys/ucred.h>, for Apple Darwin.
8523 Include sys/mount.h and sys/fs_types.h only if available.
8525 (read_filesystem_list): Use FS_TYPE.
8527 2001-09-29 Paul Eggert <eggert@twinsun.com>
8529 * exclude.c (excluded_filename): 0 -> false, since it's
8532 2001-09-28 Paul Eggert <eggert@twinsun.com>
8534 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8535 #defines strtoimax. Also treat the other strto* functions
8538 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8539 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8540 (strtoimax, strtoumax): Do not declare if already defined as a macro.
8542 2001-09-26 Jim Meyering <meyering@lucent.com>
8544 Most macros in unlocked-io.h had the wrong number of arguments.
8545 * gen-uio: New script.
8546 (USE_UNLOCKED_IO): Define to 1 if not already defined.
8547 * unlocked-io.hin: Remove file.
8548 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8549 rather than trying to embed it here.
8550 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
8551 Reported by Padraig Brady.
8553 2001-09-25 Volker Borchert <bt@teknon.de>
8555 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8557 2001-09-23 Jim Meyering <meyering@lucent.com>
8559 * mountlist.c: Remove useless parentheses in #if directives.
8560 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8561 the deprecated MOUNTED symbol is no longer defined in mntent.h.
8563 2001-09-22 Jim Meyering <meyering@lucent.com>
8565 * localcharset.c: Update from latest gettext.
8566 * config.charset: Likewise.
8568 2001-09-20 Jim Meyering <meyering@lucent.com>
8570 * xstrtol.c (strtoimax): Guard declaration with
8571 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8572 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8573 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8574 (strtoumax): Likewise, for completeness (it wasn't necessary).
8576 2001-09-06 Paul Eggert <eggert@twinsun.com>
8578 * strtoimax.c (HAVE_LONG_LONG):
8579 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8580 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8581 to work around bug in IBM C compiler.
8583 2001-09-16 Jim Meyering <meyering@lucent.com>
8585 * mkdir.c: New file.
8587 2001-09-04 Paul Eggert <eggert@twinsun.com>
8589 * xgetcwd.c: Revert some of the previous change; intead,
8590 fix the HAVE_GETCWD_NULL code to behave more like the
8591 !HAVE_GETCWD_NULL code used to.
8594 (xgetcwd): Do not return NULL when memory is exhausted; instead,
8597 2001-09-04 Paul Eggert <eggert@twinsun.com>
8599 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
8600 Use ssize_t, not int, to store result of readlink.
8601 Check for ssize_t overflow as well as size_t overflow,
8602 as POSIX says the result of readlink is implementation-defined
8603 when ssize_t overflows.
8604 Remove unnecessary cast to char*.
8605 Use free+malloc instead of realloc, as the storage doesn't need
8606 to be preserved and it's clearer and can be more efficient that way.
8607 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8608 * xreadlink.h (xreadlink): Update prototype.
8610 2001-09-03 Paul Eggert <eggert@twinsun.com>
8612 * exclude.c (fnmatch_no_wildcards): Fix confusion between
8613 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
8614 spotted by Jim Meyering.
8616 2001-09-03 Jim Meyering <meyering@lucent.com>
8618 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8620 2001-09-03 Paul Eggert <eggert@twinsun.com>
8622 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8623 like the HAVE_GETCWD_NULL code.
8624 Include pathmax.h if not HAVE_GETCWD.
8625 Do not include xalloc.h.
8626 (INITIAL_BUFFER_SIZE): New symbol.
8627 Do not use xmalloc / xrealloc, since the caller is responsible for
8628 handling errors. Preserve errno around `free' during failure.
8629 Do not overrun buffer when using getwd.
8631 2001-09-03 Paul Eggert <eggert@twinsun.com>
8633 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8634 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8636 2001-09-02 Jim Meyering <meyering@lucent.com>
8638 * error.c: Update from GNU libc.
8640 2001-09-01 Jim Meyering <meyering@lucent.com>
8642 * xreadlink.c: New file.
8643 * xreadlink.h: New file.
8644 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8646 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8647 doesn't conflict with sparc Solaris 7's definition in
8648 /usr/include/sys/int_types.h.
8650 * exclude.c: Use `""', not `<>' to #include non-system header files.
8651 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8652 and strncasecmp as r-values. Unixware didn't have declarations.
8654 2001-08-31 Jim Meyering <meyering@lucent.com>
8656 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8657 Use an initial, malloc'd, buffer of length 128 rather than
8658 a statically allocated one of length 1024.
8660 2001-08-30 Paul Eggert <eggert@twinsun.com>
8662 * xgetcwd.c: Don't include pathmax.h.
8663 Include stdlib.h and unistd.h if available.
8665 (xmalloc, xstrdup, free): Remove decls.
8666 (xgetcwd): Don't assume sizes fit in unsigned.
8667 Check for overflow when computing sizes.
8668 Simplify reallocation code.
8670 2001-08-28 Paul Eggert <eggert@twinsun.com>
8672 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8674 * strtoimax.c: Renamed from strtoxmax.c, removing the
8677 Also, make the following further changes to make this file's
8678 configuration more similar to that of strtol.c:
8679 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
8680 (strtoumax, uintmax_t, strtoull, strtol): Remove.
8681 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8682 (strtoimax): Renamed from strtoumax. All uses of unsigned values
8683 changed to signed values.
8685 And make the following changes as well:
8686 Fix copyright notice, as 1999 was missing.
8687 (verify): New macro.
8688 (strtoimax): Check sizes at compile-time, not run-time.
8689 Prefer strtol to strtoll if both work.
8690 (main): Remove; it was not that useful and was a pain to maintain.
8692 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8694 2001-08-30 Paul Eggert <eggert@twinsun.com>
8696 * savedir.c (savedir): Remove size parameter, as POSIX says that
8697 a directory's st_size can have an arbitrary value, so the old
8698 usage could waste an arbitrary amount of memory. All uses
8700 * savedir.h: Update prototype.
8702 2001-08-30 Paul Eggert <eggert@twinsun.com>
8704 * xstrtol.c (strtoimax): New decl.
8706 2001-08-28 Paul Eggert <eggert@twinsun.com>
8708 * xstrtol.h: Add copyright notice.
8709 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8710 LONGINT_INVALID_SUFFIX_CHAR.
8712 2001-08-30 Paul Eggert <eggert@twinsun.com>
8714 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8717 2001-08-30 Paul Eggert <eggert@twinsun.com>
8719 * hash.c: Remove '2001' from copyright notice.
8721 2001-08-30 Paul Eggert <eggert@twinsun.com>
8723 * full-write.h: New file.
8724 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8725 * full-write.c: Correct credits, as cccp.c no longer
8726 exists and anyway it was so heavily changed from the old cccp
8727 code as to be unrecognizable. Include full-write.h.
8728 (full_write) Return size_t, with short writes meaning failure.
8729 All callers changed. This fixes a bug with large buffers
8731 * utime.c: Include full-write.h.
8733 2001-08-30 Paul Eggert <eggert@twinsun.com>
8735 Merge 'exclude' changes from tar 1.13.22.
8736 This fixes one or two unlikely storage allocation overflow bugs,
8737 but doesn't change user-visible behavior otherwise.
8739 2001-08-30 Paul Eggert <eggert@twinsun.com>
8741 * exclude.c (bool): Declare, perhaps by including stdbool.h.
8742 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8743 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8744 Include if available.
8745 (<xalloc.h>): Include
8746 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8747 (verify): New macro. Use it to verify that EXCLUDE macros do not
8748 collide with FNM macros.
8749 (struct patopts): New struct.
8750 (struct exclude): Use it, as exclude patterns now come with options.
8751 (new_exclude): Support above changes.
8752 (new_exclude, add_exclude_file):
8753 Initial size must now be a power of two to simplify overflow checking.
8754 (free_exclude, fnmatch_no_wildcards): New function.
8755 (excluded_filename): No longer requires options arg, as the options
8756 are determined by add_exclude. Now returns bool, not int.
8757 (excluded_filename, add_exclude):
8758 Add support for the fancy new exclusion options.
8759 (add_exclude, add_exclude_file): Now takes int options arg.
8760 Check for arithmetic overflow when computing sizes.
8761 (add_exclude_file): xrealloc might modify errno, so don't
8762 realloc until after errno might be used.
8764 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8766 (free_exclude): New decl.
8767 (add_exclude, add_exclude_file): Now takes int options arg.
8768 (excluded_filename): No longer requires options arg, as the options
8769 are determined by add_exclude. Now returns bool, not int.
8771 2001-08-30 Paul Eggert <eggert@twinsun.com>
8773 * alloca.c (alloca): Arg is of type size_t, not unsigned.
8775 2001-08-27 Jim Meyering <meyering@lucent.com>
8777 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8779 * version-etc.c (N_): Remove definition.
8780 Revert most of last change.
8781 Instead, simply don't mark the `Copyright...' string for translation.
8782 Based on advice from Paul Eggert.
8784 * strtoxmax.c: Tweak comment.
8786 2001-08-26 Jim Meyering <meyering@lucent.com>
8788 * version-etc.c (version_etc_copyright_fmt): Replace literal year
8789 of copyright with `%s' so translators don't get an untranslated
8791 (COPYRIGHT_YEAR): Define.
8792 (version_etc): Use fprintf rather than fputs.
8793 Suggestion from Ulrich Drepper.
8795 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8797 * strtoll.c: New file, from GNU libc.
8798 * xstrtoimax.c: New file.
8800 * xstrtol.h: Add xstrtoimax.
8801 * strtoumax.c: New file. Simply include "strtoumax.c".
8802 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
8804 * strtoumax.c: Factor to work both for unsigned and signed types, ...
8805 * strtoxmax.c: ... then renamed to this.
8807 2001-08-13 Paul Eggert <eggert@twinsun.com>
8809 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8810 Port to Solaris 8, where 'sed' requires a space after the 'r'
8811 command, and where sh dislikes "$/". Clean up the spacing a bit.
8812 Redirect output to $tmp just once.
8814 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
8816 * addext.c (<errno.h>): Include.
8817 (errno): Declare if not defined.
8818 (addext): Work correctly when pathconf returns -1 and leaves
8819 errno alone because there is no limit. Also, work even if
8820 pathconf returns a value greater than SIZE_MAX.
8822 2001-08-12 Jim Meyering <meyering@lucent.com>
8824 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
8825 Simply `return getcwd (NULL, 0);'.
8826 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
8827 Use 1300 as initial value for length, not PATH_MAX.
8829 * pathmax.h: Clean up cpp syntax.
8831 2001-08-12 Jim Meyering <meyering@lucent.com>
8833 * gettimeofday.c: New file.
8835 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
8837 2001-08-04 Jim Meyering <meyering@lucent.com>
8839 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
8840 to get in sync with glibc.
8842 2001-08-03 Paul Eggert <eggert@twinsun.com>
8844 The following changes are from gettext 0.10.39 as maintained by
8847 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
8848 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
8849 with inverted sense. All uses changed.
8851 * mbswidth.c: Don't include <limits.h>.
8852 Include <stdlib.h> and <string.h> unconditionally.
8853 (iswcntrl, mbsinit, ISCNTRL): New macros.
8854 (mbsnwidth): Use K&R style function declarations.
8855 Don't bother checking for MB_LEN_MAX == 1, since the compiler
8856 can optimize it when MB_CUR_MAX == 1.
8857 The width of control characters is zero, not 1.
8859 2001-07-15 Jim Meyering <meyering@lucent.com>
8861 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
8862 (BUILT_SOURCES): Add unlocked-io.h.
8863 (io_functions): Define.
8864 (unlocked-io.h): New rule.
8865 (DISTCLEANFILES): Add unlocked-io.h.
8866 (all-local): Depend on unlocked-io.h, to ensure it is created.
8868 * unlocked-io.hin: New file
8870 * regex.c: Update from glibc.
8872 2001-07-05 Jim Meyering <meyering@lucent.com>
8874 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
8876 (libfetish_a_SOURCES): Put all .h files here instead.
8877 Remove a thus-exposed (better checks in automake) duplicate and
8878 two unnecessary .h files.
8880 2001-06-11 Jim Meyering <meyering@lucent.com>
8882 * regex.c: Update from GNU libc.
8884 2001-05-27 Jim Meyering <meyering@lucent.com>
8886 * readutmp.h (UT_TYPE): Define.
8888 2001-05-24 Jim Meyering <meyering@lucent.com>
8890 * argmatch.c: Include "quote.h".
8891 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
8892 quote function. Reported by Göran Uddeborg.
8894 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
8896 * dirname.c (dir_name): Compute append_dot using path, not newpath
8897 which is not yet declared.
8899 2001-05-11 Paul Eggert <eggert@twinsun.com>
8901 * Makefile.am (libfetish_a_SOURCES):
8902 Add strftime.c, since we now compile it on all hosts.
8904 * strftime.c (my_strftime):
8905 Define to nstrftime if emacs, but only if my_strftime is not defined.
8906 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
8907 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
8908 Add one more extra argument: a nanoseconds value.
8911 (my_strftime function): Add %N format.
8912 (emacs_strftimeu): Renamed from emacs_strftime,
8913 with extra ut argument.
8915 2001-05-11 Paul Eggert <eggert@twinsun.com>
8917 dirname code cleanup. base_name now behaves more compatibly
8918 with POSIX basename when given file names that have trailing
8919 slashes, and similarly for dir_name. Add new primitives
8920 base_len and dir_len. Put the directory-name-related decls
8923 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
8924 * backupfile.c (base_name): Likewise.
8925 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
8926 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
8927 * makepath.c (strip_trailing_slashes): Likewise.
8928 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
8930 * rename.c (strip_trailing_slashes): Likewise.
8931 * same.c (base_name): Likewise.
8932 * stripslash.c (ISSLASH): Likewise.
8934 * addext.c: Include <dirname.h> after size_t is defined.
8935 * backupfile.c: Likewise.
8937 * addext.c (addext): Use base_len to trim redundant
8938 trailing slashes instead of doing it ourselves.
8939 But do not trim the last slash if it is not redundant.
8941 * backupfile.c (find_backup_file_name,
8942 max_backup_version): Use base_len instead of rolling it ourselves.
8943 Handle the case of "" and (on DOS) "C:" correctly.
8945 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
8946 Include <string.h>, <dirname.h>.
8947 (base_name): Allow file names ending in slashes, other than names
8948 that are all slashes. In this case, return the basename followed
8949 by the slashes. This is more general, and can be used in places
8950 where the original base_name purposely had an assertion failure.
8951 (base_len): New function.
8953 * dirname.c: Include <string.h> instead of <stdlib.h>.
8954 Do not include <assert.h>; no longer needed.
8956 (memrchr): Remove decl.
8957 (dir_name_r): Remove.
8958 (dir_len): Renamed from dirlen. All callers changed.
8959 Rewrite in terms of base_name, for simplicity and consistency.
8960 (dir_name): Never return NULL. All callers changed.
8961 Do not include <stdlib.h> in test program; no longer needed.
8962 return 0; is fine for test program.
8964 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8966 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8968 * path-concat.c (path_concat): Use base_len to compute
8969 base length, not strlen; this means we cannot rely on memcpy
8972 * same.c (STREQ): Remove.
8973 (same_name): Handle the case where the basename ends in trailing '/'.
8975 * stripslash.c (strip_trailing_slashes): Return nonzero if
8976 a slash was stripped. Do not strip the last slash after a
8979 2001-04-08 Jim Meyering <meyering@lucent.com>
8981 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
8982 recomputed; that's necessary when the offset spans a DST transition.
8983 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
8985 2001-04-02 Jim Meyering <meyering@lucent.com>
8987 * regex.h, regex.c: Update from GNU libc.
8989 2001-03-19 Paul Eggert <eggert@twinsun.com>
8991 * version-etc.c (version_etc_copyright): Update to 2001.
8993 2001-03-16 Paul Eggert <eggert@twinsun.com>
8995 * tempname.c (uint64_t): Define to uintmax_t if
8996 not defined, and if UINT64_MAX is not defined.
8997 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
8998 Reported by John David Anglin.
9000 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9002 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9003 alias if codeset is empty.
9004 * config.charset (BeOS): Use wildcard syntax.
9006 2001-03-13 Jim Meyering <meyering@lucent.com>
9008 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9009 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9012 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9014 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9016 * unicodeio.c (print_unicode_char): Simplify accordingly.
9018 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9020 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9021 support for DOS/DJGPP.
9023 2001-02-28 Paul Eggert <eggert@twinsun.com>
9025 * Makefile.am (libfetish_a_SOURCES):
9026 Add dup-safer.c, fopen-safer.c.
9027 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9029 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9031 2001-02-25 Paul Eggert <eggert@twinsun.com>
9033 The mkstemp replacement is taken from glibc 2.2.2, with some
9034 portability fixes for use outside glibc, as follows:
9036 * tempname.c (struct_stat64): New macro.
9037 (direxists, __gen_tempname): Use it.
9038 This avoids a portability problem with Solaris 8.
9040 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9041 (<stddef.h>, <stdint.h>, <string.h>):
9042 Include only if STDC_HEADERS || _LIBC.
9043 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9044 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9045 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9046 (__set_errno): Define this macro if <errno.h> doesn't.
9047 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9048 Define these macros if <stdio.h> doesn't.
9049 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9050 Define these macros if <sys/stat.h>
9051 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9052 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9053 __xstat64): Define if not _LIBC.
9054 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9055 (__gen_tempname): Invoke gettimeofday only if
9056 HAVE_GETTIMEOFDAY || _LIBC;
9057 otherwise, fall back on plain "time".
9058 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9060 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9062 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9064 2001-02-17 Jim Meyering <meyering@lucent.com>
9066 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9067 around included file name.
9069 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9071 * strftime.c: Update from GNU libc (the only changes were to comments).
9073 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9075 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9077 2001-02-17 Paul Eggert <eggert@twinsun.com>
9079 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9080 Remove workaround macros for hosts that have mbrtowc but not
9081 mbstate_t, as we now insist on proper declarations for both
9082 before using mbrtowc.
9084 2001-02-17 Jim Meyering <meyering@lucent.com>
9086 * regex.c: Update from libc.
9088 2001-02-16 Paul Eggert <eggert@twinsun.com>
9090 * alloca.c (malloc): Undef before defining, since stdlib.h
9091 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9092 Reported by Mark Hounschell via Paul Eggert.
9094 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9096 * config.charset: Update for FreeBSD 4.2.
9098 2001-01-26 Jim Meyering <meyering@lucent.com>
9100 * quotearg.c: Include stddef.h.
9101 * quote.c: Include stddef.h.
9102 Reported by Axel Kittenberger.
9104 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9105 line in double quotes so that it evokes a better diagnostic.
9106 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9107 Reported by Axel Kittenberger.
9109 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9111 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9112 to avoid a warning. Add back 'const' to inptr.
9114 2001-01-16 Jim Meyering <meyering@lucent.com>
9116 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9119 2001-01-14 Jim Meyering <meyering@lucent.com>
9121 * rename.c: New file. From Volker Borchert.
9122 Include stdlib.h, string.h or strings.h, and xalloc.h.
9123 Use strip_trailing_slashes rather than open-coding it.
9125 2001-01-03 Paul Eggert <eggert@twinsun.com>
9127 * strftime.c: Sync with glibc time/strftime.c 1.81.
9129 2001-01-03 Jim Meyering <meyering@lucent.com>
9131 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9132 local `inptr' to avoid warning with some system declarations of iconv.
9134 2000-12-29 Paul Eggert <eggert@twinsun.com>
9136 * modechange.c: Do not assume that mode_t uses the
9137 traditional octal encoding. E.g. "chmod 1 FOO" should set
9138 the other-execute bit of FOO even if S_IXOTH != 1.
9140 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9141 WOTH, XOTH, ALLM): New macros.
9142 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9143 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9145 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9146 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9148 No need to use uintmax_t; unsigned long is long enough.
9149 Don't bother to get suffix since we don't use it.
9151 2000-12-24 Jim Meyering <meyering@lucent.com>
9153 * hash.c (is_prime): Return explicit boolean values.
9154 (hash_get_first): Return NULL to appease Irix5.6's 89.
9155 Reported by Nelson Beebe.
9157 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9159 * localcharset.c (locale_charset): Add support for Win32.
9161 2000-12-18 Paul Eggert <eggert@twinsun.com>
9163 * physmem.h, physmem.c: New files.
9165 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9166 (noinst_HEADERS): Add physmem.h.
9168 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9169 't' for compatibility with Solaris 8 sort.
9171 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9173 * config.charset: Add support for BeOS.
9175 2000-12-16 Jim Meyering <meyering@lucent.com>
9177 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9178 SHELLS_FILE to a file name that's useful on djgpp systems.
9180 (ADDITIONAL_DEFAULT_SHELLS): Define.
9181 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9182 Based mostly on a patch from Prashant TR.
9184 2000-12-16 Jim Meyering <meyering@lucent.com>
9186 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9187 N and M) would have treated it like `chown N:N FILE'.
9189 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9191 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9193 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9194 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9195 to the list of canonical encodings. Rename EUC-CN to GB2312.
9197 2000-12-08 Andreas Schwab <schwab@suse.de>
9199 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9200 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9202 2000-12-07 Jim Meyering <meyering@lucent.com>
9204 * stripslash.c (ISSLASH): Define.
9205 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9208 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9209 (dir_name_r): Declare this function as static.
9210 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9211 manifest itself on a name containing a mix of slashes and
9213 Make this function work with names starting with a DOS-style
9214 drive letter and colon prefix.
9215 (dir_name): Append `.' if necessary.
9216 Based mostly on patches from Prashant TR and Eli Zaretskii.
9218 * dirname.h (dir_name_r): Remove prototype.
9220 2000-12-05 Jim Meyering <meyering@lucent.com>
9222 * dirname.c (dir_name_r): Add `const' in a few local declarations.
9224 2000-12-04 Jim Meyering <meyering@lucent.com>
9226 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9227 Also include memory.h, stdlib.h, unistd.h if appropriate.
9228 Reported by Andreas Jaeger (conflicting declaration of malloc).
9230 2000-12-02 Jim Meyering <meyering@lucent.com>
9232 * closeout.h: Make idempotent, to avoid some obscure warnings.
9234 2000-12-01 Paul Eggert <eggert@twinsun.com>
9236 * memrchr.c: Include <config.h> before any system include file.
9238 2000-11-29 Paul Eggert <eggert@twinsun.com>
9240 * dirname.c (dir_name_r): Fix typo: int -> size_t.
9242 2000-11-26 Jim Meyering <meyering@lucent.com>
9244 * memcoll.c: Include sys/types.h. From Werner Almesberger.
9246 2000-11-22 Paul Eggert <eggert@twinsun.com>
9248 * strftime.c (my_strftime): Do not invoke mbrlen with a
9249 size of (size_t) -1; it's not portable.
9251 2000-11-17 Akim Demaille <akim@epita.fr>
9253 * obstack.h: Formatting changes.
9254 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9255 prevent type checking.
9256 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9257 cast the value to (void *): assigning a `foo *' to a `void *'
9259 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9261 2000-11-17 Jim Meyering <meyering@lucent.com>
9263 * strstr.c: Update from GNU libc.
9265 2000-11-16 Jim Meyering <meyering@lucent.com>
9267 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9269 2000-11-11 Jim Meyering <meyering@lucent.com>
9271 * error.c: Add a couple #includes, merging from GNU libc version.
9273 2000-11-10 Jim Meyering <meyering@lucent.com>
9275 * obstack.h: Update from GNU libc.
9276 * obstack.c: Likewise.
9278 2000-11-06 Paul Eggert <eggert@twinsun.com>
9280 * getusershell.c (setusershell): Use rewind rather than
9281 fseek/fseeko, to avoid configuration hassles with fseeko.
9282 Don't bother opening SHELLS_FILE if shellstream is NULL;
9285 2000-11-05 Jim Meyering <meyering@lucent.com>
9287 * makepath.h (make_dir): Declare.
9288 * makepath.c (make_dir): Remove `static' attribute.
9291 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
9293 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
9294 last one in a bucket, advance to the next bucket.
9296 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
9298 * fnmatch.c: Do not comment out all the code if we are using
9299 the GNU C library, because in some cases we are replacing buggy
9300 code in the GNU C library itself.
9302 2000-10-30 Paul Eggert <eggert@twinsun.com>
9304 * error.h, getline.h, modechange.h:
9305 Remove "2000" from Copyright line, as the file hasn't been
9306 changed this year other than in the copyright notice.
9308 * xalloc.h: Add "2000" to Copyright line, as this file
9309 was changed this year.
9311 2000-10-30 Paul Eggert <eggert@twinsun.com>
9313 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9314 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9315 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9317 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
9319 * regex.h (__restrict_arr): Move definition out of #ifndef block.
9320 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9321 doesn't define __restrict_arr.
9323 2000-10-29 Jim Meyering <meyering@lucent.com>
9325 * xstat.in: Fix grammar in comment.
9327 2000-10-28 Jim Meyering <meyering@lucent.com>
9329 * memchr.c: Update from libc.
9330 Adjust for portability:
9331 [HAVE_STDLIB_H]: Include stdlib.h.
9332 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9333 Undef __memchr, too.
9334 [!weak_alias]: Define __memchr to memchr.
9336 * regex.c: Update from libc.
9337 * regex.h: Likewise.
9338 * getopt1.c: Likewise.
9339 * memcmp.c: Likewise.
9341 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9342 Avoid using fseek, when possible -- it's broken by design.
9343 Patch by Ulrich Drepper.
9345 2000-10-26 Jim Meyering <meyering@lucent.com>
9347 * strftime.c: Update from libc.
9349 2000-10-25 Jim Meyering <meyering@lucent.com>
9351 * obstack.c: Update from libc.
9353 2000-10-23 Jim Meyering <meyering@lucent.com>
9355 * hard-locale.c (hard_locale): Revert last change -- it was simply
9356 wrong. That set_locale call must not have any side effects.
9359 2000-10-22 Jim Meyering <meyering@lucent.com>
9361 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9362 [CYCLIC]: Remove now-unused definition.
9364 * save-cwd.c (O_DIRECTORY): Define, if needed.
9365 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9366 Suggestion from Ulrich Drepper.
9368 2000-10-21 Jim Meyering <meyering@lucent.com>
9370 * dirname.c (dir_name_r): New function, factored out of dir_name.
9371 (dir_name): Use dir_name_r.
9372 * dirname.h (dir_name_r): Declare it.
9374 2000-10-21 Jim Meyering <meyering@lucent.com>
9376 * dirname.c (memrchr): Declare if necessary.
9377 (dir_name): Remove the restriction that there be no
9378 trailing slashes. Now, this code skips past them, effectively
9380 [TEST_DIRNAME] (main): New unit tests.
9382 * memrchr.c: New file from GNU libc.
9383 Undef __memrchr, too.
9384 [!weak_alias]: Define __memrchr to memrchr.
9385 Guard weak_alias use with `#ifdef weak_alias'.
9387 2000-10-17 Jim Meyering <meyering@lucent.com>
9389 * quote.h (PARAMS): Define and use.
9390 Reported by Akim Demaille.
9392 * getopt.c: Update from libc.
9394 2000-10-16 Jim Meyering <meyering@lucent.com>
9396 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9399 2000-09-25 Jim Meyering <meyering@lucent.com>
9401 * md5.h (rol): Define (from GnuPG).
9403 * sha.c: Give credit (GnuPG) where due.
9404 (M): Use rol rather than open-coding it.
9405 Add a FIXME comment.
9407 2000-09-21 Jim Meyering <meyering@lucent.com>
9409 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9410 Reported by Michael Stone.
9412 2000-09-20 Jim Meyering <meyering@lucent.com>
9414 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9415 (noinst_HEADERS): Add sha.h.
9416 Based on code from Scott G. Miller and from GnuPG.
9418 2000-09-15 Jim Meyering <meyering@lucent.com>
9420 * regex.c: Update from libc.
9422 2000-09-10 Jim Meyering <meyering@lucent.com>
9424 * getopt.c (_getopt_internal): Update from glibc.
9426 2000-09-09 Jim Meyering <meyering@lucent.com>
9428 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9429 think it should be used as a general replacement for isascii.
9430 * fnmatch.c: Likewise.
9431 * mbswidth.c: Likewise
9432 * regex.c: Likewise.
9435 * userspec.c: Include sys/param.h and limits.h.
9437 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9438 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9439 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9440 UID, GID. Check range.
9442 2000-09-06 Jim Meyering <meyering@lucent.com>
9444 * getopt.c (_getopt_internal): Update from glibc.
9446 2000-08-30 Jim Meyering <meyering@lucent.com>
9448 * strftime.c: Merge in changes from GNU libc.
9450 2000-08-26 Jim Meyering <meyering@lucent.com>
9452 * closeout.c: Include "__fpending.h".
9453 (close_stdout_status): Return right away if there's nothing to flush.
9455 * Makefile.am (noinst_HEADERS): Add __fpending.h.
9456 * __fpending.c: New file.
9457 * __fpending.h: New file.
9459 2000-08-07 Paul Eggert <eggert@twinsun.com>
9461 Standardize on "memory exhausted" instead of "Memory exhausted"
9462 or "virtual memory exhausted".
9463 * obstack.c (print_and_abort): Use "memory exhausted", not
9464 "virtual memory exhausted".
9465 * same.c (same_name): Invoke xalloc_die instead of printing
9467 * userspec.c (parse_user_spec): Likewise.
9468 * bumpalloc.h: comment fix
9469 * same.c, userspec.c: Include xalloc.h.
9471 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9472 not char *const and pointing to a constant array.
9473 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9474 (xrealloc): Comment fix.
9476 * userspec.c (parse_user_spec):
9477 Don't translate a message until just before returning,
9478 to avoid unnecessary translation.
9480 2000-08-07 Jim Meyering <meyering@lucent.com>
9482 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9483 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9484 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9485 getgroups.c, gethostname.c, getopt.h, group-member.c,
9486 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9487 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9488 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9489 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9490 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9491 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9492 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9493 yesno.c: Back out Copyright date changes for each file with no change
9494 this year. This eases coordination with other programs using the same
9495 source code modules. From Paul Eggert.
9497 2000-08-03 Greg McGary <greg@mcgary.org>
9499 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9500 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9501 (EXTEND_BUFFER): Use them.
9503 2000-08-01 Jim Meyering <meyering@lucent.com>
9505 * dirname.c (ISSLASH): Define.
9506 (BACKSLASH_IS_PATH_SEPARATOR): Define.
9507 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9508 both `\' and `/' may be use as path separators.
9509 Based on a patch from Prashant TR.
9511 2000-07-31 Paul Eggert <eggert@twinsun.com>
9513 * quotearg.c (quotearg_n_options): Don't make the initial
9514 slot vector a constant, since it might get modified.
9516 2000-07-31 Jim Meyering <meyering@lucent.com>
9518 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9519 * obstack.c (print_and_abort): Likewise.
9521 2000-07-30 Paul Eggert <eggert@twinsun.com>
9523 * quotearg.c (quotearg_n_options): Preallocate a slot 0
9524 buffer, so that the caller can always quote one small
9525 component of a "memory exhausted" message in slot 0.
9526 From a suggestion by Jim Meyering.
9528 2000-07-30 Jim Meyering <meyering@lucent.com>
9530 * makepath.c (make_path): Quote the other instance, too.
9532 * quotearg.c (N_STATIC_SLOTVECS): Define.
9533 (STATIC_BUF_SIZE): Define.
9534 (quotearg_n_options): Use only statically allocated storage when
9535 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9536 than STATIC_BUF_SIZE.
9538 2000-07-29 Jim Meyering <meyering@lucent.com>
9540 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9541 * dirname.c (dir_name): Likewise.
9543 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9545 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9546 (dir_name): Assert that there are no trailing slashes.
9548 2000-07-18 Bruno Haible <haible@clisp.cons.org>
9550 * mbswidth.h (mbswidth): Add a flags argument.
9551 (mbswidth): New declaration.
9552 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9553 * mbswidth.c (mbswidth): Add a flags argument.
9554 (mbsnwidth): New function.
9556 2000-07-24 Jim Meyering <meyering@lucent.com>
9558 * mbswidth.c: Remove useless #else. From Bruno Haible.
9560 2000-07-23 Paul Eggert <eggert@twinsun.com>
9562 * mbswidth.c (_XOPEN_SOURCE):
9563 Don't define; this causes problems on Solaris 7.
9564 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9566 2000-07-23 Paul Eggert <eggert@twinsun.com>
9569 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9570 so that mbstate_t is always defined.
9572 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9573 be 1 in at least one GCC installation, and this configuration
9574 error is likely to be common. Ignoring MB_LEN_MAX hurts
9575 performance on hosts that have mbrtowc but have only unibyte
9576 locales, but I assume these hosts are rare.
9578 2000-07-23 Paul Eggert <eggert@twinsun.com>
9580 * quotearg.c: Streamline by invoking multibyte code only if needed.
9581 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9582 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9583 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9584 invoke multibyte primitives.
9586 2000-07-23 Jim Meyering <meyering@lucent.com>
9588 * basename.c (base_name): Add an assertion.
9590 2000-07-15 Bruno Haible <clisp.cons.org>
9592 * quotearg.c: When the system forces us to redefine mbstate_t,
9593 shadow its mbsinit function.
9595 2000-07-16 Bruno Haible <haible@clisp.cons.org>
9597 * mbswidth.h: New file.
9598 * mbswidth.c: New file.
9599 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9600 (noinst_HEADERS): Add mbswidth.h.
9602 2000-07-17 Bruno Haible <haible@clisp.cons.org>
9604 * config.charset: Add support for FreeBSD. Improve support for HP-UX
9607 2000-07-15 Jim Meyering <meyering@lucent.com>
9609 * makepath.c: Include quote.h.
9610 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9611 corresponding argument in a `quote (...)' call.
9612 Give better diagnostics.
9614 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9615 (noinst_HEADERS): Add quote.h.
9617 * quote.c (quote, quote_n): New file. Two functions taken verbatim
9618 from tar's src/misc.c.
9619 * quote.h: New file. Prototypes for same.
9621 2000-07-10 Paul Eggert <eggert@twinsun.com>
9623 From a suggestion by Bruno Haible.
9624 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9625 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9626 to decide whether to define the BeOS workaround macro;
9627 this adjusts to the change to AC_MBSTATE_T.
9629 2000-07-13 Paul Eggert <eggert@twinsun.com>
9631 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9633 * quotearg.c (quoting_style_args, quoting_style_vals,
9634 quotearg_buffer_restyled): Add support for
9635 clocale_quoting_style. Undo previous change to
9636 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9637 and "{RIGHT QUOTATION MARK}" msgids.
9639 2000-07-05 Paul Eggert <eggert@twinsun.com>
9641 The old behavior of quoting `like this' doesn't look good with
9642 newer, ISO-style fonts. See:
9643 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9645 Instead, quote "like this" by default. Let the translator
9646 tailor the locale-specific quoting behavior by providing
9647 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9649 * quotearg.c (N_): New macro.
9650 (gettext_default): New function.
9651 (quotearg_buffer_restyled): Use
9652 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9653 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9655 2000-07-09 Jim Meyering <meyering@lucent.com>
9657 * Most files: Update copyright dates to include 2000.
9659 2000-07-08 Jim Meyering <meyering@lucent.com>
9661 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9663 (xgethostname): Remove now-unnecessary #ifdef.
9664 Move declaration of `err' into loop where it's used.
9666 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9668 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9669 by allocating a larger buffer. Test the gethostname return value for
9670 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
9671 returns an error and ENAMETOOLONG isn't defined.
9673 2000-07-05 Paul Eggert <eggert@twinsun.com>
9674 and Bruno Haible <haible@clisp.cons.org>
9676 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9678 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9680 * quotearg.c (struct quoting_options): Simplify quote_these_too
9683 2000-07-03 Jim Meyering <meyering@lucent.com>
9685 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9686 Reported by Bruno Haible.
9688 2000-07-04 Jim Meyering <meyering@lucent.com>
9690 * quotearg.c: Make inclusion of <wchar.h> independent of whether
9691 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
9694 2000-07-03 Paul Eggert <eggert@twinsun.com>
9695 and Bruno Haible <haible@clisp.cons.org>
9697 * quotearg.c (mbrtowc):
9698 Assign to *pwc, and return 1 only if result is nonzero.
9699 (iswprint): Use ISPRINT when substituting our own mbrtowc.
9701 2000-07-03 Jim Meyering <meyering@lucent.com>
9703 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9704 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9707 2000-07-02 Jim Meyering <meyering@lucent.com>
9709 * quotearg.c (mbstate_t): Don't define here.
9711 2000-07-02 Jim Meyering <meyering@lucent.com>
9713 * nanosleep.c (SIGCONT): Define if not already defined.
9715 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9717 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9718 per change in ../m4/ls-mntd-fs.m4.
9719 (read_filesystem_list): Ignore symbolic links.
9721 2000-06-29 Jim Meyering <meyering@lucent.com>
9723 * same.c: Include <string.h> or <strings.h>, as appropriate,
9724 for declaration of strcmp.
9726 * long-options.c: Include <stdlib.h>, for declaration of exit.
9728 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9729 Avoid warning by casting result to `char *' to remove `const'.
9731 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9733 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9735 2000-06-26 Paul Eggert <eggert@twinsun.com>
9737 savedir now sets errno on failure and invokes xmalloc to get memory.
9738 Fix a couple of other minor bugs while we're at it.
9740 * savedir.c (<unistd.h>): Do not include; there's no need.
9741 (NAMLEN): Remove macro.
9742 (malloc, realloc): Remove decls.
9744 ("xalloc.h"): Include.
9745 (NAME_SIZE_DEFAULT): New macro.
9746 (savedir): Use xmalloc / xrealloc to allocate memory.
9747 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9748 Skip "" directory entries.
9749 Use strlen to calculate directory entry length, since the old method
9750 is rarely used these days and isn't worth supporting.
9751 Don't use a pointer after freeing it.
9752 Check for integer overflow when calculating allocation size.
9753 Use memcpy to copy entries, instead of stpcpy.
9754 Set errno properly when returning NULL.
9755 Check for readdir error.
9757 2000-06-26 Jim Meyering <meyering@lucent.com>
9759 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9761 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9763 * getusershell.c (xmalloc, xrealloc): Remove functions.
9765 Don't include <stdlib.h>. Don't declare malloc, realloc.
9767 2000-06-23 Bruno Haible <haible@clisp.cons.org>
9769 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9771 2000-06-24 Jim Meyering <meyering@lucent.com>
9773 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9775 2000-06-21 Jim Meyering <meyering@lucent.com>
9777 * getpass.c: New file, from Bruno Haible. Required for BeOS.
9779 2000-06-19 Paul Eggert <eggert@twinsun.com>
9781 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9782 (mbrtowc, mbstate_t): Define substitutes if
9783 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9784 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9785 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9787 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9789 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9790 than 1024, return a memory chunk of least possible size, instead
9791 of size PATH_MAX + 2. In the loop, increment the size proportionally.
9792 Use free/xmalloc instead of xrealloc to avoid copying for very long
9795 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9797 * canon-host.c (canon_host): Use malloc and memcpy to copy an
9798 address, not strdup. Include <stdlib.h> and don't declare free().
9800 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9802 * path-concat.c (path_concat): Don't access dir[-1] if dir is
9805 2000-06-21 Jim Meyering <meyering@lucent.com>
9807 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9808 (noinst_HEADERS): Add getstr.h.
9810 * getline.c (getstr): Move into a separate file.
9811 * getstr.c (getstr): New file, extracted from getline.c, with
9812 the following changes: new parameter, delim2; both delim[12]
9813 parameters have type `int', not `char'. The latter would lose
9814 with 8-bit delimiters.
9815 * getstr.h: New file.
9817 2000-06-19 Jim Meyering <meyering@lucent.com>
9819 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9821 2000-06-18 Jim Meyering <meyering@lucent.com>
9823 * mkdir.c: Remove file, due mainly to copyright incompatibility.
9824 Besides, these days every porting target provides a mkdir function.
9826 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
9827 (this snippet comes from src/system.h).
9829 2000-06-15 Paul Eggert <eggert@twinsun.com>
9831 * human.c (adjust_value): New function.
9832 (human_readable_inexact): Apply rounding style even when
9833 printing approximate values.
9835 2000-06-14 Paul Eggert <eggert@twinsun.com>
9837 * human.c (human_readable_inexact): Allow an input block
9838 size that is not a multiple of the output block size, and vice versa.
9839 Reported by Piergiorgio Sartor.
9841 2000-06-14 Paul Eggert <eggert@twinsun.com>
9843 * getdate.y (get_date): Apply relative times after time
9844 zone indicator, not before. Reported by Todd A. Jacobs.
9846 2000-06-13 Jim Meyering <meyering@lucent.com>
9848 * Makefile.am (all-local): Depend on lstat.c and stat.c.
9850 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
9852 2000-06-12 Paul Eggert <eggert@twinsun.com>
9854 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
9856 2000-06-04 Paul Eggert <eggert@twinsun.com>
9858 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
9860 2000-06-04 Jim Meyering <meyering@lucent.com>
9862 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
9863 SunOS 4.1.4 for which gid_t is an unsigned type.
9865 2000-06-03 Jim Meyering <meyering@lucent.com>
9867 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
9869 2000-05-26 Bruno Haible <haible@clisp.cons.org>
9871 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
9872 newer, don't install charset.alias.
9873 * config.charset: Change the Linux/glibc rules so they become empty
9874 on glibc-2.1 or newer.
9876 2000-06-02 Jim Meyering <meyering@lucent.com>
9878 * mountlist.c: Back out last change. Instead, do this...
9879 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
9880 member using the same `ignore'-testing code.
9881 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
9885 2000-05-29 Jim Meyering <meyering@lucent.com>
9887 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
9888 with the `ignore' attribute. Based on a patch from Mark D. Roth.
9890 2000-05-22 Jim Meyering <meyering@lucent.com>
9892 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
9894 2000-05-18 Jim Meyering <meyering@lucent.com>
9896 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
9897 back, too, since it may have been modified by allocate_entry.
9898 (hash_delete): Rewrite to use neither the assignment operator
9899 nor the comma operator in an if-expression.
9901 2000-05-15 Paul Eggert <eggert@twinsun.com>
9904 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
9905 Remove; no longer needed.
9906 "quotearg.h": Add include.
9907 (file_name): Do not bother to explicitly initialize to NULL; it's less
9908 efficient on some hosts.
9909 (close_stdout_status): Remove test as to whether stdout was already
9910 closed; it breaks for the case "echo x | sort >&-".
9911 Quote file name colons.
9912 Do not assume that _("write error") lacks format strings.
9914 2000-05-15 Jim Meyering <meyering@lucent.com>
9916 * version-etc.c (version_etc_copyright): Update the copyright string
9917 used in all --version output.
9919 2000-05-14 Jim Meyering <meyering@lucent.com>
9921 * closeout.c (close_stdout_set_file_name): New function.
9922 (close_stdout_status): Use new file-scoped global.
9923 Return right away if fstat says the stdout file descriptor is invalid.
9924 * closeout.h (close_stdout_set_file_name): Declare.
9926 2000-05-10 Jim Meyering <meyering@lucent.com>
9928 * closeout.c [default_exit_status]: New file-scoped variable.
9929 (close_stdout_set_status): New function.
9930 * closeout.h (close_stdout_set_status): Declare.
9932 2000-05-08 Jim Meyering <meyering@lucent.com>
9934 * long-options.c: Don't include closeout.h.
9935 (parse_long_options): Don't call close_stdout for --version.
9937 2000-05-06 Jim Meyering <meyering@lucent.com>
9939 * strnlen.c: Undefine __strnlen and strnlen.
9940 [!weak_alias]: Define __strnlen to strnlen.
9942 * atexit.c: New file, from libiberty.
9944 2000-05-06 Jim Meyering <meyering@lucent.com>
9946 * closeout.c (close_stdout_status): Also check for errors on the
9949 2000-05-05 Bruno Haible <haible@clisp.cons.org>
9951 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
9952 instead of xmalloc, xrealloc, path_concat.
9953 (locale_charset): Treat empty environment variables as absent.
9954 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
9956 2000-05-04 Jim Meyering <meyering@lucent.com>
9958 * getopt.c: Update from glibc.
9959 * obstack.c: Likewise.
9960 * obstack.h: Likewise.
9961 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
9963 * regex.h: Likewise.
9964 * strndup.c: Likewise.
9965 * strnlen.c: New file, from glibc.
9967 2000-05-01 Jim Meyering <meyering@lucent.com>
9969 * full-write.c (full_write): Remove `FIXME' part of comment.
9971 2000-04-29 Jim Meyering <meyering@lucent.com>
9973 * path-concat.c: Declare strdup only if it's not defined.
9974 * canon-host.c: Likewise.
9976 2000-04-28 Jim Meyering <meyering@lucent.com>
9978 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
9979 redefinition warning on some systems (HPUX). Otherwise, regex.h is
9980 included first, then limits.h is included by locale.h by libintl.h.
9981 From John David Anglin.
9983 2000-04-25 Jim Meyering <meyering@lucent.com>
9985 * makepath.c (S_IRWXUGO): Define.
9986 (make_path): Always perform explicit chmod if MODE specifies any
9987 of the `special' permission bits. Prompted by a bug report against
9988 install from Mate Wierdl and Joost van Baal.
9990 2000-04-18 Jim Meyering <meyering@lucent.com>
9994 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
9995 getpagesize. For BeOS. Based on a patch from Bruno Haible.
9997 2000-04-17 Jim Meyering <meyering@lucent.com>
9999 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10000 the definition of it to rpl_strftime also defined-away the system's
10003 2000-04-15 Jim Meyering <meyering@lucent.com>
10005 Use `C' to denote so-called `contiguous' files, the same way
10007 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10008 (ftypelet): Use S_ISCTG.
10009 From Michael Deutschmann.
10011 2000-04-14 Jim Meyering <meyering@lucent.com>
10013 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10015 2000-04-08 Jim Meyering <meyering@lucent.com>
10017 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10018 names don't conflict. Reported by Eli Zaretskii.
10020 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10022 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10023 bug. Deal with the different error behavior of Irix iconv.
10025 2000-04-07 Jim Meyering <meyering@lucent.com>
10027 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10028 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10030 2000-04-05 Jim Meyering <meyering@lucent.com>
10032 Portability tweaks required for ultrix4.3.
10033 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10034 * readutmp.c: Include sys/types.h before sys/stat.h.
10035 * canon-host.c: Declare strdup.
10036 * path-concat.c: Likewise.
10037 From John David Anglin.
10039 2000-04-04 Jim Meyering <meyering@lucent.com>
10041 Be more DOS 8.3-friendly.
10042 * ref-add.sin: Renamed from ref-add.sed.in.
10043 * ref-del.sin: Renamed from ref-del.sed.in.
10044 * Makefile.am: Reflect renaming.
10045 Reported by Eli Zaretskii.
10047 Use a temporary file name that won't clash with `charset.alias'
10048 in the DOS 8.3 name space.
10049 * Makefile.am (charset_tmp): Define.
10050 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10051 (uninstall-local): Likewise.
10052 Reported by Eli Zaretskii.
10054 2000-03-29 Paul Eggert <eggert@twinsun.com>
10056 * time/strftime.c (my_strftime): Make sure we call the system
10057 strftime, not ourselves, when invoking the underlying strftime.
10059 2000-03-24 Jim Meyering <meyering@lucent.com>
10061 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10062 (charset_alias): Define.
10063 (install-exec-local): Factor out common code.
10064 (uninstall-local): Split lines longer than 80.
10065 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10066 (SUFFIXES): Define.
10067 (.sed.in.sed): New rule. Don't redirect directly to $@.
10068 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10070 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10072 * config.charset: Output a line containing "Packages using this file".
10073 * ref-add.sed.in, ref-del.sed.in: New files.
10074 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10075 ref-del.sed): New rules.
10077 2000-03-17 Jim Meyering <meyering@lucent.com>
10079 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10080 Otherwise, include <strings.h>
10082 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10084 * unicodeio.c (utf8_wctomb): New function.
10085 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10086 format instead of in UCS-4 with platform dependent endianness.
10088 2000-03-07 Paul Eggert <eggert@twinsun.com>
10090 * savedir.c (savedir): Work even if directory size is
10091 negative; this can happen with some screwy NFS configurations.
10093 2000-03-06 Jim Meyering <meyering@lucent.com>
10095 * localcharset.c (get_charset_aliases): Don't try to free file_name
10096 if it's NULL (because we ran out of memory). From Bruno Haible.
10098 2000-03-05 Jim Meyering <meyering@lucent.com>
10100 * localcharset.c ("path-concat.h"): Include.
10101 (get_charset_aliases): Use path_concat instead of ANSI string
10104 * unicodeio.h (PARAMS): Define.
10105 Use it to guard prototype.
10107 2000-03-04 Jim Meyering <meyering@lucent.com>
10109 * Makefile.am (install-exec-local): Create $(libdir) before installing
10111 (uninstall-local): Uncomment this rule so `make distcheck' works
10114 * unicodeio.c (<errno.h>): Include it.
10115 (errno): Declare if not defined.
10117 * localcharset.c: Add Bruno's comment justifying use of volatile.
10119 * config.charset: New version, incorporating remarks from a linux
10120 i18n mailing list. From Bruno Haible.
10122 2000-03-02 Jim Meyering <meyering@lucent.com>
10124 * Makefile.am (EXTRA_DIST): Add config.charset.
10126 2000-03-01 Jim Meyering <meyering@lucent.com>
10128 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10129 * unicodeio.c: Likewise.
10131 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10133 * config.charset: New file.
10134 * localcharset.c: New file.
10135 * unicodeio.h, unicodeio.c: New files.
10136 * Makefile.am (DEFS): Add -DLIBDIR=...
10137 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10138 (noinst_HEADERS): Add unicodeio.h.
10139 (all-local, install-exec-local, charset.alias): New targets.
10141 2000-02-28 Paul Eggert <eggert@twinsun.com>
10143 * quotearg.c (ALERT_CHAR): New macro.
10144 (quotearg_buffer_restyled): Use it.
10146 2000-02-27 Jim Meyering <meyering@lucent.com>
10148 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10149 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10151 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10152 not `#if STDC_HEADERS'.
10153 Declare malloc if needed.
10155 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10156 now that autoconf always defines the HAVE_DECL_ symbols.
10157 * human.c: Likewise.
10158 * same.c: Likewise.
10159 * strtoumax.c: Likewise.
10161 * backupfile.c: Arrange for cpp to fail if the configure-time
10162 declaration check was not run.
10163 * hash.c: Likewise.
10164 * human.c: Likewise.
10165 * same.c: Likewise.
10166 * strtoumax.c: Likewise.
10168 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10169 then first look up the entire `.'-containing string as a login name.
10171 2000-02-18 Paul Eggert <eggert@twinsun.com>
10173 * getdate.y: Handle two-digit years with leading zeros correctly.
10174 (textint): New typedef.
10175 (parser_control): Member year changed from int to textint.
10177 (YYSTYPE): Removed; replaced by %union with int and textint members.
10178 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10179 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10180 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10181 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10182 (date, number, to_year): Use width of number in digits, not its value,
10183 to determine whether it's a 2-digit year, or a 2-digit time.
10184 (yylex): Store number of digits of numeric tokens.
10185 Reported by John Kendall.
10187 (parser_control): Changed from struct parser_control to typedef (for
10188 consistency). All uses changed.
10190 (tID): Removed; not used.
10191 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10193 2000-02-14 Paul Eggert <eggert@twinsun.com>
10195 * getpagesize.h (getpagesize): Port to VMS for Alpha;
10196 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10198 2000-02-12 Jim Meyering <meyering@lucent.com>
10200 * userspec.c (ISDIGIT): Define it.
10201 (isdigit): Remove definition.
10202 (is_number): Use ISDIGIT, not isdigit.
10203 <libintl.h>: Include.
10204 (_ and N_): Define.
10205 (parse_user_spec): Mark translatable strings.
10207 2000-02-10 Jim Meyering <meyering@lucent.com>
10209 With these changes, nanosleep.[ch] are finally enough like the other
10210 lib/* replacement files to compile on a few more losing systems.
10212 * nanosleep.h: Don't include config.h.
10213 Remove prototype from declaration of nanosleep.
10214 (PARAMS): Remove now-unneeded definition.
10215 * nanosleep.c: #undef nanosleep.
10216 (rpl_nanosleep): Rename from nanosleep.
10218 2000-02-03 Jim Meyering <meyering@lucent.com>
10220 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10221 rather than with `#if HAVE_UTMPNAME'.
10223 2000-02-01 Jim Meyering <meyering@lucent.com>
10225 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
10227 2000-01-31 Jim Meyering <meyering@lucent.com>
10229 * nanosleep.h (nanosleep): Guard declaration with
10230 `#if ! HAVE_DECL_NANOSLEEP'.
10231 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10232 the declaration in that vendor's sys/timers.h.
10233 Reported by Christian Krackowizer.
10235 * quotearg.c (ISASCII): Add #undef and move definition to follow
10236 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10237 (ISPRINT): Likewise.
10238 Reported by Tom Tromey.
10240 2000-01-30 Jim Meyering <meyering@lucent.com>
10242 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10243 uses of ->ut_name. The latter doesn't work with new Linux header files
10244 where only utmpx.ut_user is declared.
10246 * readutmp.h (UT_USER): Define.
10248 2000-01-23 Jim Meyering <meyering@lucent.com>
10250 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10253 2000-01-22 Jim Meyering <meyering@lucent.com>
10255 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10256 [! HAVE_DECL_STRTOULL]: Declare strtoull.
10257 Required for some AIX systems. Reported by Christian Krackowizer.
10258 [TESTING] (main): New function.
10260 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
10261 * dirname.c (dir_name): Support for DOS-style file names with drive
10264 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10266 * strverscmp.c (ISDIGIT): Define.
10267 (strverscmp): Use ISDIGIT, not isdigit.
10269 2000-01-17 Paul Eggert <eggert@twinsun.com>
10271 * nanosleep.c (nanosleep):
10272 Don't use SA_INTERRUPT to decide whether to call sigaction, as
10273 POSIX.1 doesn't require SA_INTERRUPT and some systems
10274 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
10275 it's been part of POSIX.1 since day 1 (in 1988).
10277 2000-01-17 Jim Meyering <meyering@lucent.com>
10279 * interlock: Remove unused file. Reported by François Pinard.
10281 2000-01-16 Paul Eggert <eggert@twinsun.com>
10283 * quotearg.c (quotearg_buffer_restyled): Do not quote
10284 alert, backslash, formfeed, and vertical tab unnecessarily in
10285 shell quoting style.
10288 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10289 Free Software Foundation, Inc.
10290 Copying and distribution of this file, with or without modification,
10291 are permitted provided the copyright notice and this notice are preserved.