1 2006-01-24 Jim Meyering <jim@meyering.net>
3 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
5 2006-01-24 Simon Josefsson <jas@extundo.com>
7 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
10 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
12 Work around porting bugs reported by Dieter in
13 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
14 * getopt.c (_NOPROTO): Remove; no longer needed.
15 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
16 Include "getopt.h" first, to check interface.
17 (getenv): Declare only if defined HAVE_DECL_GETENV &&
19 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
20 (__strndup): Revert to K&R-style function dfns, the glibc style.
21 * strnlen.c: Don't claim it's taken from glibc; it's not.
22 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
23 Include strnlen.h first, to get prototype properly.
24 (strnlen): Renamed from __strnlen.
27 2006-01-23 Ulrich Drepper <drepper@redhat.com>
29 These changes imported from libc.
30 * getopt.c: Use __fxprintf instead of inline stream orientation
31 test and two separate function calls.
32 * strndup.c (__strndup): Add libc_hidden_def.
34 2006-01-22 Bruno Haible <bruno@clisp.org>
36 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
37 temporary buffer for sprintf, take into account the precision also
38 for 'd', 'i', 'u', 'o', 'x', 'X'.
40 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
42 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
43 to pacify gcc -Wswitch-default.
45 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
47 * argp-help.c (usage_long_opt): Do not print DOC options.
48 (__argp_base_name): Removed
49 * argp-namefrob.h (__argp_basename): Removed definition. Was a
51 (__argp_base_name): Provide macro definition or extern declaration
52 depending on the configuration
54 2006-01-20 Simon Josefsson <jas@extundo.com>
56 * inet_ntop.h: Unconditionally include sys/socket.h.
58 2006-01-19 Simon Josefsson <jas@extundo.com>
60 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
62 2006-01-12 Simon Josefsson <jas@extundo.com>
64 * base64.c: Fix warning, reported by Bruno Haible
65 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
67 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
70 * md5.c: Fix commentary typos.
71 (alignof, UNALIGNED_P): No need for a GCC-specific version.
72 * md5.h (__attribute__): Remove; unused.
73 * sha1.c: Fix commentary to match md5 better.
74 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
75 so that we don't need to worry about alignment. All uses changed.
76 This merges the 2005-10-28 md5 change into sha1.
78 2006-01-11 Jim Meyering <jim@meyering.net>
81 * md5.c (OP): Fix spacing.
83 2006-01-11 Simon Josefsson <jas@extundo.com>
85 * stdint_.h (SIZE_MAX): Add missing (.
87 2006-01-10 Bruno Haible <bruno@clisp.org>
89 * argp.h (__const): Remove macro. Use const instead.
90 * argp-fmtstream.h (__const): Likewise.
91 * glob_.h (__const): Remove macro.
92 * glob-libc.h: Use const instead of __const.
94 2006-01-10 Jim Meyering <jim@meyering.net>
96 Avoid the double-free (first in fts_read, second in fts_close) that
97 would occur when an `active' directory is made inaccessible (e.g.,
98 via chmod a-x) during a traversal.
99 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
100 before returning. Reproduce this failure by
101 mkdir -p a/b; cd a; chmod a-x . b
102 Reported by Stavros Passas.
105 * sha1.c: Tweak grammar in a comment.
107 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
109 * regex_internal.h (BITSET_WORD_BITS):
110 Work around a bug in 64-bit PGC (before version 6.1-2), where the
111 preprocessor mishandles large unsigned values as if they were signed.
112 Problem reported by Claudio Fontana in
113 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
115 2006-01-10 Simon Josefsson <jas@extundo.com>
117 * socket_.h: New file.
119 2006-01-10 Bruno Haible <bruno@clisp.org>
121 * localcharset.c: Update from GNU gettext.
123 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
126 * chdir-long.c (cdb_free): Don't bother trying to open directory
127 for write access: POSIX says that must fail.
128 * fts.c (diropen): Likewise.
129 * save-cwd.c (save_cwd): Likewise.
130 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
131 well, for minor improvements on hosts that lack O_DIRECTORY.
132 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
133 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
134 Fall back on chown if open failed with EACCES.
136 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
137 Report an error at compile-time if only a 1-second nominal clock
140 * lchmod.h: New file.
141 * mkdir-p.c: Include lchmod.h, lchown.h.
142 (make_dir_parents): Use lchown rather than chown, and
143 lchmod rather than chmod.
145 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
146 too. Problem with "none" reported by Bob Proulx. Problem with
147 "proc" reported by n0dalus.
149 * mountlist.c: Include <limits.h>.
150 (dev_from_mount_options)
151 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
152 New function. It no longer assumes "dev=" has the System V meaning
153 on Linux (since it doesn't). It also parses "dev=" more carefully.
154 (read_file_system_list)
155 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
156 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
159 * posixtm.h (PDS_PRE_2000): New macro.
160 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
161 All usages changed. Reject dates outside the range 1969-1999 if
162 PDS_PRE_2000 is used.
164 2006-01-09 Jim Meyering <jim@meyering.net>
168 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
170 * chdir-safer.h, chdir-safer.c: New files.
172 * modechange.c (mode_compile): Reject an invalid mode string
173 that starts with an octal digit. From Andreas Gruenbacher.
175 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
176 and dup to open_safer and dup_safer, respectively.
177 (openat_permissive): Fix typo in comment.
179 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
180 "gettext.h"; either no longer needed or are guaranteed by openat.h.
181 (_): Remove; no longer needed.
182 (openat): Renamed from rpl_openat; no need for rpl_openat
183 since openat.h renames openat for us.
184 Replace most of the body with a call to openat_permissive,
185 to avoid duplicate code.
186 Port to (probably hypothetical) environments were mode_t is
188 (openat_permissive): Require mode arg, so that we can check
189 types better. Put it just after flags. Change cwd failure
190 indicator from pointer-to-bool to pointer-to-errno-value.
192 Invoke openat_save_fail and/or openat_restore_fail if
193 cwd_errno is null, so that openat can call us.
194 (openat_permissive, fdopendir, fstatat, unlinkat):
195 Simplify errno handling to avoid some duplicate code,
196 as it's OK to set errno on success.
197 * openat.h: Revamp code so that function macros depend on
198 __OPENAT_PREFIX only, not also on AT_FDCWD.
199 (openat_ro): Remove. Caller changed to use openat_permissive.
200 (openat_permissive): Now a macro, if not a function.
201 (openat_restore_fail, openat_save_fail): Now always functions,
202 since mkdirat needs them even if __OPENAT_PREFIX is defined.
204 * openat-priv.h: New file, defining macros used by mkdirat.c
206 * mkdirat.c: Include openat-priv.h.
207 Remove definitions of macros defined therein.
208 * openat.c: Likewise.
210 * mkdirat.c (mkdirat): New file and function.
211 * openat.h (mkdirat): Declare.
213 * openat.c (fdopendir): Don't change errno when returning non-NULL.
215 * openat.h (openat_permissive): Declare.
218 * openat.c (EXPECTED_ERRNO): New macro.
219 (openat_permissive): New function -- used in remove.c rewrite.
220 (all functions): Set errno just before returning, only if there
221 was an actual failure.
222 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
224 Emulate openat-family functions using Linux's procfs, if possible.
225 Idea and some code based on Ulrich Drepper's glibc changes.
227 * openat.c: (BUILD_PROC_NAME): New macro.
228 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
229 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
230 before falling back on save_cwd and restore_cwd.
231 (fdopendir, fstatat, unlinkat): Likewise.
233 * openat.c (fstatat, unlinkat): Perform the syscall directly,
234 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
236 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
237 as second argument to va_arg. Otherwise, some versions of gcc
238 warn that `if this code is reached, the program will abort'.
240 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
244 Add POSIX ACL support
245 * acl.h (copy_acl, set_acl): Add declarations.
246 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
247 systems other than Linux.
248 (chmod_or_fchmod): New function: use fchmod when possible,
250 (file_has_acl): Add a POSIX ACL implementation, with a
251 Linux-specific subcase.
252 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
253 S_ISVTX from one file to another. Fall back to fchmod/chmod when
254 acls are unsupported.
255 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
256 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
259 2006-01-09 Bruno Haible <bruno@clisp.org>
261 * sysexit_.h (EX_OK): New macro.
262 Suggested by Martin Lambers <marlam@marlam.de>.
264 2006-01-09 Bruno Haible <bruno@clisp.org>
266 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
267 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
268 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
269 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
271 2006-01-09 Bruno Haible <bruno@clisp.org>
273 * stdint_.h (SIZE_MAX): Write the value without involving negative
276 2005-10-16 Bruno Haible <bruno@clisp.org>
278 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
279 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
281 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
283 * strftime.c (tzname): Don't declare if it is already #defined.
284 Problem reported for Mingw by Mark Junker.
286 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
288 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
289 long int, not int, for nanosecond counts, so that people who are
290 used to POSIX struct timespec won't be surprised. Reported by Jim
293 2005-12-16 Jim Meyering <jim@meyering.net>
295 * fprintftime.c, fprintftime.h: New files.
297 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
299 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
300 * argp-help.c (fill_in_uparams): Check if the constructed
301 struct uparams is valid. Fall back to the default values if it is
304 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
306 * argp-help.c (__argp_base_name): New function
307 (__argp_short_program_name): Rewrite using __argp_base_name
308 * argp-namefrob.h: Define program_invocation_name and
309 program_invocation_short_name if requested
310 (__argp_base_name): Add prototype
311 * argp-parse.c (argp_def): Use gettext wrappers
312 (argp_default_parser): Use __argp_base_name
313 * argp-pin.c: New file. Defines program_invocation_name and
314 program_invocation_short_name on systems that lack them.
316 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
318 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
319 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
320 porting problem reported by Georg Schwarz in
321 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
323 2005-07-09 Bruno Haible <bruno@clisp.org>
325 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
326 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
327 Reported by Mark Junker <mjscod@gmx.de>.
329 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
331 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
332 (uintmax_t) [defined uintmax_t]: Do not declare.
333 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
334 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
335 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
336 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
337 sake of portability to weird hosts that C allows (though we don't
338 know of any practical examples).
340 * savedir.h (fdsavedir): New decl.
341 * savedir.c (fdsavedir, savedirstream): New functions; the latter
342 contains most of the former guts of savedir.
343 (savedir): Use savedirstream.
346 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
348 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
349 coreutils no longer futzes with rounding modes.
351 2005-11-14 Jim Meyering <jim@meyering.net>
353 * mkstemp-safer.c: Include <config.h>, required for possible
354 replacement of mkstemp.
356 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
358 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
360 (gethrxtime) [! (HAVE_NANOUPTIME
361 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
362 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
363 our own approximation.
365 2005-11-10 Simon Josefsson <jas@extundo.com>
367 * readline.c: Remove EOL.
369 2005-11-08 Eric Blake <ebb9@byu.net>
371 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
373 2005-11-08 Eric Blake <ebb9@byu.net>
375 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
377 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
379 Fix porting problem reported by Theodoros V. Kalamatianos.
380 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
381 Don't assume that futimes failing means we must fail.
383 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
385 * getcwd.c (__getcwd): Don't assume that system calls after readdir
386 leave errno alone. Problem reported by Dmitry V. Levin.
388 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
390 * savedir.c (savedir): Don't assume that xrealloc etc. leave
391 errno alone. Problem reported by Frederic Jolliton.
393 2005-10-28 Simon Josefsson <jas@extundo.com>
395 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
396 "restrict" keywords, as per POSIX. Protect the function
397 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
398 Don't use K&R prototypes. Check the sprintf return values.
399 Re-define EAFNOSUPPORT if not present. Indent.
401 * md5.h, md5.c: Simplify buffer handling visavi alignment,
402 suggested by Bruno Haible <bruno@clisp.org>.
404 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
406 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
408 * gc-libgcrypt.c: Add MD2 (which is not available through
411 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
413 * md2.h, md2.c: New files.
415 2005-10-24 Simon Josefsson <jas@extundo.com>
417 * md4.h: Shrink buffer size, now that we changed the type.
419 2005-10-22 Simon Josefsson <jas@extundo.com>
421 * arcfour.h, arcfour.c: Use fixed size indices in the
422 arcfour_context struct (simplify test vector testing in GNU
425 2005-10-22 Simon Josefsson <jas@extundo.com>
427 * md4.h, md4.c: Simplify buffer handling visavi alignment,
428 suggested by Bruno Haible <bruno@clisp.org>.
430 2005-10-22 Simon Josefsson <jas@extundo.com>
432 * crc.h: Include stddef.h, for size_t.
434 2005-10-21 Simon Josefsson <jas@extundo.com>
436 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
437 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
439 2005-10-21 Simon Josefsson <jas@extundo.com>
441 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
444 2005-10-21 Simon Josefsson <jas@extundo.com>
446 * gc-gnulib.c: Support ARCTWO in CBC mode.
448 2005-10-21 Simon Josefsson <jas@extundo.com>
450 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
453 * hmac-sha1.c (hmac_sha1): Likewise.
455 * crc.c (crc32_update): Actually use crc parameter, suggested by
456 Bruno Haible <bruno@clisp.org>.
458 * crc.h: Include stdint.h directly, suggested by Bruno Haible
461 2005-10-21 Simon Josefsson <jas@extundo.com>
463 * des.h, des.c: New files.
465 * gc-gnulib.c: Support DES.c
467 2005-10-21 Simon Josefsson <jas@extundo.com>
469 * arctwo.h, arctwo.c: New files.
471 * gc-gnulib.c: Support ARCTWO.
473 2005-10-21 Simon Josefsson <jas@extundo.com>
475 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
477 2005-10-19 Simon Josefsson <jas@extundo.com>
479 * gc-gnulib.c: Support ARCFOUR.
481 2005-10-19 Simon Josefsson <jas@extundo.com>
483 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
486 * gc.h: Add ECB enum type.
488 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
490 2005-10-19 Simon Josefsson <jas@extundo.com>
492 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
494 2005-10-18 Simon Josefsson <jas@extundo.com>
496 * md4.h, md4.c: New files, based on md5.?.
498 2005-10-17 Simon Josefsson <jas@extundo.com>
500 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
502 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
504 2005-10-17 Simon Josefsson <jas@extundo.com>
506 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
508 2005-10-17 Simon Josefsson <jas@extundo.com>
510 * gc.h, gc-libgcrypt.c: Add ciphers.
512 2005-10-17 Simon Josefsson <jas@extundo.com>
514 * sha1.c: Use uint32_t instead of md5_uint32.t
516 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
519 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
521 * md5.h: Use stdint.h and uint32_t. Doc fix.
523 2005-10-15 Simon Josefsson <jas@extundo.com>
525 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
527 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
529 2005-10-14 Simon Josefsson <jas@extundo.com>
531 * arcfour.h, arcfour.c: New files.
533 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
535 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
536 include <wchar.h>; no longer needed.
538 2005-10-14 Jakub Jelinek <jakub@redhat.com>
539 and Ulrich Drepper <drepper@redhat.com>
542 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
543 instead of inline stream orientation test and two separate
544 function calls. Pay no attention to USE_IN_LIBIO.
546 2005-10-14 Roland McGrath <roland@redhat.com>
548 Import from libc. [BZ #1331]
549 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
551 Reported by Matej Vela <vela@debian.org>.
553 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
555 * mkdir-p.c (make_dir_parents): Don't report an error if an
556 intermediate directory is in a read-only file system. Problem
557 reported by Eric Blake.
559 2005-10-13 Simon Josefsson <jas@extundo.com>
561 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
562 Move memory allocation outside of loop.
564 2005-10-12 Simon Josefsson <jas@extundo.com>
566 * gc-pbkdf2-sha1.c: New file.
568 * gc.h: Add gc_pbkdf2_sha1 prototype.
570 2005-10-12 Simon Josefsson <jas@extundo.com>
572 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
573 suggested by Bruno Haible <bruno@clisp.org>.
575 2005-10-12 Simon Josefsson <jas@extundo.com>
577 * gc-libgcrypt.c (gc_hmac_sha1): New function.
579 * gc-gnulib.c (gc_hmac_sha1): New function.
581 2005-10-12 Simon Josefsson <jas@extundo.com>
583 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
585 2005-10-12 Simon Josefsson <jas@extundo.com>
587 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
588 GC_USE_HMAC_MD5, respectively.
590 * gc-libgcrypt.c (gc_md5): Fix assert call.
593 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
595 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
597 * gc-gnulib.c (gc_hash_buffer): Ditto.
599 2005-10-11 Bruno Haible <bruno@clisp.org>
601 * c-strcasestr.h: New file, from GNU gettext.
602 * c-strcasestr.c: New file, from GNU gettext.
604 2005-10-11 Bruno Haible <bruno@clisp.org>
606 * c-strcase.h: New file, from GNU gettext.
607 * c-strcasecmp.c: New file, from GNU gettext.
608 * c-strncasecmp.c: New file, from GNU gettext.
610 2005-10-11 Simon Josefsson <jas@extundo.com>
612 * crc.h, crc.c: New files.
614 * gc.h (gc_hash_buffer): Add doc.
616 2005-10-08 Simon Josefsson <jas@extundo.com>
618 * gc.h: Add gc_hash and gc_hash_buffer.
620 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
622 * gc-libgcrypt.c (gc_hash_buffer): Add.
624 2005-10-11 Bruno Haible <bruno@clisp.org>
626 * strcasecmp.c: Include limits.h.
627 (strcasecmp): Avoid integer overflow on exotic platforms.
628 * strncasecmp.c: Include limits.h.
629 (strncasecmp): Avoid integer overflow on exotic platforms.
630 Reported by Paul Eggert.
632 2005-10-06 Simon Josefsson <jas@extundo.com>
634 * hmac-md5.c: New file.
638 2005-10-06 Simon Josefsson <jas@extundo.com>
640 * memxor.c (memxor): Avoid casts and warnings.
642 2005-10-05 Derek Price <derek@ximbiot.com>
644 * getdelim.c (SIZE_MAX): New macro, if not already defined.
646 2005-10-05 Simon Josefsson <jas@extundo.com>
648 * memxor.c (memxor): Fix compiler error.
650 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
651 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
653 * memxor.h, memxor.c: New files.
655 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
656 we assume all systems have it, suggested by Jim Meyering
657 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
658 any systems lack sys/socket.h; mingw32 is known to lack it, but we
659 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
662 2005-10-04 Bruno Haible <bruno@clisp.org>
664 * verify.h (verify_true): Provide alternative definition for C++.
666 2005-10-04 Simon Josefsson <jas@extundo.com>
668 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
669 D. Baushke" <mdb@gnu.org>.
671 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
673 * getdelim.c: Include getdelim.h first. Include <limits.h>.
674 (SSIZE_MAX): New macro, if not already defined.
675 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
678 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
680 * exclude.c: Include verify.h.
681 (verify): Remove. All callers changed to use verify.h's version.
682 * strtoimax.c: Likewise.
683 * utimecmp.c: Likewis.e
686 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
687 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
688 * .cvsignore: Add fts.h, search.h, t-fpending.
689 * settime.c (settime): Fix { typo in previous patch. Also, don't
690 bother returning ENOSYS if settimeofday or stime fails; just let
691 them return whatever errno they want to return.
692 * utimens.c: Include unistd.h, for dup2.
693 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
694 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
696 2005-10-02 Jim Meyering <jim@meyering.net>
699 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
700 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
701 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
702 Remove AT_FDCWD test.
703 Do not consume the fd unless successful.
704 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
705 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
706 block, so that we don't even try to compile it if settimeofday is
707 available. This works around a compilation failure on OSF1 V5.1,
708 due to stime requiring a `long int*' while tv_sec is `int'.
710 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
712 * getdelim.c (getdelim): Remove unused variables.
714 2005-10-01 Simon Josefsson <jas@extundo.com>
716 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
717 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
718 AI_* and EAI_* definitions. Protect function declarations.
720 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
722 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
723 so that the code works even with ancient cpp. Portability problem
724 with GCC 2.7.2.1 reported by Thomas M.Ott.
726 2005-09-27 Jim Meyering <jim@meyering.net>
728 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
730 * intprops.h (signed_type_or_expr__): Define.
731 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
734 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
736 * verify.h (verify_expr): Remove, replacing with:
737 (verify_true): New macro that returns true instead of void.
738 (verify_type__): Remove.
739 (verify): Use verify_true rather than verify_type__.
741 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
743 * utimens.c (ENOSYS): Define if not already defined.
744 (futimens): Support having a null PATH if the file descriptor
747 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
749 (__attribute): Define to empty unless GCC 3.1 or later.
750 This works around a core dump on OpenBSD 3.4, which has GCC
751 2.95.3, which dumps core when given __attribute__(()). It also
752 simplifies other tests, since we really don't want to bother with
753 worrying about which ancient version of GCC supported what.
754 Original problem reported by Yoann Vandoorselaere, with part of
755 the fix suggested by Derek Price.
757 2005-09-24 Jim Meyering <jim@meyering.net>
759 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
760 so we can once again use a positive bitfield width of 1 -- now we
761 don't have to explain why we were using a bitfield width of 2.
763 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
765 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
766 Problem reported by Eric Blake.
767 (getaddrinfo): Initialize se so that it's not garbage.
768 Redo internal storage allocation so that it doesn't make unportable
769 assumptions about alignment.
772 * utimens.c (futimens): Use futimesat if available.
773 Prefer it to futimes since it doesn't have the futimes bug.
775 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
776 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
777 Instead, declare a function that returns a pointer to an array,
778 and use verify_type__ to declare the size of the array.
779 Problem and germ of a solution reported by Bruno Haible.
780 (verify_type__): Use 2, not 1, for bitfield size, to avoid
781 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
783 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
787 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
789 * argmatch.h: Include verify.h
790 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
791 (ARGMATCH_ASSERT): Remove; unused.
792 * canonicalize.c: Assume STDC_HEADERS.
793 * exclude.c: Include "strcase.h".
794 * regex_internal.h [!defined _LIBC]: Likewise.
795 * getusershell.c: Include stdio--.h rather than stdio.h
797 (getusershell): Call fopen, not fopen_safer.
798 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
799 Do not include unistd-safer.h.
800 (save_cwd): Don't call fd_safer; no longer needed
801 now that we include fcntl--.h.
803 * getdate.y (relative_time): New type.
804 (RELATIVE_TIME_0): New constant.
805 (parser_control): Use relative_time instead of doing it ourselves.
806 (%union): Add new relative_time rel member.
807 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
809 (relunit, relunit_snumber): Now of type rel.
810 (zone, rel, relunit, get_date): Adjust to above changes.
812 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
813 Do not include unistd-safer.h.
814 (getloadavg): Don't call fd_safer; no longer needed
815 now that we include fcntl--.h.
817 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
818 (make_dir_parents): Treat ENOSYS like EEXIST.
820 Improve quality of diagnostics on restore_cwd failure.
821 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
822 (make_dir_parents): Last arg is now int * (for errno), not bool *.
823 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
824 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
825 each time through the loop. Do not diagnose restore_cwd failure;
826 that is the caller's job (and perhaps the caller does not care).
828 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
829 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
830 If the file already exists but is not a directory, don't bother
831 to try to make its parents.
832 Close potential file descriptor leak if we can't chdir("/") (!).
833 Don't always return true if chdir($PWD) fails; return true only
834 if the requested action was done successfully (except for the
836 Don't log final directory unless we actually made it.
837 Refactor to avoid duplicate code to fix up permissions.
838 Don't attempt to fix up parent permissions if chdir($PWD) fails.
840 * strftime.c (my_strftime): Rewrite the previous change slightly,
841 to make it a bit faster and (I hope) clearer.
842 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
843 Fix bug in formats like %2N.
845 * verify.h: New file.
847 2005-09-22 Jim Meyering <jim@meyering.net>
851 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
853 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
854 the .tm_year member, since otherwise gcc-4.0 would now warn about
855 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
857 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
858 order to avoid an unsuppressible warning from gcc on 64-bit systems.
860 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
861 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
862 when run in a time zone for which daylight savings time is in effect
863 for the starting date.
865 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
866 stop us from restricting permissions of just-created absolute-named
868 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
869 to restore initial working directory.
870 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
871 to tell caller if/when we change the working directory and are
872 unable to return to the initial one.
873 * mkdir-p.h (make_dir_parents): Update prototype.
874 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
875 `return false'. This fixes a bug introduced on 2004-07-30.
877 * openat.c (fdopendir): Be sure to close the supplied
878 file descriptor before returning. This makes our replacement
879 implementation a little closer to Solaris's, where fdopendir
880 ties the file descriptor to the returned DIR* pointer.
881 * openat.c (unlinkat): New function.
882 * openat.h (unlinkat): Add prototype.
883 * openat-die.c (openat_save_fail): Rename from openat_save_die.
884 (openat_restore_fail): Rename from openat_restore_die.
885 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
887 Provide an alternative to exiting immediately upon save_cwd or
888 restore_cwd failure. Now, an application can arrange e.g.,
889 to perform a longjump in that case.
890 * openat.c: Include dirname.h.
891 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
892 (rpl_openat, fdopendir, fstatat): Call openat_save_die
893 and openat_restore_die rather than calling error directly.
894 Don't include "error.h" or "exitfail.h"; they're no longer needed.
896 * openat-die.c (openat_save_die, openat_restore_die): New file.
897 * openat.h (openat_save_die, openat_restore_die): Declare and define.
899 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
900 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
901 int utc, int nanoseconds);
903 date should not have to allocate a megabyte of virtual memory to
904 handle a format argument like +%1048575T. When implemented with
905 strftime, it must allocate such a buffer, use strftime to fill it
906 in, print it, then free it.
907 With fprintftime, it simply prints everything and exits.
908 With no need for memory allocation, that's one fewer way to fail.
909 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
910 optional field width, not before, so we accept %9:z, not %:9z.
911 (my_strftime): Be sure to use L_('x') for literals.
913 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
914 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
915 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
916 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
917 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
918 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
919 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
920 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
921 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
923 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
924 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
925 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
926 and don't include <sys/file.h>).
928 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
932 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
933 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
934 [!LDAV_DONE]: Avoid unused variable warning.
936 2005-09-21 Bruno Haible <bruno@clisp.org>
938 * unicodeio.h (unicode_to_mb): New declaration.
940 2005-09-20 Derek Price <derek@ximbiot.com>
942 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
944 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
946 Use a consistent style for including <config.h>.
947 * __fpending.c, acl.c, argmatch.c,
948 argp-help.c, argp-parse.c,
949 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
950 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
951 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
952 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
953 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
954 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
955 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
956 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
957 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
958 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
959 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
960 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
961 modechange.c, mountlist.c, open-safer.c, physmem.c,
962 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
963 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
964 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
965 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
966 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
967 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
968 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
969 userspec.c, utimecmp.c, version-etc-fsf.c,
970 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
971 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
972 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
973 Standardize inclusion of config.h.
974 * __fpending.h, dirfd.h, getdate.h, human.h,
975 inttostr.h: Removed inclusion of config.h from header files.
976 * inttostr.c: Adjusted in-tree users.
977 * timespec.h: Remove superfluous warning to include config.h.
978 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
979 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
980 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
981 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
983 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
985 * stat-time.h: New file.
986 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
987 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
989 (timespec_cmp): New function.
990 * utimecmp.c: Include stat-time.h.
991 (SYSCALL_RESOLUTION): Depend on whether various struct stat
992 members exist, not on the obsolescent ST_MTIM_NSEC.
993 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
995 2005-09-15 Derek Price <derek@ximbiot.com>
996 Paul Eggert <eggert@cs.ucla.edu>
998 * regcomp.c, regexec.c, regex_internal.c: Back out previous
999 changes, consolidating in...
1000 * regex_internal.h: ...this file.
1002 2005-09-15 Derek Price <derek@ximbiot.com>
1004 * regex_internal.h: Blank `pure' for GNUC < 3.
1005 * regex_internal.c: Ditto, using this...
1006 (__GNUC_PREREQ): ...new macro.
1007 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
1008 (__GNUC_PREREQ): ...this new macro.
1010 * strstr.h: Include string.h. Define strstr as a macro here.
1012 2005-09-13 Derek Price <derek@ximbiot.com>
1014 * canon-host.c (canon_host_r): Set *cherror on memory allocation
1016 Reported by Jim Meyering <jim@meyering.net>.
1018 2005-09-13 Jim Meyering <jim@meyering.net>
1020 * canon-host.c: Filter through gnu indent and reword comments slightly.
1021 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
1023 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1025 * lib/base64.c: Typo.
1026 (base64_encode): Put b64str in initialized data section.
1028 2005-09-12 Derek Price <derek@ximbiot.com>
1030 Return usable errors from canon-host.
1031 * canon-host.h: New file.
1032 * canon-host.c (canon_host): Wrap...
1033 (canon_host_r): ...this new function, which now relies exclusively on
1035 (ch_strerror): New function.
1036 (last_cherror): New global.
1037 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
1038 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
1040 (freeaddrinfo): Free ai->ai_canonname when set.
1042 2005-09-12 Derek Price <derek@ximbiot.com>
1043 Paul Eggert <eggert@cs.ucla.edu>
1045 * glob-libc.h: Renamed from glob_.h. The new version is
1046 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
1047 protecting things that should be done only in gnulib contexts.
1048 * glob_.h: New file, containing only the glob things needed for
1050 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
1051 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
1052 (glob, globfree, glob_pattern_p): Now defined simply in terms of
1053 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
1054 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
1055 and to respect the namespace rules better.
1057 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
1059 Merge glibc and coreutils changes into gnulib, plus a few
1061 * md5.c: Use #error rather than a string.
1062 (CYCLIC): New macro, from glibc source. Use it instead of rol.
1063 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
1064 (__attribute__): Define to empty for non recent-GCC.
1065 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
1066 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
1067 Renamed from their non-__ counterparts, with new macros replacing
1068 them if not _LIBC. Add __THROW attribute.
1070 (struct md5_ctx): Align buffer if using GCC.
1071 * sha1.h (struct sha1_ctx): Likewise.
1072 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
1073 The old name was backwards.
1074 (NOTSWAP): Remove; not used.
1075 (rol): New macro, moved here from md5.h.
1076 (sha1_process_block): Remove a FIXME that doesn't make sense.
1078 2005-09-12 Derek Price <derek@ximbiot.com>
1080 * gai_strerror.c: Include config.h when available. Include
1081 getaddrinfo.h before other headers to test interface.
1082 Reported by Larry Jones <lawrence.jones@ugs.com>.
1084 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
1086 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
1087 definitions, since that's the preferred style in glibc.
1088 Fix a minor spacing issue, and update copyright notice to match glibc's.
1090 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1092 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
1094 2005-09-06 Simon Josefsson <jas@extundo.com>
1096 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
1097 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
1099 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
1101 Change bitset word type from unsigned int to unsigned long int,
1102 as this has better performance on typical 64-bit hosts.
1103 Port bitset code to hosts with unusual word sizes.
1104 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
1105 (build_collating_symbol):
1106 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
1107 argument is a bitset. This is merely a style issue, but it makes
1108 it clearer that an entire array is expected.
1109 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
1110 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
1111 Port to the case where bitset_word is not the same as unsigned int.
1112 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
1113 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
1115 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1116 (build_trtable, group_nodes_into_DFAstates):
1118 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
1119 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
1120 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
1121 * regexec.c (group_nodes_into_DFAstates): Likewise.
1122 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
1123 * regcomp.c (optimize_subexps, lower_subexp):
1124 Work even if bitset_word has holes in its bitwise representation.
1125 * regex_internal.h (BITSET_WORD_BITS): Likewise.
1126 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1128 * regex_internal.c (re_string_reconstruct):
1129 Don't assume UCHAR_MAX == 255.
1130 * regex_internal.h (bitset_set_all): Likewise.
1131 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
1133 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
1134 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
1136 (BITSET_WORD_MAX): New macro.
1137 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
1138 (bitset_set_all, bitset_copy): Now inline functions, not macros.
1139 (bitset_empty, bitset_copy):
1140 Prefer sizeof (bitset) to multiplying it out ourselves.
1141 (bitset_not_merge): Remove; unused.
1142 (bitset_contain): Return bool, not unsigned int with one bit on.
1143 All callers changed.
1144 * regexec.c (build_trtable): Don't assume bitset has no stricter
1145 alignment than re_node_set; do this by defining a new internal
1146 type struct dests_alloc and using it to allocate memory.
1148 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
1150 Check for arithmetic overflow when calculating sizes, to prevent
1151 some buffer-overflow issues. These patches are conservative, in the
1152 sense that when I couldn't determine whether an overflow was possible,
1153 I inserted a run-time check.
1154 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
1155 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
1156 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
1157 (re_xnrealloc, re_x2nrealloc): New inline functions.
1158 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
1159 (build_equiv_class, build_charclass): Check for arithmetic overflow
1160 in size expression calculations.
1161 * lib/regex_internal.c (re_string_realloc_buffers):
1162 (build_wcs_upper_buffer, re_node_set_add_intersect):
1163 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
1164 (re_dfa_add_node, register_state): Likewise.
1165 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
1166 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
1167 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
1168 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
1170 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
1172 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
1173 to avoid a collision with bits/local_lim.h in glibc.
1174 All uses changed. Problem reported by Dmitry V. Levin in
1175 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
1177 * regex_internal.c (build_wcs_upper_buffer): Fix portability
1178 bugs in int versus size_t comparisons.
1179 (re_string_context_at): Fix bug where the code assumed that
1182 Use bool where appropriate.
1183 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
1184 All callers changed.
1185 (calc_eclosure_iter): Likewise, for ROOT arg.
1186 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
1187 (build_charclass_op): Likewise, for NON_MATCH arg.
1188 * regex_internal.c (re_string_allocate, re_string_construct):
1189 (re_string_construct_common): Likewise, for ICASE arg.
1190 * regexec.c (re_search_2_stub, re_search_stub):
1191 Likewise, for RET_LEN arg.
1192 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
1193 (set_regs): Likewise, for FL_BACKTRACK arg.
1194 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
1195 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
1196 (calc_eclosure_iter, parse_bracket_exp):
1197 Use bool for internal variables that are booleans.
1198 * regexec.c (re_search_internal, check_matching, proceed_next_node):
1199 (set_regs, build_sifted_states, sift_states_bkref):
1200 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
1201 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1202 (find_collation_sequence_value):
1204 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
1205 (re_node_set_compare):
1206 Return bool, not int. All callers changed.
1207 * regexec.c (check_halt_node_context, check_dst_limits):
1208 (build_trtable, check_node_accept): Likewise.
1209 * regex_internal.h: Include stdbool.h.
1211 Fix bugs uncovered when converting to bool.
1212 * regcomp.c (calc_eclosure_iter): Check for storage allocation
1213 failure instead of charging ahead blindly.
1214 * regex_internal.c (register_state): Likewise.
1215 * regexec.c (re_search_2_stub): Use simpler method than boolean
1216 for freeing internal storage.
1217 (group_nodes_into_DFA_states): Use unsigned int, not int, for
1218 bitset pieces used as boolean, to avoid undefined behavior
1219 on hosts that do int overflow checking.
1221 2005-08-31 Derek Price <derek@ximbiot.com>
1223 * getdelim.c (getdelim): Return EOF on EOF.
1224 Reported by Larry Jones <lawrence.jones@ugs.com>.
1226 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
1228 * regex_internal.c (re_string_reconstruct): Don't assume buffer
1229 lengths fit in regoff_t; this isn't true if regoff_t is the same
1231 * regex.c (re_search_internal): 5th arg is LAST_START
1232 (= START + RANGE) instead of RANGE. This avoids overflow
1233 problems when regoff_t is the same width as size_t.
1234 All callers changed.
1235 (re_search_2_stub): Check for overflow when adding the
1236 sizes of the two strings.
1237 (re_search_stub): Check for overflow when adding START
1238 to RANGE; if it occurs, substitute the extreme value.
1240 2005-08-31 Jim Meyering <jim@meyering.net>
1242 * regcomp.c (search_duplicated_node): Make first pointer arg
1244 * regex_internal.c (create_ci_newstate, create_cd_newstate):
1245 (register_state): Likewise.
1246 * regexec.c (search_cur_bkref_entry, check_dst_limits):
1247 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1248 (group_nodes_into_DFAstates): Likewise.
1250 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
1252 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
1253 old glibc regex code mishandles strings longer than 2**31 bytes.
1254 This patch fixes this when the regex code is used in gnulib
1255 (i.e., outside glibc).
1257 This patch should not affect the use of the regex code inside
1258 glibc. No doubt this problem also needs to be handled for glibc
1259 as well, but the result will be an incompatible change to the
1260 glibc ABI, and the old ABI will have to be supported too. That
1261 can be the the subject for another patch.
1263 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
1264 governing whether the rest of this patch is active. By default,
1265 the macro is disabled and the patch has no effect.
1266 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
1267 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
1268 (struct re_pattern_buffer, re_search, re_search_2, re_match):
1269 (re_match_2, re_set_registers): Use the new types.
1270 * regex_internal.h (Idx, re_hashval_t): New types.
1271 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
1273 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
1274 (re_string_context_at, bin_tree_t, re_dfastate_t):
1275 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
1276 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
1277 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
1278 (re_string_char_size_at, re_string_wchar_at):
1279 (re_string_elem_size_at):
1280 Use the new types and macros to port to 64-bit hosts.
1281 Use unsigned types for internal values, so that the code
1282 mostly works even for arrays larger than SSIZE_MAX.
1283 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
1284 (search_duplicated_node, calc_eclosure_iter, fetch_number):
1285 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
1286 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
1287 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
1288 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
1289 (calc_inveclosure, parse_dup_op, build_range_exp):
1290 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
1291 (fetch_number, create_token_tree, mark_opt_subexp):
1293 * regex_internal.c (re_string_construct_common, create_ci_newstate):
1294 (create_cd_newstate, re_string_allocate, re_string_construct):
1295 (re_string_realloc_buffers, build_wcs_upper_buffer):
1296 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1297 (re_string_reconstruct, re_string_peek_byte_case):
1298 (re_string_fetch_byte_case, re_string_context_at):
1299 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1300 (re_node_set_init_copy, re_node_set_add_intersect):
1301 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1302 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1303 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1304 (re_acquire_state, re_acquire_state_context, register_state):
1306 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
1307 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
1308 (re_search_internal, re_search_2_stub, re_search_stub)
1309 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
1310 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
1311 (update_cur_sifted_state, check_dst_limits):
1312 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1313 (check_subexp_limits, sift_states_bkref, merge_state_array):
1314 (check_subexp_matching_top, get_subexp, get_subexp_sub):
1315 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
1316 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1317 (expand_bkref_cache, check_node_accept_bytes):
1318 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
1319 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
1320 (acquire_init_state_context, check_halt_node_context):
1321 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
1322 (sift_states_backward, clean_state_log_if_needed):
1323 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
1324 (find_recover_state, transit_state_sb, transit_state_mb):
1325 (transit_state_bkref, build_trtable, match_ctx_clean):
1327 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
1328 to work around an assumption that REG_MISSING is negative.
1330 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
1331 (seek_collating_symbol_entry) [defined _LIBC]:
1332 (lookup_collation_sequence_value) [defined _LIBC]:
1333 (build_range_exp, build_collating_symbol) [defined _LIBC]:
1334 Use prototypes rather than old-style function definitions.
1335 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
1336 (transit_state_sb) [0]:
1337 (find_collation_sequence_value) [defined _LIBC]: Likewise.
1339 * regexec.c (re_search_internal): Simplify update of rm_so and
1342 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
1343 (optimize_subexps, lower_subexp):
1344 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
1345 since the signed shift might overflow. Use 1u<<31 instead.
1346 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
1347 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1350 * regcomp.c (optimize_subexps, lower_subexp):
1351 Use CHAR_BIT rather than 8, for clarity.
1352 * regexec.c (check_dst_limits_calc_pos_1):
1353 (check_subexp_matching_top): Likewise.
1354 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
1355 have to worry about portability issues when shifting it left.
1356 Remove no-longer-needed test for table_size > 0.
1357 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
1358 in a word, as the resulting behavior is undefined.
1359 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
1360 in one case, a <= should have been an <, and in another case the
1361 whole test was missing.
1362 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
1363 the standard name CHAR_BIT.
1364 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
1365 this is not true on one's complement and signed-magnitude hosts.
1367 * regex_internal.h (re_sub_match_top_t): Remove unused member
1369 (struct re_dfa_t): Remove unused member states_alloc.
1370 * regcomp.c (init_dfa): Don't initialize unused members.
1372 2005-08-31 Bruno Haible <bruno@clisp.org>
1374 * strstr.c: Include <stddef.h>, for NULL.
1375 * strcasestr.c: Likewise.
1376 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
1378 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
1380 * iconvme.h: Add prototype for iconv_alloc.
1382 2005-08-29 Simon Josefsson <jas@extundo.com>
1384 * iconvme.c: Fix errno.
1386 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
1388 * iconvme.c: Split iconv_string into iconv_alloc.
1390 2005-08-27 Jim Meyering <jim@meyering.net>
1392 * fopen-safer.c: Merge minor changes from coreutils.
1393 * dup-safer.c: Likewise.
1394 * fd-safer.c: Likewise.
1396 Merge from coreutils.
1397 * stdio--.h: New file.
1398 * stdlib--.h: New file.
1399 * mkstemp-safer.c: New file.
1401 GNU tar needs these.
1402 * pipe-safer.c: New file.
1403 * creat-safer.c: New file.
1404 * fcntl--.h (creat): Define to creat_safer.
1405 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
1406 * unistd--.h (pipe): Define to pipe_safer.
1407 * unistd-safer.h: Declare pipe_safer.
1409 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
1411 * regex_internal.h: Remove all references to
1412 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
1414 (bitset_not, bitset_merge, bitset_not_merge):
1415 (bitset_mask, re_string_allocate, re_string_construct):
1416 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
1417 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
1418 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
1419 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
1420 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1421 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1422 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
1423 (re_acquire_state_context):
1424 Remove unnecessary forward decls.
1425 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
1426 Put __attribute at function definition,
1427 now that the function decl has been removed.
1428 * lib/regex_internal.c (re_string_peek_byte_case):
1429 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
1432 2005-08-26 Simon Josefsson <jas@extundo.com>
1434 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
1435 Haible <bruno@clisp.org>.
1437 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1439 * regexec.c (set_regs): Don't alloca with an unbounded size.
1441 alloca modernization/simplification for regex.
1442 * regex.c: Remove portability cruft for alloca. This no longer
1443 needs to be at the start of the file, and can be moved into
1444 regex_internal.h and simplified.
1445 * regex_internal.h: Include <alloca.h>.
1446 (__libc_use_alloca) [!defined _LIBC]: New macro.
1447 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
1448 now works outside glibc.
1450 2005-08-24 Simon Josefsson <jas@extundo.com>
1452 * getpass.c: Add WIN32 implementation. Conditionalize use of
1453 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
1454 GLIBC specific code.
1456 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1458 Make regex safe for g++. This fixes one real bug (an "err"
1459 that should have been "*err"). g++ problem reported by
1461 * regex_internal.h (re_calloc): New macro, consistent with
1462 re_malloc etc. All callers of calloc changed to use re_calloc.
1463 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
1464 not int. All callers changed.
1465 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
1466 just use an array of size MB_LEN_MAX.
1467 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
1468 (find_recover_state): Change "err" to "*err"; this fixes what
1469 appears to be a real bug.
1470 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
1473 2005-08-25 Jim Meyering <jim@meyering.net>
1475 * open-safer.c: Include <config.h>.
1476 Otherwise, we'd lose LARGEFILE support in any file using
1479 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1481 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
1482 * regex.h (regerror): Likewise.
1484 * regex.c: Do not include <sys/types.h>, as POSIX no longer
1485 requires this. (The code never needed it.)
1487 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
1488 All uses of recently-renamed identifiers changed to use the new,
1489 POSIX-compliant names. The code will build and run just fine
1490 without these changes, but it's better to eat our own dog food
1491 and use the standard-conforming names.
1493 * regex.h: Fix a multitude of POSIX name space violations.
1494 These changes have an effect only for programs that define
1495 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
1496 do not change anything for programs compiled in the normal way.
1497 Also, there is no effect on the ABI.
1499 (_REGEX_SOURCE): New macro.
1500 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
1501 defined and _GNU_SOURCE is not; this fixes a name space violation.
1503 Rename the following macros to obey POSIX requirements.
1504 The old names are still visible as macros if _REGEX_SOURCE is defined.
1505 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
1506 RE_BACKSLASH_ESCAPE_IN_LISTS.
1507 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
1508 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
1509 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
1510 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
1511 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
1512 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
1513 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
1514 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
1515 (REG_INTERVALS): renamed from RE_INTERVALS.
1516 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
1517 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
1518 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
1519 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
1520 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
1521 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
1522 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
1523 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
1524 RE_UNMATCHED_RIGHT_PAREN_ORD.
1525 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
1526 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
1527 (REG_DEBUG): renamed from RE_DEBUG.
1528 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
1529 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
1530 unusual, since we can't clash with the POSIX REG_ICASE.
1531 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
1532 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
1533 (REG_NO_SUB): renamed from RE_NO_SUB.
1534 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
1535 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
1536 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
1537 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
1538 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
1539 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
1540 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
1541 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
1542 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
1543 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
1544 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
1545 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
1546 RE_SYNTAX_POSIX_MINIMAL_BASIC.
1547 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
1548 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
1549 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
1550 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
1551 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
1552 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
1553 (REG_FIXED): Renamed from REGS_FIXED.
1554 (REG_NREGS): Renamed from RE_NREGS.
1556 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
1557 of other REG_* macros, since POSIX says the user is allowed to
1558 #undef these macros selectively.
1560 (reg_errcode_t): Update comment stating what other tables need
1563 Rename the following enum values to obey POSIX requirements.
1564 The old names are still visible as macros.
1565 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
1566 is not defined, since GNU is supposed to be a superset of POSIX as
1567 much as possible, and since we want reg_errcode_t to be a signed
1568 type for implementation consistency.
1569 (_REG_NOERROR): Renamed from REG_NOERROR.
1570 (_REG_NOMATCH): Renamed from REG_NOMATCH.
1571 (_REG_BADPAT): Renamed from REG_BADPAT.
1572 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
1573 (_REG_ECTYPE): Renamed from REG_ECTYPE.
1574 (_REG_EESCAPE): Renamed from REG_EESCAPE.
1575 (_REG_ESUBREG): Renamed from REG_ESUBREG.
1576 (_REG_EBRACK): Renamed from REG_EBRACK.
1577 (_REG_EPAREN): Renamed from REG_EPAREN.
1578 (_REG_EBRACE): Renamed from REG_EBRACE.
1579 (_REG_BADBR): Renamed from REG_BADBR.
1580 (_REG_ERANGE): Renamed from REG_ERANGE.
1581 (_REG_ESPACE): Renamed from REG_ESPACE.
1582 (_REG_BADRPT): Renamed from REG_BADRPT.
1583 (_REG_EEND): Renamed from REG_EEND.
1584 (_REG_ESIZE): Renamed from REG_ESIZE.
1585 (_REG_ERPAREN): Renamed from REG_ERPAREN.
1586 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1587 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1588 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1589 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1591 (_REG_RE_NAME, _REG_RM_NAME): New macros.
1592 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
1593 changed. But support the old name if the new one is not defined
1594 and if _REGEX_SOURCE.
1596 Change the following member names in struct re_pattern_buffer.
1597 The old names are still supported if !_REGEX_SOURCE.
1598 The new names are always supported, regardless of _REGEX_SOURCE.
1599 (re_buffer): Renamed from buffer.
1600 (re_allocated): Renamed from allocated.
1601 (re_used): Renamed from used.
1602 (re_syntax): Renamed from syntax.
1603 (re_fastmap): Renamed from fastmap.
1604 (re_translate): Renamed from translate.
1605 (re_can_be_null): Renamed from can_be_null.
1606 (re_regs_allocated): Renamed from regs_allocated.
1607 (re_fastmap_accurate): Renamed from fastmap_accurate.
1608 (re_no_sub): Renamed from no_sub.
1609 (re_not_bol): Renamed from not_bol.
1610 (re_not_eol): Renamed from not_eol.
1611 (re_newline_anchor): Renamed from newline_anchor.
1613 Change the following member names in struct re_registers.
1614 The old names are still supported if !_REGEX_SOURCE.
1615 The new names are always supported, regardless of _REGEX_SOURCE.
1616 (rm_num_regs): Renamed from num_regs.
1617 (rm_start): Renamed from start.
1618 (rm_end): Renamed from end.
1620 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1621 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1622 Prepend __ to parameter names.
1624 Undo yesterday's changes.
1626 2005-08-24 Jim Meyering <jim@meyering.net>
1628 Sync from coreutils.
1629 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1631 2005-08-21 Bruno Haible <bruno@clisp.org>
1633 * lock.h: Add multiple inclusion guard.
1634 * tls.h: Add multiple inclusion guard.
1636 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
1638 * regex.h (REG_NOSYS)
1639 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1640 Define, since POSIX requires it as of 2001.
1641 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1642 New private symbol, used to keep the enum signed in all cases.
1643 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1644 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1646 * regex_internal.c (re_string_skip_chars, register_state):
1648 Remove forward decls; no longer needed now that we use prototypes.
1649 * regexec.c (acquire_init_state_context, check_halt_node_context):
1650 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1651 (clean_state_log_if_needed): Likewise.
1653 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1655 Fix problems reported by Sam Steingold in
1656 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1657 * regexec.c (sift_states_bkref): Fix portability bug: the code
1658 assumed that reg_errcode_t is a signed type, which is not
1659 necessarily true if _XOPEN_SOURCE is not defined.
1660 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1661 some compilers warn about it otherwise.
1663 2005-08-20 Jim Meyering <jim@meyering.net>
1665 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1666 of unused local, dfa.
1668 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1670 * regcomp.c (create_initial_state): Remove duplicate decl.
1671 (init_word_char, create_initial_state, duplicate_node_closure):
1672 (fetch_token, peek_token_bracket, build_range_exp):
1673 (build_collating_symbol): Remove forward decls; no longer needed
1674 now that we use prototypes.
1677 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1678 (re_compile_fastmap_iter, regcomp, regerror, regfree):
1679 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1680 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1681 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1682 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1683 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1684 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1685 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1686 (build_range_exp, build_collating_symbol, parse_bracket_exp):
1687 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1688 (build_charclass, build_charclass_op, fetch_number, create_tree):
1689 (create_token_tree, mark_opt_subexp, duplicate_tree):
1690 Use prototypes rather than old-style definitions.
1693 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1694 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1695 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1696 (re_string_reconstruct, re_string_peek_byte_case):
1697 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1698 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1699 (re_node_set_init_copy, re_node_set_add_intersect):
1700 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1701 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1702 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1703 (re_acquire_state, re_acquire_state_context, register_state):
1704 (create_ci_newstate, create_cd_newstate, free_state):
1706 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1707 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1708 (re_search_internal, prune_impossible_nodes):
1709 (acquire_init_state_context, check_matching, static):
1710 (check_halt_node_context, check_halt_state_context, proceed_next_node):
1711 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1712 (update_regs, sift_states_backward, build_sifted_states):
1713 (clean_state_log_if_needed, merge_state_array):
1714 (update_cur_sifted_state, add_epsilon_src_nodes):
1715 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1716 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1717 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1718 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1719 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1720 (check_arrival, check_arrival_add_next_nodes):
1721 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1722 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1723 (check_node_accept_bytes, check_node_accept, extend_buffers):
1724 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1725 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1730 (re_string_allocate, re_string_construct, re_string_reconstruct):
1731 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1732 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1733 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1734 (re_string_context_at, re_string_peek_byte_case):
1735 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1736 is defined, since we now use prototypes always.
1738 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1739 C89 or better. All uses removed.
1741 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1743 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1744 [defined lint]: Suppress bogus uninitialized-variable warnings.
1746 * regcomp.c (duplicate_node): Return new index, not an error code,
1747 and let the caller return REG_ESPACE if out of space. This
1748 removes an uninitialied-variable warning with GCC 4.0.1, and also
1749 avoids taking the address of a local variable. All callers
1752 2005-08-19 Jim Meyering <jim@meyering.net>
1754 * regexec.c (proceed_next_node): Redo local variables to
1755 avoid GCC shadowing warnings.
1757 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1759 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1760 (re_node_set_insert_last, re_dfa_add_node):
1761 Rename local variables to avoid GCC shadowing warnings.
1763 2005-08-18 Bruno Haible <bruno@clisp.org>
1765 * strstr.c (strstr): Fix return value in multibyte case.
1766 * strcasestr.c (strcasestr): Likewise.
1768 2005-08-17 Jim Meyering <jim@meyering.net>
1770 Make the %s format (seconds since the epoch) work for a negative
1771 number and when used with a zero-padded field width, e.g. %015s.
1773 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1774 label so that it precedes the code to set `digits'. Otherwise,
1775 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1776 print `00-22'. Now, it prints `-0022', as it should.
1778 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1780 * regex.h: Remove useless space-before-tab. From coreutils.
1782 2005-08-17 Bruno Haible <bruno@clisp.org>
1784 * strcasestr.h: New file.
1785 * strcasestr.c: New file.
1787 2005-08-17 Bruno Haible <bruno@clisp.org>
1789 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1790 * strstr.c: Completely rewritten, with multibyte locale support.
1792 2005-08-17 Bruno Haible <bruno@clisp.org>
1794 * strcasecmp.c: Use mbuiter.h.
1796 2005-08-17 Bruno Haible <bruno@clisp.org>
1798 * mbuiter.h: New file.
1800 2005-08-16 Bruno Haible <bruno@clisp.org>
1802 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1804 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1805 NUL byte, not after it.
1807 2005-08-16 Bruno Haible <bruno@clisp.org>
1809 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1810 the valid ones. Makes the comparison operations transitive:
1811 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1812 * strcasecmp.c (strcasecmp): Use mb_casecmp.
1814 2005-08-16 Bruno Haible <bruno@clisp.org>
1816 * strcase.h (strcasecmp): Add note in comments.
1817 * strncasecmp.c: Use code from strcasecmp.c.
1818 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1819 (strcasecmp): Work correctly in multibyte locales.
1821 2005-08-16 Bruno Haible <bruno@clisp.org>
1823 * strnlen1.h: New file.
1824 * strnlen1.c: New file.
1826 2005-08-16 Bruno Haible <bruno@clisp.org>
1828 * mbfile.h: New file.
1830 2005-08-16 Bruno Haible <bruno@clisp.org>
1832 * mbiter.h: New file.
1834 2005-08-16 Bruno Haible <bruno@clisp.org>
1836 * mbchar.h: New file.
1837 * mbchar.c: New file.
1839 2005-08-16 Bruno Haible <bruno@clisp.org>
1841 * tls.h: New file, from GNU gettext.
1842 * tls.c: New file, from GNU gettext.
1844 2005-08-15 Bruno Haible <bruno@clisp.org>
1846 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1849 2005-08-14 Jim Meyering <jim@meyering.net>
1851 Sync from coreutils.
1853 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1854 Use the hash-table-based cycle-detection code not just when
1855 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1856 Reported by James Youngman in
1857 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1858 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1859 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1860 This lets us compile with -DFTS_DEBUG, once again.
1861 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1862 * fts.c (fd_safer): Remove decl.
1863 Include fcntl--.h rather than unistd-safer.h
1864 (fts_safe_changedir): Don't call fd_safer; no longer needed
1865 now that we include fcntl--.h.
1867 2005-08-11 Simon Josefsson <jas@extundo.com>
1869 * readline.h, readline.c: New file.
1871 2005-08-11 Bruno Haible <bruno@clisp.org>
1873 * strnlen.h (strnlen): Change parameter name to match comment.
1875 2005-08-10 Simon Josefsson <jas@extundo.com>
1877 * strndup.c: Use strnlen.h.
1879 * strnlen.h: New file.
1881 2005-08-02 Simon Josefsson <jas@extundo.com>
1883 * getline.h, getline.c: Rewrite.
1885 * getdelim.h, getdelim.c: New files, ported from glibc.
1887 2005-07-31 Bruno Haible <bruno@clisp.org>
1889 * lock.h (gl_lock_initializer): New macro.
1890 (gl_lock_define_initialized): Use it.
1891 (gl_rwlock_initializer): New macro.
1892 (gl_rwlock_define_initialized): Use it.
1893 (gl_recursive_lock_initializer): New macro.
1894 (gl_recursive_lock_define_initialized): Use it.
1896 2005-07-26 Bruno Haible <bruno@clisp.org>
1898 * lock.h: Update from GNU gettext.
1899 * lock.c: Update from GNU gettext.
1901 2005-07-18 Bruno Haible <bruno@clisp.org>
1903 * lock.h (gl_once_t): New type.
1904 (gl_once_define, gl_once): New macros.
1905 * lock.c (fresh_once): New variable.
1906 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
1909 2005-07-18 Simon Josefsson <jas@extundo.com>
1911 * check-version.c (check_version): Accept identical versions too.
1913 2005-07-18 Bruno Haible <bruno@clisp.org>
1915 * lock.h: New file, from GNU gettext.
1916 * lock.c: New file, from GNU gettext.
1918 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
1920 * quotearg.c: Add translator comment suggested by Bruno Haible,
1921 with a minor change.
1923 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1925 * version-etc-fsf.c (version_etc_copyright): Parameterize the
1926 copyright symbol and the year.
1927 * version-etc.c (COPYRIGHT_YEAR): New constant.
1928 (version_etc_va): Use parameterized copyright notice.
1929 Reword to conform to the current GNU coding standards.
1931 2005-07-11 Simon Josefsson <jas@extundo.com>
1933 * size_max.h: New file.
1935 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
1937 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
1940 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
1941 and Paul Eggert <eggert@cs.ucla.edu>
1943 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
1944 in wint_t, not wchar_t. Remove now-unnecessary cast.
1946 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1948 * regex.c, regex.h: Sync from libc.
1949 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
1950 New files, synced from libc, except that regex_internal.h
1951 currently has a small porting fix.
1953 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
1955 Remove the dependency of the strftime module on the tzset module.
1956 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
1957 Copy the input structure, to work around some of the bug with
1958 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
1959 Solaris releases, you should also use the tzset module, but we won't
1960 require it as a dependency any more since we don't want LGPLed code
1961 to depend on GPLed code.
1963 2005-07-02 Jim Meyering <jim@meyering.net>
1965 * backupfile.c (backup_args): Change a `0' to NULL.
1967 2005-07-01 Jim Meyering <jim@meyering.net>
1969 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1970 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
1971 * save-cwd.c, tempname.c:
1972 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1973 and don't include <sys/file.h>).
1975 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
1977 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
1978 declares only 'struct timespec;' (!).
1980 2005-06-29 Jim Meyering <jim@meyering.net>
1982 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
1983 type name. Use the variable name instead.
1984 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
1986 2005-06-28 Simon Josefsson <jas@extundo.com>
1988 * check-version.h, check-version.c: New files.
1990 2005-06-28 Simon Josefsson <jas@extundo.com>
1992 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
1993 collision with global variable. Better indentation. Don't
1994 increment buffer pointer beyond buffer end. Based on comments
1995 from Paul Eggert <eggert@cs.ucla.edu>.
1999 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
2001 * canon-host.c (canon-host): Append trailing "," to 0 in
2002 initializer of struct addrinfo, as an indication that we don't
2003 care how many members the structure has.
2005 2005-06-24 Derek Price <derek@ximbiot.com>
2006 and Bruno Haible <bruno@clisp.org>
2008 Remove stat module & update lstat.
2009 * stat.c: Remove this file...
2010 (slash_aware_lstat): ...moving this content and its support...
2011 * lstat.c (rpl_lstat): ...into here.
2012 * lstat.h: New file.
2014 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
2016 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
2017 (ranged_convert): Don't save conversion in a temporary struct.
2018 This causes a warning with GCC 4.0.0, and anyway in the typical
2019 case it's not worth the extra 100 bytes or so of code.
2020 (ranged_convert, __mktime_internal): When calling a function via a
2021 pointer P, use P () rather than (*P) (), as we now assume C89 or
2024 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
2026 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
2027 "who -r" failed to give output. Problem reported by Tim Waugh.
2029 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
2030 (xcalloc): Use it to avoid needless tests.
2031 Problem reported by Jim Meyering.
2033 2005-06-16 Jim Meyering <jim@meyering.net>
2035 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
2036 when either N or S is zero.
2038 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2040 * argp.h (__option_is_short): Check upper limit of
2041 __key. Isprint() requires its argument to have the value
2042 of an unsigned char or EOF.
2044 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
2046 * fnmatch.c (fnmatch): If there is an encoding error in a
2047 multibyte string or pattern, fall back on unibyte matching.
2048 Problem reported by James Youngman.
2050 2005-06-08 Bruno Haible <bruno@clisp.org>
2052 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
2055 2005-06-08 Bruno Haible <bruno@clisp.org>
2057 * csharpcomp.h: New file, from GNU gettext.
2058 * csharpcomp.c: New file, from GNU gettext.
2059 * csharpcomp.sh.in: New file, from GNU gettext.
2061 2005-06-07 Derek Price <derek@ximbiot.com>
2064 * glob_.h: Indent nested #ifdef.
2066 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
2068 Sync from coreutils.
2069 Use "file name" when talking about file names, instead of "filename"
2070 or "path", as per the GNU coding standards.
2071 * mkdir-p.c: Renamed from makepath.c.
2072 (make_dir_parents): Renamed from make_path. All callers changed.
2073 * mkdir-p.h: Likewise. All includers changed.
2074 * filenamecat.c: Renamed from path-concat.c.
2075 (file_name_concat): Renamed from path_concat. All callers changed.
2076 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
2077 * filenamecat.h: Likewise. All includers changed.
2078 * acl.c: Don't use "path" or "filename" to mean "file name"
2079 in comments or local variable names.
2080 * basename.c: Likewise.
2081 * canonicalize.c, canonicalize.h: Likewise.
2082 * dirname.c, dirname.h: Likewise.
2083 * euidaccess.c: Likewise.
2084 * exclude.c: Likewise
2085 * fnmatch_.h, fnmatch_loop.c: Likewise.
2086 * fsusage.c, fsuage.h: Likewise.
2087 * fts.c, fts_.h: Likewise.
2088 * getcwd.c: Likewise.
2089 * getloadavg.c: Likewise.
2090 * mkstemp.c: Likewise.
2091 * mountlist.c, mountlist.h: Likewise.
2092 * openat.c, openat.h: Likewise.
2093 * readlink-stub.c: Likewise.
2094 * readutmp.c, readutmp.h: Likewise.
2095 * rename.c: Likewise.
2096 * rmdir.c: Likewise.
2098 * savedir.c: Likewise.
2099 * stripslash.c: Likewise.
2100 * tempname.c: Likewise.
2101 * xreadlink.c: Likewise.
2102 * exclude.c (excluded_file_name): Renamed from excluded_filename.
2104 * exclude.h: Likewise.
2106 * euidaccess.c (getuid, getgid, getuid, getegid)
2107 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2108 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
2109 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2110 * pathmax.h: Include <limits.h> unconditionally, since other
2111 files have been getting away with it for years (MORE/BSD 4.3
2113 * userspec.c (getpwnam, getgrnam, getgrgid)
2114 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2116 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
2117 Define to 256, not 255, as per modern POSIX.
2119 2005-06-01 Bruno Haible <bruno@clisp.org>
2121 * csharpexec.h: New file, from GNU gettext.
2122 * csharpexec.c: New file, from GNU gettext.
2123 * csharpexec.sh.in: New file, from GNU gettext.
2125 2005-05-31 Derek Price <derek@ximbiot.com>
2126 Paul Eggert <eggert@cs.ucla.edu>
2129 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
2131 2005-05-29 Derek Price <derek@ximbiot.com>
2132 Paul Eggert <eggert@cs.ucla.edu>
2134 * glob_.h, glob.c: New files.
2136 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
2138 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
2140 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
2141 the configuration hassle isn't worth it.
2142 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
2143 (LONGEST_MODIFIER, PRIuMAX): Remove.
2145 2005-05-27 Bruno Haible <bruno@clisp.org>
2147 * getlogin_r.h: Remove second include of <stddef.h>.
2149 2005-05-25 Bruno Haible <bruno@clisp.org>
2150 Derek Price <derek@ximbiot.com>
2152 * getlogin_r.h: Simplify API documentation.
2154 2005-05-25 Derek Price <derek@ximbiot.com>
2155 Paul Eggert <eggert@cs.ucla.edu>
2157 * getlogin_r.c, getlogin_r.h: New files.
2159 2005-05-22 Bruno Haible <bruno@clisp.org>
2161 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
2162 Also include <sys/param.h> if it defines MIN, MAX.
2163 Based on a patch by Derek Price <derek@ximbiot.com>.
2165 2005-05-22 Bruno Haible <bruno@clisp.org>
2167 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
2168 (INT64_MIN): Fix definition.
2169 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2171 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
2172 NEED_SIGNED_INT_TYPES.
2174 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
2175 HAVE_SYSTEM_INTTYPES.
2177 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
2179 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
2180 so that unistd-safer.h (GPL'ed code) need not be included.
2182 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
2185 * fts.c: Don't include "cycle-check.h" or "hash.h".
2186 (setup_dir, free_dir): New functions.
2187 (enter_dir, leave_dir): Define trivial
2188 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
2189 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
2190 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
2191 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
2192 Move to fts-cycle.c.
2193 (fts_open): Use setup_dir.
2194 (fts_close): Use free_dir.
2195 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
2196 This adds a label and some gotos, but the alternatives were messier.
2197 Check for memory allocation failure when entering a dir.
2198 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
2199 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
2200 (FTS): New member fts_cycle, that is a union that contains the
2201 old active_dir_ht and cycle_state. All uses changed to mention
2202 fts_cycle.ht and fts_cycle.state.
2203 * fts-cycle.c: New file, containing GPL'ed code migrated out of
2204 fts.c, with the following changes:
2205 (setup_dir, free_dir): New functions.
2206 (enter_dir): Now returns bool. Return true if successful, false
2207 if memory exhausted. All callers changed.
2208 Do not bother partly cleaning up on
2209 memory allocation failure; that is free_dir's job.
2210 However, free ad if hash_insert fails, to avoid memory leak.
2211 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
2212 fts->fts_options to see which union member to use.
2214 2005-05-20 Jim Meyering <jim@meyering.net>
2216 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
2217 Now a macro, to pacify GCC.
2219 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
2221 * chown.c (rpl_chown): Return -1 on failure.
2223 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
2225 * canonicalize.c: Include canonicalize.h first, to test interface.
2226 Include <stddef.h> unconditionally, since we assume C89 now.
2227 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
2228 * fts.c: Include fts_.h first, to check interface.
2229 Do not include intprops.h; no longer needed.
2230 Include cycle-check.h and hash.h, since fts_.h no longer does.
2231 Remove unnecessary casts of closedir to void.
2232 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
2233 decide whether to decrement nlinks.
2234 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
2235 (FTS): Use struct hash_table * instead of Hash_table, so that
2236 we no longer need to include hash.h here.
2238 2005-05-17 Jim Meyering <jim@meyering.net>
2240 * fts.c, fts_.h: New files, from coreutils.
2242 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
2244 Sync from coreutils.
2245 * unlinkdir.c, unlinkdir.h: New files.
2246 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
2247 regex.h, unlocked-io.h, xtime.h:
2248 White space changes only.
2249 * makepath.c (make_path): Port to hosts where leading "//" is special.
2250 * yesno.c: Include getline.h, not ctype.h.
2251 (yesno): Don't remove leading white space; POSIX doesn't allow it.
2252 Use getline to remove arbitrary restriction on response length.
2254 2005-05-13 Bruno Haible <bruno@clisp.org>
2256 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
2257 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
2258 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
2259 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
2260 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
2261 Add support for 64-bit integers in the MSVC compiler.
2263 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
2265 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
2266 Change the initial comment to refer to GPL, not LGPL.
2267 gnulib-tool will change it to LGPL as needed.
2269 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
2270 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
2271 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
2272 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
2273 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
2274 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
2275 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
2276 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
2277 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
2278 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
2279 concatpath.c, config.charset, copy-file.c, copy-file.h,
2280 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
2281 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
2282 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
2283 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
2284 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
2285 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
2286 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
2287 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
2288 full-read.c, full-read.h, full-write.c, full-write.h,
2289 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
2290 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
2291 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
2292 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
2293 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
2294 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
2295 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
2296 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
2297 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
2298 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
2299 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
2300 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
2301 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
2302 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
2303 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
2304 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
2305 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
2306 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
2307 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
2308 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
2309 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
2310 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
2311 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
2312 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
2313 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
2314 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
2315 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
2316 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
2317 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
2318 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
2319 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
2320 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
2321 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
2322 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
2323 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
2324 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
2325 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
2326 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
2327 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
2328 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
2329 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
2330 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
2331 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
2332 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
2333 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
2334 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
2335 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
2336 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
2337 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
2338 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
2339 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
2340 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
2341 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
2342 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
2343 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
2344 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
2345 Update FSF postal mail address.
2347 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2349 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
2350 specified in ai_socktype. Fix invalid ai_protocol
2351 check. ai_protocol is usually set to 0 or depending on
2352 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
2353 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
2354 ai_socktype / ai_protocol in the returned addrinfo structure.
2356 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2357 Bruno Haible <bruno@clisp.org>
2359 * inet_ntop.h: New file.
2360 * inet_ntop.c: New file, from glibc with modifications.
2362 2005-05-08 Jim Meyering <jim@meyering.net>
2364 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
2366 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2368 Merge from coreutils. Among other things,
2369 add bulletproofing for cases where stdin, stdout, or stderr are closed.
2370 * fd-safer.c: New file.
2371 * fcntl-safer.h, open-safer.c: Remove.
2372 * chdir-long.c: Fix comment "fetish" -> "coreutils".
2373 * dup-safer.c: Include unistd-safer.h first.
2374 Don't include errno.h.
2375 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
2376 * file-type.h: Don't assume invoker included sys/stat.h first.
2377 * file-type.c: Rely on file-type.h change.
2378 * getloadavg.c: Include unistd-safer.h.
2379 (getloadavg): Use safer open.
2380 * getusershell.c: Include "stdio-safer.h".
2381 (getusershell): Use safer fopen.
2382 * long-options.c (long_options): Use NULL rather than 0.
2383 * modechange.h (mode_free): Remove; all callers changed to invoke
2385 * modechange.c: Likewise.
2386 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2387 (MODE_DONE): New constant.
2388 (struct mode_change): Remove 'next' member.
2389 (make_node_op_equals): New function; like the old one of the
2390 same name, except it allocates an array.
2391 (mode_compile, mode_create_from_ref): Use it.
2392 (mode_compile): Allocate result as an array, not a linked list.
2393 Parse octal string ourself, so that we catch mistakes like "+0".
2394 (mode_adjust): Arg is an array, not a linked list.
2395 * modechange.c: Include stat-macros.h, xalloc.h.
2396 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2397 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2398 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2399 Remove. This is now stat-macros.h's job.
2400 (talloc): Remove. All callers replaced by xalloc, so that
2401 our invokers don't have to worry about reporting memory failures.
2402 (make_node_op_equals): Remove.
2403 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2405 (struct mode_change): Moved here from modechange.h.
2406 (mode_append_entry): Remove.
2407 (mode_compile): Remove MASKED_OPS arg, since it encouraged
2408 apps to have incorrect behavior. Use simpler algorithm for head
2409 and tail. Don't futz with umask; that's now the job of mode_adjust.
2410 Detect more invalid usages rather than having somewhat-random behavior.
2411 Don't insert an "a=" action, as that leads to incorrect behavior.
2412 (mode_compile, mode_create_from_ref): Return NULL on error instead
2413 of an enum, since now there's only one way to have an error. All
2415 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2416 at the correct time. Simplify calculation of "+u" and its ilk.
2417 Don't mishandle "+X".
2418 (mode_free): Remove "register" and localize decls.
2419 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2420 (struct mode_change): Move to modechange.c; callers don't
2421 need to see this stuff.
2422 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2423 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2424 (mode_change, mode_adjust): Reflect the new signatures noted above.
2425 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2426 that might redefine system include files.
2427 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2428 (my_usleep): Use NULL rather than (void *) 0.
2429 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2430 Use siginterrupt to specify that system calls should be interrupted.
2431 (rpl_nanosleep): Move initialization of suspended closer to call of
2433 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
2434 * readutmp.c: Likewise. Include signal.h, stdbool.h.
2435 (desirable_utmp_entry): New function.
2436 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2437 using x2nrealloc, to simplify logic.
2438 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2439 size calculation. Do not assume utmp file is a regular file.
2440 * readutmp.h (UT_PID): Moved here from ../src/who.c.
2441 (READ_UTMP_CHECK_PIDS): New constant.
2442 * save-cwd.c: Include unistd-safer.h.
2443 (save_cwd): Use fd_safer.
2444 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2445 [!_LIBC] Include "stat-macros.h" instead.
2446 * unistd-safer.h (fd_safer): New decl.
2448 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
2450 * byteswap_.h: New file.
2452 2005-04-25 Albert Chin <china@thewrittenword.com>
2454 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
2457 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2459 * getdate.y (zone): Allow relunit_snumber after tZONE, so
2460 that "UTC +1 second" continues to work. Problem reported
2462 (relunit_snumber): New rule.
2465 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2467 * getdate.y (universal_time_zone_table): New constant.
2468 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2469 universal_time_zone_table.
2470 (lookup_zone): Prefer universal_time_zone_table to
2471 local_time_zone_table, so that "GMT" time stamps are allowed in
2472 London during the summer. Problem reported by Ian Abbott.
2474 2005-04-12 Jim Meyering <jim@meyering.net>
2476 * human.c (humblock): Set *options even when returning due to
2477 xstrtoumax conversion failure. Thanks to a used-uninitialized
2480 2005-04-09 Jim Meyering <jim@meyering.net>
2482 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2483 -Wuninitialized: initialize tm0.tm_year.
2485 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
2487 * getdate.y (parser_control): rels_seen is now a boolean, not a
2488 count, since there's no maximum. All uses changed.
2489 Add member dsts_seen.
2490 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2492 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2493 Use pc_rels_seen to decide whther a date is absolute.
2495 * getdate.y (number): Don't overwrite year.
2496 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2499 2005-04-02 Simon Josefsson <jas@extundo.com>
2501 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
2502 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
2504 2005-03-27 Jim Meyering <jim@meyering.net>
2506 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2508 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
2510 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2511 "one's complement" -> "ones' complement" in comment, as per Knuth.
2512 "value of type" -> "type or expression" in comment.
2513 * mktime.c, strftime.c: Propagate intprops.h comment nits.
2515 2005-03-26 Jim Meyering <jim@meyering.net>
2518 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2519 Correct typos: s/or/of/.
2521 2005-03-23 Jim Meyering <jim@meyering.net>
2523 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2525 2005-03-21 Jim Meyering <jim@meyering.net>
2527 Changes imported from coreutils.
2529 * cycle-check.c: Don't include xalloc.h.
2531 * path-concat.c: Don't include assert.h.
2532 (path_concat): Remove assertion that would have triggered
2533 for ABASE starting with more than one slash.
2534 Reported by Andreas Schwab.
2536 * path-concat.c (path_concat): Set *BASE_IN_RESULT
2537 properly when ABASE is an absolute file name.
2538 Correct the description of this function.
2540 Add an assertion and a test driver.
2541 This fixes a bug introduced on 2004-07-02.
2542 Andreas Schwab reported the resulting failure of cp --parents:
2543 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2545 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2547 * strftime.c (my_strftime): If the underlying strftime returns 0
2548 (which shouldn't happen), generate nothing instead of returning 0
2549 immediately, so that nstrftime (NULL, ...) doesn't return 0.
2551 2005-03-16 Bruno Haible <bruno@clisp.org>
2553 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
2555 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2557 * strftime.c (my_strftime): Prepend space to format so that we can
2558 reliably distinguish strftime failure from empty output on POSIX
2561 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
2563 * iconvme.c (SIZE_MAX): New macro, if not already defined.
2564 (iconv_string): Don't guess a size-zero buffer, as that might cause
2565 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
2566 result would be 'too large', where 'too large' is (heuristically)
2567 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
2568 overflow concerns. This will prevent some unwanted malloc failures
2569 when the inputs are very large.
2571 2005-03-15 Bruno Haible <bruno@clisp.org>
2573 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
2576 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
2579 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
2581 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
2583 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2584 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2586 * strtol.c: Likewise.
2588 2005-03-14 Simon Josefsson <jas@extundo.com>
2590 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2593 2005-03-14 Jim Meyering <jim@meyering.net>
2595 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2596 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2597 to be nonzero so that we (and caller) can detect the difference
2598 between a valid zero-length expansion and an error return, even
2599 when the underlying strftime fails before writing anything into
2602 2005-03-10 Jim Meyering <jim@meyering.net>
2604 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2605 so that this module works on systems without fchdir.
2607 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2609 Factor int-properties macros into a single file, except for
2610 glibc-related files.
2611 * intprops.h: New file.
2612 * getloadavg.c: Include it instead of limits.h.
2613 (INT_STRLEN_BOUND): Remove.
2614 * human.c: Include intprops.h.
2615 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2616 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2617 * inttostr.h: Include intprops.h instead of limits.h.
2618 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2619 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2620 for consistency with intprops.h.
2621 (time_t_is_integer, twos_complement_arithmetic): Use them.
2622 * sig2str.h: Include <signal.h>, intprops.h.
2623 (INT_STRLEN_BOUND): Remove.
2624 * strftime.c (TYPE_SIGNED): Remove.
2625 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2626 * strtol.c: Adjust comments to match intprops.h.
2627 * userspec.c: Include intprops.h.
2628 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2629 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2630 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2631 instead of rolling our own expressions.
2632 * xstrtol.c: Include xstrtol.h first, to test interface.
2634 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2636 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2637 the right thing even if adding 1900 would overflow. Similarly
2638 for tm_mon + 1 and tm_yday + 1.
2639 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2640 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2641 (DO_SIGNED_NUMBER): New macro.
2642 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2644 2005-03-07 Bruno Haible <bruno@clisp.org>
2646 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2648 2005-03-03 Derek R. Price <derek@ximbiot.com>
2649 Bruno Haible <bruno@clisp.org>
2651 * pagealign_alloc.h: New file.
2652 * pagealign_alloc.c: New file.
2654 2005-01-28 Bruno Haible <bruno@clisp.org>
2656 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2659 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2661 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2662 The workaround isn't strictly needed for POSIX conformance, and
2663 it's too much of a pain to configure and maintain. We'll ask
2664 people to fix their kernels instead.
2665 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2666 (NANOSLEEP_BUG_WORKAROUND): Remove.
2667 (xnanosleep): Remove the workaround.
2669 2005-02-12 Bruno Haible <bruno@clisp.org>
2671 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2673 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2675 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2676 * timespec.h (gettime): Return void, since it always
2677 succeeds now. All uses changed.
2678 * gettime.c (gettime) Likewise.
2679 [HAVE_NANOTIME]: Prefer nanotime.
2680 Assume gettimeofday succeeds, as POSIX requires.
2681 Assime time () succeeds, since other code already does.
2682 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2683 (timespec_subtract): Remove.
2684 (NANOSLEEP_BUG_WORKAROUND): New constant.
2685 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2686 things considerably. Use it only on GNU/Linux hosts, since the
2687 workaround shouldn't be needed elsewhere.
2689 2005-02-24 Bruno Haible <bruno@clisp.org>
2691 * gettext.h: Update from GNU gettext 0.14.2.
2693 2005-02-24 Bruno Haible <bruno@clisp.org>
2695 * localcharset.c: Update from GNU gettext 0.14.2.
2696 * config.charset: Update from GNU gettext 0.14.2.
2698 2005-02-22 Simon Josefsson <jas@extundo.com>
2700 * iconvme.h, iconvme.c: New files, from libc.
2702 2005-02-20 Neil Conway <neilc@samurai.com>
2704 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2705 returned by OSX/Darwin if the specified buffer is not large
2706 enough for the hostname.
2708 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2710 * memrchr.h: New file.
2711 * chdir-long.c: Include it.
2712 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2713 Don't bother including stddef.h.
2715 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2717 * argp-help.c (__argp_help): Create a fake struct argp_state and
2718 pass it to _help, otherwise the latter coredumps trying to
2719 dereference state.root_argp.
2721 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2723 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2725 Include <sys/types.h>, for dev_t.
2726 (ME_DUMMY, ME_REMOTE): Move from here....
2727 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2728 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2730 Include mountlist.h first, to test the interface.
2732 2005-01-29 Bruno Haible <bruno@clisp.org>
2734 * progname.c (program_name): Initialize.
2735 Needed when linking statically on MacOS X.
2737 2005-01-28 Bruno Haible <bruno@clisp.org>
2739 * javacomp.sh.in: New file, from GNU gettext.
2740 * javacomp.h: New file, from GNU gettext.
2741 * javacomp.c: New file, from GNU gettext.
2743 2005-01-26 Bruno Haible <bruno@clisp.org>
2745 * javaexec.sh.in: New file, from GNU gettext.
2746 * javaexec.h: New file, from GNU gettext.
2747 * javaexec.c: New file, from GNU gettext.
2749 2005-01-26 Simon Josefsson <jas@extundo.com>
2751 * gai_strerror.c: Use GPL in header.
2753 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2755 * argp-help.c (hol_entry_help): Avoid using non-constant
2756 initializers for struct pentry_state.
2757 (__argp_error): Check return value of __asprintf
2758 (__argp_failure): Translate error message
2760 * argp-parse.c: Removed braces around the expansion of N_()
2762 2005-01-21 Jim Meyering <jim@meyering.net>
2764 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2765 same value as for Solaris 9.
2767 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2768 component length. This included changing the parameter to be
2769 of type `char *' rather than `char const *'.
2770 * chdir-long.h (chdir_long): Update prototype.
2772 * openat.c (fdopendir, fstatat): New functions.
2773 * openat.h: Include headers required for use of DIR and struct stat.
2774 [AT_SYMLINK_NOFOLLOW]: Define.
2775 (fdopendir, fstatat): Add prototypes.
2777 2005-01-21 Bruno Haible <bruno@clisp.org>
2779 * classpath.h: New file, from GNU gettext.
2780 * classpath.c: New file, from GNU gettext.
2782 2005-01-20 Simon Josefsson <jas@extundo.com>
2784 * version-etc-fsf.c: New file, with version_etc_copyright.
2785 * version-etc.c: Remove version_etc_copyright.
2786 * version-etc.h (version_etc_copyright): Use [] instead of * in
2787 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2789 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2791 * save-cwd.c (save_cwd): Remove code to support the case
2792 where fchdir is missing or flaky.
2794 2005-01-20 Simon Josefsson <jas@extundo.com>
2796 * base64.h (isbase64): Add.
2798 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2799 using a unsigned prototype, don't inline.
2800 (base64_decode): Use it.
2802 2005-01-19 Bruno Haible <bruno@clisp.org>
2804 * sh-quote.h: New file, from GNU gettext.
2805 * sh-quote.c: New file, from GNU gettext.
2807 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2809 Merge changes from coreutils, as described below in several
2810 changelogs dated today.
2812 * save-cwd.c: Include "save-cwd.h" before other include files.
2813 (O_DIRECTORY): Remove; not needed here, since "." must be
2814 a directory. All uses removed.
2815 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
2816 universal on Suns, and we also need to test for IRIX.
2817 Revamp code to use 'if' rather than '#if'.
2818 Avoid unnecessary comparison of cwd->desc to 0.
2820 * utimens.c (futimens): Robustify the previous patch, by checking
2821 for known valid error numbers rather than observed invalid ones.
2823 2005-01-18 Jim Meyering <jim@meyering.net>
2825 * version-etc.c (version_etc_copyright): Update copyright date.
2827 * utimens.c (futimens): Account for the fact that futimes
2828 can also fail with errno == ENOSYS or errno == ENOENT.
2829 Patch from Dmitry V. Levin.
2831 Change the name of the robust chdir function from chdir to chdir_long.
2832 * save-cwd.c: Include chdir-long.h rather than chdir.h.
2833 (restore_cwd): Use chdir_long, not chdir.
2834 * chdir-long.c: Renamed from chdir.c.
2835 * chdir-long.h: Renamed from chdir.h.
2836 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2839 2005-01-18 Bob Proulx <bob@proulx.com>
2841 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2842 offsetof() macro construct to avoid compile failure with native HP-UX
2843 11.0 ANSI C compiler.
2845 2005-01-06 Bruno Haible <bruno@clisp.org>
2847 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2848 because stpncpy.m4 takes care of it.
2850 2004-01-24 Bruno Haible <bruno@clisp.org>
2852 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2854 2003-10-09 Bruno Haible <bruno@clisp.org>
2856 * progreloc.c: Include xalloc.h instead of xmalloc.h.
2858 2005-01-06 Bruno Haible <bruno@clisp.org>
2860 * fwriteerror.h (fwriteerror): Change specification to include fclose.
2861 * fwriteerror.c: Include <stdbool.h>.
2862 (fwriteerror): At the end, close the file stream. Record whether
2863 stdout was already closed.
2865 2004-05-27 Bruno Haible <bruno@clisp.org>
2867 * execute.c (environ): Declare if needed.
2868 * pipe.c (environ): Likewise.
2869 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2871 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
2873 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2874 definitions to be after all include files, to avoid collisions.
2875 Problem reported by Bob Proulx.
2877 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
2879 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2880 not needed. This removes a dependency on the gettext module.
2881 [defined _LIBC]: Do not include <libintl.h>; not needed.
2883 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
2885 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2888 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
2890 * argp-parse.c: Include <stddef.h>.
2891 (alignof, alignto): New macros.
2892 (parser_init): Don't assume that void * is aligned sufficiently
2895 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2896 need to extend the stack.
2897 (YYINITDEPTH): New macro, so that the initial stack isn't overly
2900 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2902 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
2904 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2906 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
2907 Remove now-obsolete comment about AIX.
2908 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
2909 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
2910 (YYMAXDEPTH): New macro.
2912 2004-12-18 Bruno Haible <bruno@clisp.org>
2914 * fatal-signal.c (fatal_signals): Make non-const.
2915 (init_fatal_signals): New function.
2916 (uninstall_handlers, install_handlers): Ignore signals that were set to
2918 (at_fatal_signal): Call init_fatal_signals.
2919 (init_fatal_signal_set): Likewise. Ignore signals that were set to
2921 Reported by Paul Eggert.
2923 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2925 * getdate.y (textint): New member "negative".
2926 (time_zone_hhmm): New function.
2927 Expect 14 shift-reduce conflicts, not 13.
2928 (o_colon_minutes): New rule.
2929 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
2930 (yylex): Set the "negative" member of signed numbers.
2932 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
2934 Changes imported from coreutils.
2935 * hard-locale.c: Assume <locale.h> exists.
2937 (GLIBC_VERSION): New macro.
2938 (hard_locale): Assume setlocale exists.
2939 Rewrite to avoid #ifdef.
2940 Use strdup rather than malloc + strcpy.
2941 * human.c: Assume <locale.h> exists.
2942 (human_readable): Assume localeconv exists.
2944 2004-12-01 Jakub Jelinek <jakub@redhat.com>
2946 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
2947 convert T2, not T. (Imported from libc.)
2949 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
2951 * getcwd.c (is_ENAMETOOLONG): New macro.
2952 (__getcwd.c): Don't restore errno; glibc doesn't.
2953 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
2954 first, falling back to our code only if its results look suspicious.
2955 Ensure that the resulting buffer is only as large as necessary.
2957 * readutmp.c: Include readutmp.h first.
2958 Include <errno.h>, since readutmp.h no longer does that.
2959 * readutmp.h: Don't include <errno.h>,
2960 <sys/param.h>, <time.h>; not needed to establish interface.
2961 (errno): Remove decl.
2962 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
2963 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
2964 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
2966 2004-11-28 Simon Josefsson <jas@extundo.com>
2968 * base64.h, base64.c: New file.
2970 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
2972 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
2974 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
2976 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
2977 HP's ANSI C compiler.
2978 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
2979 Declaring int functions causes warnings on some modern systems and
2980 shouldn't be needed to compile on ancient ones.
2981 * same.c (MIN) [defined MIN]: Don't define, since it's already
2984 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
2985 with the following changes.
2986 (__set_errno): Parenthesize properly.
2987 Include <stdbool.h>.
2988 (MIN, MAX, MATCHING_INO): New macros.
2989 (__getcwd): Define with prototype, not K&R form.
2990 Use heuristics to allocate default buffer on stack if possible.
2991 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
2992 behavior, and to avoid the PATH_MAX limit when computing
2994 Use MATCHING_INO to compare inode number to file.
2995 Check for arithmetic overflow in size calculations.
2996 Fix bug in reallocation of dot array that caused getcwd to fail
2997 on directories nested deeper than 75.
2998 Be more careful about saving errno on error.
2999 Do not use realloc; use only free+malloc, as this is a bit
3000 more flexible and avoids a needless copy operation.
3001 Do not inspect st_dev and st_ino for symbolic links; POSIX
3002 doesn't specify the latter.
3003 Check for closedir errors.
3004 Avoid needless casts.
3005 Use "#ifdef weak_alias" around weak_alias, to be like other
3007 The following changes to getcwd.c have effect only when used in
3008 gnulib; they have no effect inside glibc proper.
3009 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
3010 as alloca isn't used.
3011 (alloca, __alloca): Likewise.
3012 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
3013 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3014 unconditionally, as gnulib assumes C89 or better.
3015 Do not include <sys/param.h>.
3016 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
3017 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
3019 (NULL) [!defined NULL]: Remove; we assume C89 or better.
3020 Include <dirent.h> in a way that is compatible with modern Autoconf.
3021 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
3022 New macros, if not already defined.
3023 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
3024 Use "_LIBC", not "defined _LIBC", for consistency.
3025 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
3027 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
3028 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
3029 * xgetcwd.c: David MacKenzie's old code was removed, so give
3030 credit only to Jim Meyering and adjust the copyright dates.
3031 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
3032 <stdlib.h>, <unistd.h>, "pathmax.h".
3033 Instead, include "xgetcwd.h" (first) and "getcwd.h".
3034 (INITIAL_BUFFER_SIZE): Remove.
3035 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
3037 2004-11-23 Jim Meyering <jim@meyering.net>
3039 * getopt_.h: Remove trailing blanks.
3041 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
3043 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
3044 (futimens): New function, which uses futimes if available.
3045 (futimens, utimens): Support timespec==NULL, with same semantics
3046 as utime and utimens.
3047 * utimens.h (futimens): New decl.
3049 2004-11-23 Jim Meyering <jim@meyering.net>
3051 * __fpending.c: Add comment.
3053 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3055 * getopt_.h: Re-addition of __getopt_argv_const caused
3056 redefinition warnings. To avoid them, include the defines
3057 in `#if !defined __need_getopt ... #endif'. The only place
3058 where __getopt_argv_const is used is in definitions
3059 of getopt_long and getopt_long_only below, which are as well
3060 protected by `#ifndef __need_getopt'.
3061 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
3062 __need_getopt after including <stdio.h> and <unistd.h> These
3063 headers might have defined it.
3065 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
3067 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
3069 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
3070 optopt): Use them instead of invoking ## directly; otherwise, the
3071 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
3073 2004-11-19 Bruno Haible <bruno@clisp.org>
3075 * strtok_r.c: Move comments from here...
3076 * strtok_r.h: ... to here.
3078 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
3080 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
3081 might fail. Problem reported by Yoann Vandoorselaere.
3082 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
3083 that mishandle size_t overflow.
3085 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
3087 * canon-host.c: Include "strdup.h".
3088 (canon_host): Use getaddrinfo if available, so that IPv6 works.
3089 Use strdup instead of malloc/strcpy to duplicate strings.
3091 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
3092 (human_space_before_unit): New constant.
3093 * human.c (human_readable): Support it.
3095 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
3096 (xgetcwd): Set errno correctly when failing.
3097 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
3098 the failure is actually due to a PATH_MAX problem.
3100 Further getopt changes to make it more likely that glibc will
3101 buy the changes back.
3102 * getopt.c (POSIXLY_CORRECT): New constant.
3103 (getopt): Use it, so to preserve glibc semantic
3104 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
3105 when compiling for libc.
3106 * getopt_.h (__getopt_argv_const): Bring it back.
3107 (getopt_long, getopt_long_only): Use it.
3109 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
3110 New arg POSIXLY_CORRECT. All callers changed.
3111 (getopt): Argv is now char * const *, as per standard.
3112 (_getopt_internal_r, _getopt_internal): Argv is now char **,
3113 not char *__getopt_argv_const *.
3114 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3115 _getopt_long_only_r): Likewise.
3116 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
3117 * getopt_int.h (_getopt_internal, _getopt_internal_r,
3118 _getopt_long_r, _getopt_long_only_r): Likewise.
3119 * getopt_.h (__getopt_argv_const): Remove.
3120 (getopt): Argv is now char * const *, as per standard.
3122 * getdate.y (tORDINAL): New token.
3123 (day, relunit): Allow it for relative times.
3124 (relative_time_table): Use tORDINAL for ordinals.
3126 2004-11-15 Jim Meyering <jim@meyering.net>
3128 * closeout.c: Include "__fpending.h" once again.
3129 Include <stdbool.h>.
3130 (close_stdout): Don't fail just because stdout was closed initially,
3131 since some programs don't write to stdout in the normal course of
3132 operation (other than --version and --help), and we don't want this
3133 function to make e.g. `touch file >&-' fail.
3134 But do fail if it was closed and someone has tried to write to it.
3135 E.g., `printf foo >&-' must fail.
3137 2004-11-11 Simon Josefsson <jas@extundo.com>
3139 * strtok_r.h, strtok_r.c: New file.
3141 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
3143 * getopt_.h (__getopt_argv_const): New macro, to be used so that
3144 we can stop lying to compilers about the constness of argv when we
3145 are compiled outside glibc.
3146 (getopt, getopt_long, getopt_long_only): Use it.
3147 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
3149 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3150 _getopt_long_only_r): Likewise.
3151 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
3152 _getopt_long_only_r): Likewise.
3154 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
3155 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
3156 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
3157 the other external symbols.
3158 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
3159 declaration, since the above renaming now works around collisions.
3161 2004-11-11 Jim Meyering <jim@meyering.net>
3163 * linebreak.c: Remove trailing blanks.
3164 * alloca_.h: Likewise.
3165 * acosl.c: Likewise.
3166 * euidaccess.c: Likewise.
3167 * allocsa.h: Likewise.
3169 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
3171 * mktime.c (SHR): New macro, which is a portable
3172 substitute for >> that should work even on Crays.
3173 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
3174 Problem reported by Mark D. Baushke in
3175 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
3176 * getdate.y (SHR): Likewise.
3178 * strftime.c (SHR): Likewise.
3180 * quotearg.c (struct quoting_options): Use unsigned int for
3181 quote_these_too, so that right shifts are well defined. All uses
3184 2004-11-10 Simon Josefsson <jas@extundo.com>
3186 * getaddrinfo.h, getaddrinfo.c: New files.
3188 2004-11-10 Jim Meyering <jim@meyering.net>
3190 Ensure that no close failure goes unreported.
3191 * closeout.c (close_stdout): Always close stdout. I.e., don't
3192 return early when it seems there's nothing to flush.
3193 Don't include __fpending.h.
3195 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
3197 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
3199 2004-11-05 Bruno Haible <bruno@clisp.org>
3201 * readlink.c: Include stddef.h, needed for size_t on Woe32.
3202 Reported by Mark D. Baushke <mdb@cvshome.org>.
3204 2004-11-04 Bruno Haible <bruno@clisp.org>
3206 2004-09-11 Bruno Haible <bruno@clisp.org>
3207 * allocsa.valgrind: New file.
3208 2004-02-06 Bruno Haible <bruno@clisp.org>
3209 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
3210 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
3211 Reported by Christopher Seip <chris.seip@hp.com>.
3213 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
3215 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
3216 with errno == ERANGE if the buffer is too small.
3217 Problem reported by Mark D. Baushke.
3219 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
3221 * xreadlink.c (MAXSIZE): New macro.
3222 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
3223 size does not exceed MAXSIZE. Avoid cast.
3224 As suggested by Mark D. Baushke in
3225 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
3226 if readlink fails with buffer size just under MAXSIZE, try again
3229 2004-11-02 Derek R. Price <derek@ximbiot.com>
3230 and Paul Eggert <eggert@cs.ucla.edu>
3232 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
3233 (get_date): Overparenthesize to avoid GCC warning.
3235 2004-11-02 Bruno Haible <bruno@clisp.org>
3237 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
3238 function returns void.
3240 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
3242 * getpass.c (fflush_unlocked, flockfile, funlockfile)
3243 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
3246 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
3248 * getdate.y: Add support for TZ="foo" within a date string.
3249 Fix some bugs near time_t boundaries. Reject dates with
3250 out-of-range components, e.g., "Sept 31".
3251 Include <stdlib.h>, "setenv.h", "xalloc.h".
3252 (ISDIGIT_LOCALE): Remove; unused.
3253 Note that the TZ and time functions used here are not reentrant.
3254 (mktime_ok, get_tz): New functions.
3255 (TZBUFSIZE): New constant.
3256 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
3257 This requires that we sometimes generate our own TZ="XXX..." setting.
3259 2004-10-27 Derek R. Price <derek@ximbiot.com>
3261 * mktime.c (not_equal_tm): Remove redundant check.
3263 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
3265 * getdate.y: Use Bison 1.875 features, and some minor
3266 code cleanups. This change does not affect semantics.
3267 Don't include <stdlib.h>; no longer needed.
3268 Don't include unlocked-io.h; only the "#if TEST" code uses
3269 stdio, and performance isn't crucial there.
3270 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
3271 Bison 1.875 features as described below.
3272 All uses of "PC." replaced by "pc->".
3273 (YYSTYPE): Add a forward declaration.
3274 (yylex, yyerror): Use full prototypes in forward decls.
3275 Use "%pure-parser" rather than obsolescent "%pure_parser".
3276 Use %parse-param and %lex-param instead of obsolescent
3277 YYPARSE_PARAM and YYLEX_PARAM.
3278 (meridian_table, month_and_day_table, time_units_table,
3279 relative_time_table, time_zone_table, military_table,
3280 lookup_zone, lookup_word, get_date):
3281 Use NULL instead of 0 where appropriate.
3282 (to_hour): Avoid abort (), to avoid a dependency on
3284 (yyerror, yylex): Now accepts parser_control * arg.
3285 (main) [TEST]: Use '\0' rather than 0 for char.
3287 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
3289 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
3290 It's now the caller's responsibility to handle the case where
3291 !HAVE_GETPAGESIZE && !defined getpagesize.
3293 * mktime.c (leapyear): Arg is long int, not int.
3295 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
3297 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
3299 2004-10-12 Simon Josefsson <jas@extundo.com>
3301 * getpass.c (fflush_unlocked, flockfile, funlockfile)
3302 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
3305 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
3307 * vsnprintf.h: New file.
3308 * vsnprintf.c: New file.
3310 2004-10-07 Bruno Haible <bruno@clisp.org>
3312 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
3313 into the provided buffer.
3315 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
3317 * diacrit.c, diacrit.h: Add GPL notice.
3319 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
3320 * atanl.c (atanl): Keep the code as similar to glibc as possible.
3321 * logl.c (logl): Keep the code as similar to glibc as possible.
3322 This avoids a potential constant-folding bug.
3324 2004-10-05 Bruno Haible <bruno@clisp.org>
3326 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
3328 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3330 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
3331 * xmalloc.c (xmemdup): Likewise.
3332 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
3333 XFREE): Remove these long-obsolescent macros.
3334 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
3335 * xstrdup.c: Remove.
3337 * regex.c (re_comp): Cast gettext return value to char *,
3338 Problem reported by Martin Neitzel via Mark D. Baushke.
3340 2004-10-04 Simon Josefsson <jas@extundo.com>
3342 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
3343 '#ifdef USE_UNLOCKED_IO'.
3345 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3347 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
3348 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
3349 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
3350 regex.c, sha1.c, version-etc.c, yesno.c:
3351 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
3352 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
3353 the includer's responsibility.
3355 Sync from coreutils.
3357 * modechange.c (mode_compile): Don't decrement a pointer that
3358 points to the start of a string, as the C Standard says the
3359 resulting behavior is undefined.
3361 * backupfile.h (enum backuptype): Rename none -> no_backups,
3362 simple -> simple_backups, numbered_existing ->
3363 numbered_existing_backups, numbered -> numbered_backups
3364 to avoid shadowing problems. All uses changed.
3365 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
3366 * backupfile.c (check_extension, numbered_backup):
3367 Rename locals to avoid shadowing 'basename'.
3368 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3371 * .cppi-disable: Add getopt_.h, getopt_int.h.
3372 * .cvsignore: Add getopt.h.
3374 2004-10-04 Simon Josefsson <jas@extundo.com>
3376 * memmem.h: New file.
3377 * memmem.c: New file, taken from glibc.
3379 2004-10-02 Jim Meyering <jim@meyering.net>
3381 * dirfd.h, getpagesize.h: Add copyright notice.
3383 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
3385 * snprintf.c: Remove comments as to why each header is needed.
3387 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
3389 * strsep.h: New file.
3390 * strsep.c: New file.
3392 2004-10-01 Simon Josefsson <jas@extundo.com>
3394 * snprintf.c (snprintf): Handle size==0.
3396 2004-10-01 Simon Josefsson <jas@extundo.com>
3397 Bruno Haible <bruno@clisp.org>
3399 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
3400 (snprintf): Declare 'args'.
3402 2004-09-30 Simon Josefsson <jas@extundo.com>
3404 * snprintf.h, snprintf.c: New files.
3406 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3408 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
3409 (hol_entry_help): Never translate an empty string.
3410 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
3411 * argp.h (OPTION_NO_TRANS): New option.
3413 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
3415 * xvasprintf.c: Include xalloc.h.
3416 (xvasprintf): Use xalloc_die, not xmalloc_die.
3418 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
3420 * dummy.c: Change copyright notice to FSF, and license to GPL.
3422 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
3424 * argp-pvh.c (argp_program_version_hook): Provide initial value.
3425 Problem reported by Bruno Haible in:
3426 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
3428 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
3430 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
3431 in case some system header has #define'd it. Problem reported by
3432 Soeren D. Schulze in
3433 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
3435 2004-09-08 Bruno Haible <bruno@clisp.org>
3437 * stdint_.h: New file, taken from GNU clisp.
3439 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
3441 * xvasprintf.h: New file.
3442 * xvasprintf.c: New file.
3443 * xasprintf.c: New file.
3445 2004-09-08 Bruno Haible <bruno@clisp.org>
3447 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
3449 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
3451 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
3453 Import from coreutils.
3454 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3455 strings on unbounded length. alloca's performance benefits aren't
3456 that important here.
3458 (parse_with_separator): New function, with most of the internals
3459 of the old parse_user_spec. Allow user to omit both user and group,
3460 for compatibility with FreeBSD.
3461 Clone only the user name, not the entire spec.
3462 Do not set *uid, *gid unless entirely successful.
3463 Avoid memory leak in some failing cases.
3464 Fix regression for USER.GROUP reported by Dmitry V. Levin in
3465 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3466 (parse_user_spec): Rewrite to use parse_with_separator.
3468 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
3470 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
3471 its complicated substitute.
3472 * argp-help.c: Include <errno.h>, for program_invocation_short_name
3473 and program_invocation_name.
3474 (__argp_basename) [!_LIBC]: Remove; the only use was
3475 replaced by its body.
3476 (__argp_short_program_name): Change condition from
3477 !defined __argp_short_program_name to
3478 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
3479 to match argp-namefrob.h.
3480 (__argp_failure): Don't assume strerror_r returns char *.
3481 * argp-parse.c (N_): Define unconditionally.
3482 (argp_default_options): Fill out initializers with 0 to avoid
3485 2004-08-12 Simon Josefsson <jas@extundo.com>
3487 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
3488 * getopt_.h: Renamed from getopt.h.
3490 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3492 Merge from coreutils.
3494 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3495 wmemchr or wmemcpy. Problem reported by Robert Dahlem
3496 for Reliant Unix 5.43.
3498 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3499 (union fooround): Use uintmax_t, not long int.
3500 The rest is a merge from libc:
3501 [defined _LIBC]: Include <shlib-compat.h>.
3502 (_obstack) [defined _LIBC]: Remove after 2.3.4.
3504 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3506 * strverscmp.c: Convert to UTF-8.
3508 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3510 * obstack.h (obstack_empty_p):
3511 Don't assume that chunk->contents is suitably aligned.
3512 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3513 Likewise. Problem reported by Benno in
3514 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3516 * chown.c (rpl_chown): Work even if the file is writeable but not
3517 readable. This could be improved further but it'd take some work.
3519 2004-08-08 Simon Josefsson <jas@extundo.com>
3521 * xgethostname.c: Don't include error.h (not used).
3524 * getpass.c: Include getpass.h first.
3526 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
3528 * xalloc-die.c: New files.
3529 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3531 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3532 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3533 (_, N_, xalloc_die): Move to xalloc-die.c.
3534 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3535 so that we needn't mess with xalloc_msg_memory_exhausted.
3537 * sha1.h: Renamed from sha.h.
3538 (SHA1_H): Renamed from _SHA_H.
3539 (sha1_ctx): Renamed from sha_ctx.
3540 (sha1_init_ctx): Renamed from sha_init_ctx.
3541 (sha1_process_block): Renamed from sha_process_block.
3542 (sha1_process_bytes): Renamed from sha_process_bytes.
3543 (sha1_finish_ctx): Renamed from sha_finish_ctx.
3544 (sha1_read_ctx): Renamed from sha_read_ctx.
3545 (sha1_stream): Renamed from sha_stream.
3546 (sha1_buffer): Renamed from sha_buffer.
3547 * sha1.c: Likewise; renamed from sha.c.
3548 Do not include <sys/types.h>.
3549 Include <stddef.h> rather than <stdlib.h>.
3551 2004-08-08 Bruno Haible <bruno@clisp.org>
3553 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3554 FILESYSTEM_PREFIX_LEN.
3555 * progreloc.c: Likewise.
3556 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
3558 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
3561 * argp-help.c (make_hol, hol_append): Don't assume that
3562 SIZE_MAX is a valid preprocessor constant.
3563 (__argp_basename): Change from "#ifndef _LIBC"
3564 to "#ifndef __argp_short_program_name", so that
3565 we don't compile these functions for tar.
3567 More merges from coreutils.
3568 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
3569 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
3571 * addext.c: Remove; no longer needed.
3572 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
3573 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
3574 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
3575 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
3576 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
3577 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
3578 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
3579 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
3580 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
3581 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
3582 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
3583 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
3584 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
3585 Import changes from coreutils.
3587 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3589 Merge from coreutils.
3591 * .gdb-history: Remove; this doesn't belong here.
3593 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3594 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3595 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3597 * dirname.h: Include <stdbool.h>.
3598 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3599 for consistency with POSIX terminology. All uses changed.
3600 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3601 (strip_trailing_slashes): Use bool for booleans.
3602 * stripslash.c (strip_trailing_slashes): Likewise.
3604 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3605 sometimes returns a positive errno value even when it succeeds.
3606 (print_errno_message) [!LIBC]: Fall back on strerror if
3609 * path-concat.c (mempcpy): Don't define if a system header defines it.
3610 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3611 (longest_relative_suffix): New function.
3612 (path_concat): Use it. Assume first argument is not NULL.
3613 Port to DOS. Omit redundant separators.
3614 Report an error instead of returning NULL.
3615 Use mempcpy instead of memcpy.
3616 (xpath_concat): Remove: not declared or used.
3618 * same.h: Include <stdbool.h>
3619 (same_name): Return bool, not int.
3620 * same.c (same_name): Likewise.
3621 (errno): Don't declare; we assume C89 or better now.
3623 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3624 if not already defined.
3626 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3627 * dup-safer.c (errno): Likewise.
3629 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3631 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3634 2004-08-03 Simon Josefsson <jas@extundo.com>
3636 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3637 * progname.h: Don't include stdbool.h.
3639 2004-08-02 Simon Josefsson <jas@extundo.com>
3641 * getsubopt.h: New file, with comments from Bruno Haible.
3642 * getsubopt.c: New file, from glibc, but slightly modified based on
3643 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3645 2004-08-01 Simon Josefsson <jas@extundo.com>
3647 * xgetdomainname.c: Include stdlib.h, for free().
3649 2004-07-16 Simon Josefsson <jas@extundo.com>
3651 * dummy.c: New file.
3653 2004-07-16 Bruno Haible <bruno@clisp.org>
3655 * backupfile.h: Add extern "C" for C++.
3656 * closeout.h: Likewise.
3657 * copy-file.h: Likewise.
3658 * findprog.h: Likewise.
3659 * full-write.h: Likewise.
3660 * pathname.h: Likewise.
3661 * progname.h: Likewise.
3662 * stpcpy.h: Likewise.
3663 * stpncpy.h: Likewise.
3664 * strcase.h: Likewise.
3665 * strstr.h: Likewise.
3666 * xalloc.h: Likewise.
3668 * mbswidth.h: Add extern "C" for C++.
3669 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3671 2004-07-09 Simon Josefsson <jas@extundo.com>
3673 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
3674 failed without this.)
3676 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3678 * fchown-stub.c: New file.
3680 2004-06-24 Jim Meyering <jim@meyering.net>
3682 * obstack.h (obstack_base): Cast to (void *), per documentation.
3684 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3686 * argz.c, argz_.h: New files, which are autoupdated from libtool.
3688 2004-06-01 Jim Meyering <jim@meyering.net>
3690 * calloc.c: New file.
3692 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
3694 * getdate.y (yylex): Allow space between sign and number.
3695 Problem reported by Dan Jacobson.
3697 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3698 and Jim Meyering <jim@meyering.net>
3700 Merge from coreutils CVS.
3702 * stat-macros.h: New file, with contents from file-type.h
3703 and coreutils' system.h.
3704 * file-type.c: Include "stat-macros.h".
3705 * file-type.h (file_type): Move all macro definitions to new file,
3708 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3709 Wrap old code with this conditional.
3710 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3711 function that does not dereference symlinks.
3712 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3714 * xreadlink.c: Include xreadlink.h first, to catch .h file
3715 dependency problems.
3716 (xreadlink): Accept new arg SIZE, for efficiency.
3717 All decls and uses changed.
3718 * xreadlink.h: Include <stddef.h>, for size_t.
3720 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3721 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3723 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3725 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3727 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3728 macros to be defined.
3729 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3730 the allocator returns NULL because the requested size is zero.
3732 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3734 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3735 var. Add comment explaining why libc still defines it. This
3736 merges the following patch from glibc:
3737 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3739 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3741 * obstack.c (_obstack): Remove unused variable. It hasn't been
3742 present in glibc since revision 1.1 of this file.
3743 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3744 obstack_alignment_mask, obstack_alloc, obstack_base,
3745 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3746 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3747 obstack_grow0, obstack_init, obstack_int_grow,
3748 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3749 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3750 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3751 nonexistent functions.
3753 2004-05-17 Derek R. Price <derek@ximbiot.com>
3754 Paul Eggert <eggert@cs.ucla.edu>
3756 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3758 2004-05-14 Bruno Haible <bruno@clisp.org>
3760 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3761 that consists of a '.' followed by an empty digit string.
3762 Patch by Tor Lillqvist <tml@iki.fi>.
3764 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3766 Port obstack to the AS/400, where pointers are 16 bytes wide and
3767 you cannot cast an integer to a valid pointer. This patch is
3768 currently waiting to be integrated into glibc; see
3769 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3771 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3772 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3773 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3774 (struct obstack): temp member is now a union of a pointer and
3775 an integer, instead of an integer. All integer uses changed.
3776 This does not affect the physical layout of struct obstack,
3777 except on hosts (like the AS/400) where the size or alignment of
3778 void * is greater than that of ptrdiff_t.
3779 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3780 __STDC__)]: Store temporary in pointer member of union, not
3782 * obstack.c: Include <stddef.h>, for offsetof.
3783 (struct fooalign): Remove; it doesn't need a name.
3784 (union fooround): Change double to long double, and add void *.
3785 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3786 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3787 not a macro. Hence the values are always int; so remove all
3788 casts-to-int in uses.
3790 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3791 Derek Price <derek@ximbiot.com>
3793 * alloca.c: Include <alloca.h>, to get our interface.
3794 * alloca_.h: Use __alloca on AIX, so that we don't have to
3795 include <alloca.h> first. Use C89 prototype for alloca; this
3796 requires including <stddef.h> for size_t. Use extern "C" if C++.
3797 Use #elif for simplicity, since we can assume C89 now.
3798 Don't try to source the system alloca.h since it will not be found
3799 and to prevent recursively including its replacement.
3800 * fnmatch.c: Include <alloca.h> instead of opencoding.
3801 * regex.c: Likewise.
3803 2004-05-16 Derek Price <derek@ximbiot.com>
3804 Paul Eggert <eggert@cs.ucla.edu>
3806 getline cleanup. This changes the getndelim2 API: both order of
3807 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3810 * getline.c: Don't include stddef.h or stdio.h, since our
3811 interface does that.
3812 (getline): Always use getdelim, so that we don't have two
3813 copies of this code.
3814 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3816 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3817 (GETNDELIM2_MAXIMUM): New macro.
3818 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
3819 instead of the old practice of delim2==0. All callers changed.
3820 Return -1 on overflow, instead of returning junk.
3821 Do not set *linesize unless allocation succeeds.
3822 * getndelim2.h: Do not include stddef.h; no longer needed, now
3823 that we include sys/types.h.
3824 * getnline.h: Likewise.
3825 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3826 (getndelim2): Reorder arguments.
3827 * getnline.c (getnline, getndelim):
3828 Don't discard the NMAX argument.
3829 (getnline): Invoke getndelim, to avoid code duplication.
3830 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3831 of (size_t) -1 by callers of the getnline family.
3833 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3835 * nanosleep.c (suspended): Change its type from int to
3836 sig_atomic_t volatile.
3837 (first_call): Make it private to rpl_nanosleep, and have it
3838 be zero initially as that's a bit faster.
3839 (my_usleep): Round up fractional times instead of truncating them,
3840 as this is the usual meaning for 'sleep'.
3842 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3844 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3845 (ENOSYS): Define if not defined.
3846 (settime): Fall back on stime if it exists and settimeofday fails.
3847 But don't bother with fallbacks if a method fails with errno == EPERM.
3849 2004-05-11 Jim Meyering <jim@meyering.net>
3851 Prior to this change, the save_cwd caller required read access to the
3852 current directory on most systems (ones with the fchdir function).
3854 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3855 fails, try write-only, and finally, resort to using xgetcwd.
3857 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3859 * obstack.c, obstack.h: Import changes from libc.
3861 2004-04-28 Bruno Haible <bruno@clisp.org>
3863 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3864 implicitly appends .exe to executables.
3865 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3866 accepts Windows pathnames.
3867 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3868 Cygwin like Windows, since it now accepts Windows pathnames.
3869 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3870 Cygwin like Windows, since it now accepts Windows pathnames.
3871 Reported by Derek Robert Price <derek@ximbiot.com>.
3873 2004-04-20 Jim Meyering <jim@meyering.net>
3875 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
3877 2004-04-20 Jim Meyering <jim@meyering.net>
3878 Bruno Haible <bruno@clisp.org>
3880 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
3881 memory when realloc fails.
3883 2004-04-18 Jim Meyering <jim@meyering.net>
3885 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
3886 don't leak memory and do call END_UTMP_ENT.
3888 2004-04-11 Paul Eggert <eggert@twinsun.com>
3890 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
3891 (CHAR_BIT): Remove, since we assume C89.
3892 Include <stdint.h> if available, as per current Autoconf CVS advice.
3894 2004-03-30 Paul Eggert <eggert@twinsun.com>
3896 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
3897 not bool, to be more consistent with Unix conventions.
3898 Suggested by Bruno Haible.
3900 Merge from coreutils.
3902 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
3905 * getdate.h: Include stdbool.h, and timespec.h instead of
3906 the usual <time.h> dance.
3907 (get_date): Change signature to support fractional time stamps.
3908 All callers changed.
3909 * getdate.y: Include "getdate.h" first, as we can now
3910 assume C89 and don't need to worry about 'const'.
3911 Similarly, include "unlocked-io.h" near start, not in middle.
3913 (textint.value): Use long int rather than int.
3914 (textint.digits): Use size_t rather than int.
3915 (BILLION, LOG10_BILLION): New constants.
3916 (parser_control): New member rel_ns. Members day_ordinal,
3917 time_zone, month, day, hour, minutes, rel_year, rel_month,
3918 rel_day, rel_hour, rel_minutes, rel_seconds
3919 are now long int, not int. Member seconds is now struct timespec,
3920 not int. New member timespec_seen. Members dates_seen, days_seen,
3921 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
3923 (%union.intval): Now long int, not int.
3924 New member timespec.
3925 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
3926 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
3927 (spec): Now is a timespec or an item list.
3928 (timespec, items): New nonterminals.
3929 (time, rel, relunit, number, get_date):
3930 Add support for fractional seconds.
3931 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
3932 (gmtime, localtime, mktime): Remove decls; not needed with C89.
3933 (to_hour): First arg is now long int, not int.
3934 (to_year): Returns long int, not int.
3935 Don't treat year -70 like 70.
3936 (tm_diff): Returns long int, not int.
3937 (lookup_word): Use bool instead of int when appropriate.
3938 (yylex): Use size_t for count, not int.
3939 Detect overflow when parsing large integer constants.
3940 Add support for fractions.
3941 (get_date): Make pointers 'const' if possible.
3942 Use more-portable code to detect integer overflow.
3943 (main) [TEST]: Adjust to above changes. Test for localtime failure.
3944 Don't use ctime; it's not reliable if the year has >4 digits.
3946 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
3947 This is for compatibility with BSD.
3949 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
3950 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3951 From coreutils' system.h.
3953 * userspec.c: Don't include "posixver.h".
3954 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
3955 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
3956 compatible extension. Simplify code by removing a boolean int
3957 that was always nonzero if a string was nonnull.
3959 2004-03-30 Jim Meyering <jim@meyering.net>
3961 Merge from coreutils.
3963 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
3965 * readtokens.c (readtoken): Don't leak 64 bytes when reading
3966 an empty input stream.
3968 * readtokens.c: Include <stdbool.h>.
3969 (readtoken): Use `size_t' rather than int/long.
3970 All callers adjusted.
3971 Use `bool' rather than `int' where appropriate.
3972 Use memset rather than an explicit loop.
3973 Use x2nrealloc rather than xrealloc.
3974 Allow the use of `\0' as a delimiter.
3975 (readtokens): Likewise.
3976 * readtokens.h (readtoken, readtokens): Update prototypes.
3978 2004-03-30 Bruno Haible <bruno@clisp.org>
3980 * getloadavg.c (getloadavg): Don't assume setlocale returns
3983 2004-03-29 Paul Eggert <eggert@twinsun.com>
3985 Merge changes to getloadavg.c from coreutils and Emacs.
3987 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
3988 Define to an expression, not to the empty string.
3989 Include cloexec.h and xalloc.h.
3990 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
3991 Use set_cloexec_flag rather than rolling our own.
3992 * cloexec.c, cloexec.h: New files.
3994 2004-03-18 Paul Eggert <eggert@twinsun.com>
3996 * getopt.h: Sync with libc CVS.
3998 2004-03-18 Paul Eggert <eggert@twinsun.com>
3999 Bruno Haible <bruno@clisp.org>
4001 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
4002 not on all platforms that have <wchar.h>.
4003 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
4005 2004-03-09 Paul Eggert <eggert@twinsun.com>
4007 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
4009 * getopt_int.h: New file, also synced from libc.
4011 2004-03-07 Paul Eggert <eggert@twinsun.com>
4013 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
4014 '#if' expressions. Unlike the code it replaces, it does not
4015 depend on (defined _SC_PAGESIZE). However, it does depend on
4016 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
4017 first reported by Jason Andrade in
4018 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
4020 2004-01-18 Simon Josefsson <jas@extundo.com>
4022 * strdup.h: New file.
4023 * strdup.c: Include it.
4024 * path-concat.c: Include strdup.h. Drop strdup declaration.
4025 * userspec.c: Include strdup.h. Drop strdup declaration.
4027 2004-02-06 Karl Berry <karl@gnu.org>
4029 * config.charset: update from gettext 0.14.1.
4031 2004-02-05 Paul Eggert <eggert@twinsun.com>
4033 Add comments and code, prompted by suggestions from Bruno Haible
4035 * quotearg.h (quotearg_alloc): New decl. Improve the comments
4036 describing the enum quoting_style values.
4037 * quotearg.c (quotearg_alloc): New function.
4038 (quotearg_buffer_restyled): Treat lone { and } as special.
4039 Treat = as special. Work around bug with older shells
4040 that "see" a '\' that is really the 2nd byte of a multibyte char.
4041 Quote empty string with shell_quoting_style.
4043 2004-02-03 Bruno Haible <bruno@clisp.org>
4045 * pipe.h: New file, from GNU gettext.
4046 * pipe.c: New file, from GNU gettext.
4048 2004-01-27 Bruno Haible <bruno@clisp.org>
4050 * execute.h: New file, from GNU gettext.
4051 * execute.c: New file, from GNU gettext.
4052 * w32spawn.h: New file, from GNU gettext.
4054 2004-01-23 Paul Eggert <eggert@twinsun.com>
4056 Exit-status fix from coreutils.
4058 Use exit_failure consistently in place of EXIT_FAILURE,
4059 so that program exit statuses are consistent on failure.
4061 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
4062 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
4063 * argmatch.h: Comment fix to match the above.
4064 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
4065 Now a macro referring to exit_failure, instead of a separate
4066 variable. Include "exitfail.h" to get it.
4067 * xstrtol.h: Include "exitfail.h".
4068 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
4070 * long-options.c (parse_long_options): Use prototype
4071 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
4074 2004-01-21 Jim Meyering <jim@meyering.net>
4076 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
4077 so as not to conflict with a different-sized __mktime_internal
4078 function in GNU libc.
4079 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
4080 Problem building statically-linked `ls' reported by Michael Brunnbauer.
4082 2004-01-18 Paul Eggert <eggert@twinsun.com>
4084 Merge from diffutils.
4086 * file-type.c (file_type): Add typed memory objects.
4087 * file-type.h (S_TYPEISTMO): New macro.
4089 * c-stack.h (c_stack_action): Remove argv argument.
4090 * c-stack.c (c_stack_action): Likewise. All uses changed.
4091 (die): Don't calculate message unless segv_action returns.
4092 (get_stack_location, min_address_from_argv, max_address_from_argv,
4093 volatile stack_base, volatile_stack_size): Remove.
4094 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
4095 that every segmentation violation is a stack overflow. (Ouch!)
4096 See Debian bug 136249 (still outstanding) for more info about why
4097 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
4099 2003-11-30 Bruno Haible <bruno@clisp.org>
4101 Safer stack allocation.
4102 * setenv.c: Include allocsa.h.
4103 (alloca): Remove fallback definition.
4104 (freea): Remove macro.
4105 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
4108 2003-10-17 Bruno Haible <bruno@clisp.org>
4110 * binary-io.h: Avoid warnings on Cygwin.
4112 2003-12-28 Bruno Haible <bruno@clisp.org>
4114 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
4115 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
4117 2003-11-28 Bruno Haible <bruno@clisp.org>
4119 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
4121 2003-11-27 Bruno Haible <bruno@clisp.org>
4123 * wait-process.c: On Windows, include windows.h. Needed on mingw.
4125 2003-11-17 Bruno Haible <bruno@clisp.org>
4127 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
4129 2003-11-24 Bruno Haible <bruno@clisp.org>
4131 * xallocsa.h: New file, from GNU gettext.
4132 * xallocsa.c: New file, from GNU gettext.
4134 2003-11-24 Bruno Haible <bruno@clisp.org>
4136 * allocsa.h: New file, from GNU gettext.
4137 * allocsa.c: New file, from GNU gettext.
4139 2003-11-24 Bruno Haible <bruno@clisp.org>
4141 * eealloc.h: New file.
4143 2004-01-15 Jim Meyering <jim@meyering.net>
4145 Merge from coreutils.
4147 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
4148 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
4149 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
4151 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
4152 optional configure-time default.
4154 * version-etc.c (version_etc_copyright): Update copyright date.
4156 * xreadlink.c (xreadlink): Correct outdated comment.
4158 2004-01-15 Paul Eggert <eggert@twinsun.com>
4160 Merge from coreutils.
4162 * posixver.c: Include posixver.h.
4164 * same.c: Include <stdbool.h>, <limits.h>.
4165 (_POSIX_NAME_MAX): Define if not defined.
4167 (same_name): If file names are silently truncated, report
4168 that the file names are the same if they are the same after
4169 the silent truncation.
4171 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
4172 conversion function.
4173 * xstrtod.c (xstrtod): Likewise. All callers changed to
4174 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
4177 2004-01-14 Paul Eggert <eggert@twinsun.com>
4179 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
4180 with like-named macro in fnmatch.c.
4181 (EXT): Use an internal constant instead.
4183 Merge fnmatch patches from glibc.
4184 * fnmatch.c (mbsinit): Remove define.
4185 Add libc_hidden_ver (__fnmatch, fnmatch).
4186 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
4187 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
4189 2003-12-14 Karl Berry <karl@gnu.org>
4191 * config.charset: update from gettext-runtime.
4193 2003-12-03 Paul Eggert <eggert@twinsun.com>
4195 * getgroups.c (getgroups): xmalloc takes one argument, not two.
4196 Bug reported by Alfred M. Szmidt.
4198 2003-11-29 Karl Berry <karl@gnu.org>
4200 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
4202 2003-11-23 Paul Eggert <eggert@twinsun.com>
4203 Bruno Haible <bruno@clisp.org>
4205 * printf-parse.h: Don't include sys/types.h.
4206 (ARG_NONE): New macro.
4207 (char_directive): Change type of *arg_index fields to size_t.
4208 * printf-parse.c: Don't include sys/types.h.
4209 (SSIZE_MAX): Remove macro.
4210 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
4211 Remove unnecessary overflow check.
4212 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
4215 2003-11-24 Paul Eggert <eggert@twinsun.com>
4217 * alloca.c: Remove dependency on xalloc module.
4218 (xalloc_die): Remove.
4219 (memory_full) [!defined emacs]: New macro.
4220 [!defined emacs]: Don't include xalloc.h.
4221 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
4222 address arithmetic overflows. Change datatypes a bit to avoid
4225 2003-11-22 Jim Meyering <jim@meyering.net>
4227 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
4229 2003-11-17 Bruno Haible <bruno@clisp.org>
4231 * vasnprintf.c (alloca): Remove fallback definition.
4232 (freea): Remove definition.
4233 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
4234 Reported by Paul Eggert.
4236 2003-11-17 Jim Meyering <jim@meyering.net>
4238 On systems without utime and without a utimes function capable of
4239 dealing with a NULL struct utimbuf* argument, this utime replacement
4240 could -- in unusual circumstances -- leak a file descriptor.
4241 * utime.c: Include <unistd.h> and <errno.h>.
4242 (utime_null): Be sure to close `fd' and to preserve errno.
4243 Reported by Geoff Collyer via Arnold Robbins.
4245 2003-11-16 Paul Eggert <eggert@twinsun.com>
4246 Bruno Haible <bruno@clisp.org>
4248 Protect against address arithmetic overflow.
4249 * printf-args.h: Include stddef.h.
4250 (arguments): Change type of field 'count' to size_t.
4251 * printf-args.c (printf_fetchargs): Use size_t instead of
4252 'unsigned int' where appropriate.
4253 * printf-parse.h: Include sys/types.h.
4254 (char_directive): Change type of *arg_index fields to ssize_t.
4255 (char_directives): Change type of fields 'count', max_*_length to
4257 * printf-parse.c: Include sys/types.h and xsize.h.
4258 (SSIZE_MAX): Define fallback value.
4259 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
4260 instead of 'int' where appropriate. Check a_allocated, d_allocated
4261 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
4262 * vasnprintf.c: Include xsize.h.
4263 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
4264 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
4265 overflow. Avoid wraparound when converting a width or precision from
4268 2003-11-16 Bruno Haible <bruno@clisp.org>
4270 Update from GNU gettext.
4271 * printf-parse.c: Generalize to it can be compiled for wide strings.
4272 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
4273 * vasnprintf.c: Generalize to it can be compiled for wide strings.
4274 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
4275 SNPRINTF): New macros.
4276 Don't include <alloca.h> if the file is used inside libintl.
4277 (local_wcslen): New function, for Solaris 2.5.1.
4278 (VASNPRINTF): Use it instead of wcslen.
4280 2003-11-16 Bruno Haible <bruno@clisp.org>
4282 * xsize.h (xmax): New function.
4283 (xsum, xsum3, xsum4): Declare as "pure" functions.
4285 2003-11-12 Paul Eggert <eggert@twinsun.com>
4287 * xalloc.h: Do not include <limits.h> or <stdint.h>.
4288 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
4289 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
4290 heuristic is just as accurate as far as we know, and it removes a
4291 dependency on size_max.m4 and ptrdiff_max.m4.
4293 2003-11-12 Paul Eggert <eggert@twinsun.com>
4295 * xstrtol.c (__xstrtol): Remove "break" immediately after
4296 "return", to pacify some unknown compiler. Problem reported
4299 2003-11-11 Bruno Haible <bruno@clisp.org>
4301 * xsize.h (SIZE_MAX): Remove fallback definition.
4302 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
4305 2003-11-10 Paul Eggert <eggert@twinsun.com>
4307 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
4308 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
4309 rejected some allocations of exactly SIZE_MAX - 2 bytes.
4311 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
4312 not (size_t) -1, since it's defined here.
4314 2003-11-06 Paul Eggert <eggert@twinsun.com>
4316 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
4317 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
4318 Reject sizes of exactly SIZE_MAX bytes.
4319 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
4320 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
4322 2003-11-05 Bruno Haible <bruno@clisp.org>
4324 * xsize.h: Include limits.h, to avoid a possible collision with
4325 SIZE_MAX defined in <limits.h> on Solaris.
4327 2003-11-04 Bruno Haible <bruno@clisp.org>
4329 * xsize.h: New file.
4330 * linebreak.c: Include xsize.h.
4331 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
4332 argument for overflow.
4333 Suggested by Paul Eggert.
4335 2003-10-31 Bruno Haible <bruno@clisp.org>
4337 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
4338 to avoid (extremely rare) race condition.
4339 Suggested by Paul Eggert.
4341 2003-11-03 Jim Meyering <jim@meyering.net>
4343 * userspec.c: Include "userspec.h".
4344 * userspec.h: New file.
4346 2003-10-31 Paul Eggert <eggert@twinsun.com>
4348 * mountlist.h (struct mount_entry.me_type_malloced): New member.
4349 * mountlist.c (SIZE_MAX): Define if not defined already.
4350 (read_filesystem_list): Set and use me_type_malloced.
4351 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
4352 whatever the type happens to be), for brevity and consistency.
4353 Check for size calculation overflow on Alphas running OSF/1.
4355 2003-10-31 Jim Meyering <jim@meyering.net>
4357 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4359 * linebuffer.c: Include <string.h> for declaration of memset.
4361 2003-10-30 Paul Eggert <eggert@twinsun.com>
4362 Bruno Haible <bruno@clisp.org>
4364 * vasprintf.c: Include <limits.h>, <stdlib.h>.
4365 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
4367 2003-10-29 Paul Eggert <eggert@twinsun.com>
4369 * xalloc.h (xalloc_oversized): Now a macro, not a function,
4370 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
4372 * quotearg.c (quotearg_n_options): Use it.
4373 * group-member.c: Include <stdbool.h>.
4374 (free_group_info): Arg is now const *; don't free arg.
4375 (get_group_info): Now returns bool and accepts struct group_info *,
4376 rather than returning a malloc'ed struct group_info *.
4377 All uses changed. Check for overflow in internal size calculation.
4379 * getusershell.c (readname): Simplify the code by using x2nrealloc
4380 rather than xmalloc/xrealloc.
4381 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
4382 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
4383 conformance bug: the old code used a pointer after freeing the
4384 storage that it addressed.
4385 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
4386 rather than doing it by hand.
4387 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
4388 the buffer preserved. Use free and xmalloc instead.
4389 * quotearg.c (quotearg_n_options): Likewise.
4390 Use a simpler test for size overflow. Don't use xalloc_oversized
4391 because unsigned int might be wider than size_t (!); this suggests
4392 that we should switch from unsigned int to size_t for slot numbers.
4394 2003-10-27 Bruno Haible <bruno@clisp.org>
4396 * stdbool_.h: Better support for BeOS.
4398 2003-10-27 Paul Eggert <eggert@twinsun.com>
4400 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
4401 to allocate the returned structure. Do not allocate a subarray,
4402 as x2nrealloc will do that.
4403 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
4404 instead of xnrealloc.
4405 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
4407 2003-10-26 Paul Eggert <eggert@twinsun.com>
4409 * xalloc.h (xalloc_oversized): New static inline function, for
4410 callers that want to do their own size-overflow checking. Include
4411 <stdbool.h>, since xalloc_oversized returns bool.
4412 * xalloc.c (array_size_overflow): Remove. All callers changed
4413 to use xalloc_oversized.
4415 Add two functions x2realloc, x2nrealloc, for programs that grow
4416 arrays dynamically by doubling their sizes.
4417 * xalloc.h (x2realloc, x2nrealloc): New decls.
4418 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
4421 Port to C99 semantics for 'inline' of external functions.
4422 Bug reported by Bruno Haible.
4423 * xmalloc.c (xnmalloc_inline): New static inline function,
4424 with the old contents of xnmalloc.
4425 (xnmalloc, xmalloc): Use it.
4426 (xnrealloc_inline): New static inline function,
4427 with the old contents of xnrealloc.
4428 (xnrealloc, xrealloc): Use it.
4430 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
4432 2003-10-25 Paul Eggert <eggert@twinsun.com>
4434 Fix several address-calculation bugs in the hash modules,
4435 plus some minor code cleanup.
4437 * hash.h: Include <stdbool.h>, for bool.
4438 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
4439 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
4440 hash_get_n_entries, hash_get_max_bucket_length,
4441 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
4442 hash_rehash): Use size_t rather than unsigned.
4443 * hash.c (struct hash_table, hash_get_n_buckets,
4444 hash_get_n_buckets_used, hash_get_n_entries,
4445 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
4446 hash_get_entries, hash_do_for_each, hash_string, is_prime,
4447 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
4449 (SIZE_MAX): Define if not defined.
4450 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
4451 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
4453 Use const * when possible.
4454 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
4455 (check_tuning): Fix bug: if tuning parameters were very close to
4456 0 or 1, rounding errors could have caused subscript violations.
4457 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
4458 (hash_initialize): Add 'fail:' label
4459 to free table and return NULL, and use it to simplify code.
4460 Use calloc rather than clearing the storage ourself.
4461 (hash_initialize, hash_rehash): Check for arithmetic overflow in
4462 buffer size calculations.
4463 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
4464 Include <stddef.h>, for size_t.
4465 * hash-pjw.c (hash_pjw): Likewise.
4466 Switch to method described by Bruno Haible.
4467 Include <limits.h>, for CHAR_BIT.
4468 (SIZE_BITS): New macro.
4470 2003-10-21 Paul Eggert <eggert@twinsun.com>
4472 * getndelim2.c (getndelim2): When size calculation overflows,
4473 ceiling the allocation at NMAX bytes rather than silently
4474 discarding input bytes before NMAX is reached. This makes
4475 a difference only if NMAX exceeds SIZE_MAX / 2.
4477 * obstack.c: Merge from glibc.
4478 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
4479 Add libc_hidden_def (_obstack_newchunk).
4480 (_obstack_free) [! defined _LIBC]: Remove.
4481 [defined _LIBC]: Make a strong alias from obstack_free, rather than
4482 a clone of the function body.
4483 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
4484 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
4486 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
4487 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
4490 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
4491 (obstack_ptr_grow_fast, obstack_int_grow_fast):
4492 Don't use lvalue casts, as GCC plans to remove support for them
4493 in GCC 3.5. Reported by Joseph S. Myers. This bug
4494 was also present in the non-GCC version, indicating that this
4495 code had always been buggy and had never been widely used.
4496 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
4497 Use the fast variant of each macro, rather than copying the
4498 definiens of the fast variant; that way, we'll be more likely to
4499 catch future bugs in the fast variants.
4501 2003-10-20 Bruno Haible <bruno@clisp.org>
4503 * wait-process.h: New file, from GNU gettext.
4504 * wait-process.c: New file, from GNU gettext.
4506 2003-10-19 Jim Meyering <jim@meyering.net>
4508 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
4510 2003-10-16 Paul Eggert <eggert@twinsun.com>
4512 * getgroups.c: Include <errno.h>, <stdlib.h>.
4513 (getgroups): First arg is int, not size_t.
4514 Don't let 'free' mangle errno.
4516 2003-10-16 Jim Meyering <jim@meyering.net>
4518 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4520 2003-10-15 Paul Eggert <eggert@twinsun.com>
4522 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
4524 (new_exclude, add_exclude_file): Initial size no longer needs to
4526 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
4527 our own address arithmetic overflow checking.
4529 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
4530 (fnmatch): Do not alloca more than 2000 wide characters;
4531 instead, use malloc for large buffers.
4532 Check for address arithmetic overflow, and return -1
4533 with errno set to ENOMEM in that case.
4534 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
4535 (NEW_PATTERN): Do not alloca more than 8000 bytes;
4536 instead, return -1. Check for address arithmetic overflow.
4538 2003-10-14 Paul Eggert <eggert@twinsun.com>
4540 Handle invalid suffixes and overflow independently, so that
4541 callers can treat them independently as needed. Fix some bugs in
4542 suffix handling, e.g., "100k@" was not diagnosed as an invalid
4543 suffix for a human-readable blocksize. The major caller-visible
4544 change is the addition of a new
4545 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
4546 that both overflow and suffix chars were found.
4548 * human.c (humblock): Don't check separately for invalid suffix
4549 char; that is xstrtoumax's job (now that its bug is fixed).
4550 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
4551 INTMAX_MAX]: New macros.
4552 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
4553 TYPE_MAXIMUM): New macros.
4554 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
4555 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
4556 if overflow occurs, as it's what __strtol does and it's more useful
4558 (__xstrtol): If __strtol reports some error other than ERANGE,
4559 reflect it to the caller as LONGINT_INVALID. If it reports
4560 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
4561 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
4562 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
4564 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
4565 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
4566 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
4567 [defined UINTMAX_MAX]: New macros.
4569 2003-10-14 Bruno Haible <bruno@clisp.org>
4571 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
4572 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
4573 Also use volatile where needed.
4575 2003-10-12 Paul Eggert <eggert@twinsun.com>
4577 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
4578 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
4579 and define in terms of the other primitives.
4580 * xmalloc.c: Include stdbool.h; do not include exit.h.
4581 (SIZE_MAX): Define if not already defined.
4582 (array_size_overflow): New function.
4583 (xalloc_die): Abort instead of exiting if 'error' returns.
4584 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
4585 (xmalloc, xrealloc): Use them.
4586 (xcalloc): Check for address arithmetic overflow.
4587 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4588 a bit faster than strcpy.
4590 2003-10-08 Paul Eggert <eggert@twinsun.com>
4592 Merge getpass from libc, plus a few fixes.
4594 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4595 Include <stdbool.h>.
4596 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4597 __fsetlocking to empty.
4598 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4599 do include <bits/libc-lock.h>.
4600 Do not include <fcntl.h>; not needed.
4601 [_LIBC]: Include <wchar.h>.
4602 (NOTCANCEL_MODE): New macro.
4603 (flockfile, funlockfile) [_LIBC]: New macros.
4604 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4605 [!_LIBC]: New macros.
4606 (call_fclose): New function.
4607 (getpass): Use it. Save tty stream separately; this simplifies the
4608 code and makes it more reliable if stdin happens to equal stdout.
4609 Invoke __fsetlocking on tty.
4610 Handle thread cancellation if needed.
4611 Namespace cleanup (use __tcgetattr, __getline).
4612 Use bool for Booleans.
4613 [USE_IN_LIBIO]: Handle wide streams.
4614 [!_LIBC]: Unconditionally do the fseek, since we don't know what
4615 stream might go where.
4617 * unlocked-io.h: Include <stdio.h>, so that the caller
4618 doesn't have to include <stdio.h> before us.
4619 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4620 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4621 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4622 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4623 if not declared, so that we can use getpass.c code from libc without
4625 (flockfile, ftrylockfile, funlockfile): New macros.
4627 2003-10-06 Bruno Haible <bruno@clisp.org>
4629 * version-etc-2.h: Remove file.
4630 * version-etc-2.c: Remove file.
4632 2003-09-25 Jim Meyering <jim@meyering.net>
4633 Bruno Haible <bruno@clisp.org>
4635 This lets translators provide better translations for the
4636 "Written by ..." part of --version output.
4637 * version-etc.h: Include stdarg.h.
4638 (version_etc_copyright): Declare as readonly.
4639 (version_etc): Make this function variadic with a NULL-terminated list
4640 of author name strings.
4641 (version_etc_va): New declaration.
4642 * version-etc.c: Include stdarg.h, stdlib.h.
4643 (version_etc_copyright): Declare as readonly.
4644 (version_etc_va): New function. Provide a different translatable string
4645 for each possible number of authors < 10. Abbreviate when there are 10
4647 (version_etc): Make this function variadic. Call version_etc_va.
4648 Suggestion from Gary V. Vaughan.
4650 * long-options.h (parse_long_options): Change prototype: the authors
4651 string is moved to the end and becomes variadic.
4652 * long-options.c: Include stdarg.h.
4653 (parse_long_options): Make this function variadic, too.
4654 Call version_etc_va, not version_etc.
4656 2003-10-06 Bruno Haible <bruno@clisp.org>
4658 * fatal-signal.h: New file, from GNU gettext.
4659 * fatal-signal.c: New file, from GNU gettext.
4661 2003-10-04 Karl Berry <karl@gnu.org>
4663 * argp*: update from libc.
4665 2003-10-01 Larry Jones <lawrence.jones@eds.com>
4667 * getpass.c (getpass): Use a no-op fseek when switching from input to
4668 output mode on the same stream.
4670 2003-09-29 Paul Eggert <eggert@twinsun.com>
4672 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4673 Fix arg typo in previous patch.
4675 2003-09-28 Jim Meyering <jim@meyering.net>
4677 * error.c: Correct cpp indentation.
4679 2003-09-27 Paul Eggert <eggert@twinsun.com>
4681 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4682 Omit the special code that used __typeof__, since we worry that
4683 it could be more trouble than it's worth. See:
4684 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4685 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4689 2003-09-26 Jim Meyering <jim@meyering.net>
4691 * error.c (error_tail): Move some declarations
4692 into inner scope where the local variables are used.
4694 2003-09-26 Bruno Haible <bruno@clisp.org>
4696 * stpncpy.h (gnu_stpncpy): New declaration.
4697 (stpncpy): Define as alias for gnu_stpncpy.
4698 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4700 2003-09-26 Paul Eggert <eggert@twinsun.com>
4702 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4703 (error_tail): Do not loop, reallocating temporary buffer, since
4704 the output cannot contain more wide characters than the input
4705 contains bytes, the size must be big enough already. This avoids
4706 one potential size overflow calculation. Check for size overflow
4707 when calculating temporary buffer size. Free temporary buffer
4708 when done, if it was allocated with malloc; this plugs a memory
4709 leak. Remove casts from void * to pointers, that are no longer
4710 needed now that we're assuming C89 or better.
4712 Merge error changes from glibc.
4714 * error.c, error.h: Update copyright notice header to match glibc.
4715 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4716 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4717 Disable cancellation while printing error.
4718 * error.h: Prepend __ to parameter names.
4720 2003-09-25 Karl Berry <karl@gnu.org>
4722 * argp-fmtstream.c, argp-help.c: update from libc.
4724 2003-09-25 Bruno Haible <bruno@clisp.org>
4726 * version-etc-2.h: New file, from version-etc.h with modifications.
4727 * version-etc-2.c: New file, from version-etc.c with modifications.
4729 2003-09-25 Simon Josefsson <jas@extundo.com>
4731 * xgetdomainname.h: New file.
4732 * xgetdomainname.c: New file.
4734 2003-09-25 Simon Josefsson <jas@extundo.com>
4735 Bruno Haible <bruno@clisp.org>
4737 * getdomainname.h: New file.
4738 * getdomainname.c: New file.
4740 2003-09-24 Paul Eggert <eggert@twinsun.com>
4742 * linebuffer.c (freebuffer): Don't free the argument, just
4743 the buffer associated with the argument. Bug reported by
4746 2003-09-19 Karl Berry <karl@gnu.org>
4748 * argp.h: update from libc.
4750 2003-09-16 Paul Eggert <eggert@twinsun.com>
4752 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4753 input error, instead of returning NULL the next time we are called
4754 (and therefore losing track of errno).
4756 2003-09-15 Paul Eggert <eggert@twinsun.com>
4758 * getndelim2.c (getndelim2): Don't trash errno when a read
4759 fails, so that the caller gets the proper errno.
4761 * readutmp.c (read_utmp): Likewise.
4762 Check for fstat error. Close stream and free storage
4765 2003-09-14 Bruno Haible <bruno@clisp.org>
4767 * fwriteerror.h: New file.
4768 * fwriteerror.c: New file.
4770 2003-09-14 Jim Meyering <jim@meyering.net>
4772 * getloadavg.c: Correct cpp indentation.
4773 * strdup.c: Likewise.
4774 * vasnprintf.c: Likewise.
4776 2003-09-12 Paul Eggert <eggert@twinsun.com>
4778 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4779 * obstack.c [!defined _LIBC]: Likewise.
4780 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4781 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4782 * exitfail.c: Don't include stdlib.h; no longer needed.
4784 More changes to assume C89 or better.
4786 * error.c (error_tail): Assume vprintf.
4788 * argmatch.c (getenv): Remove decl.
4789 * progreloc.c (get_full_program_name): Define via prototype.
4790 * setenv.c (clearenv): Likewise.
4791 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4793 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4794 (malloc, memcpy): Remove decls.
4795 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4796 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4797 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4798 (memcpy): Remove macro.
4799 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4800 (__P): Remove. All uses removed.
4801 (PTR): Remove. All uses changed to void *.
4802 (CHAR_BIT, NULL): Remove.
4803 (spaces, zeros, memset_space, memset_zero)
4804 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4806 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4807 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4808 Define with prototype.
4809 Remove now-unnecessary prototype decl.
4810 (extra_args_spec): Assume ANSI C. All uses changed.
4811 (extra_args_spec_iso): Remove.
4812 (my_strftime, emacs_strftimeu): Define via prototype.
4813 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4815 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4816 * strtoimax.c: Include <stdlib.h> unconditionally.
4817 (strtoul, strtol): Remove decls.
4818 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4820 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4821 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
4822 (LOCALE_PARAM_PROTO): New macro.
4823 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4824 (INTERNAL (strtol), strtol): Define with a prototype.
4825 (PARAMS): Remove. All uses removed.
4826 * tempname.c: Include <string.h> unconditionally.
4827 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4828 * xgethostname.c (main): Define with a prototype.
4829 * xmalloc.c: Include "xalloc.h" first, to check interface.
4830 Include <stdlib.h> unconditionally.
4831 (calloc, malloc, realloc, free): Remove decls.
4832 * xstrtod.c: Include "xstrtod.h" first, to check interface.
4833 Include <stdlib.h> unconditionally. Sort include file names.
4835 (xstrtod): Define with a prototype.
4836 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4837 (strtol, strtoul): Remove decls.
4839 2003-09-11 Paul Eggert <eggert@twinsun.com>
4841 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4842 Include <stdlib.h>, <string.h> unconditionally.
4843 Remove now-unnecessary cast to char *.
4844 * strnlen.c: Include <string.h> unconditionally.
4845 * yesno.c (yesno): Define with a prototype.
4847 2003-09-10 Bruno Haible <bruno@clisp.org>
4849 * strcspn.c: Include <string.h> unconditionally.
4850 * strpbrk.c: Include <string.h> unconditionally.
4851 * strstr.c: Include <string.h> unconditionally.
4852 * unicodeio.c: Include <string.h> unconditionally.
4853 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4854 * unsetenv.c: Likewise.
4855 * xreadlink.c: Include <stdlib.h> unconditionally.
4856 * yesno.c: Include <stdlib.h> unconditionally.
4857 (rpmatch): Add prototype.
4859 2003-09-10 Jim Meyering <jim@meyering.net>
4861 * error.c: Correct indentation of cpp directives.
4863 2003-09-09 Paul Eggert <eggert@twinsun.com>
4867 * acosl.c (main): Use a prototype.
4868 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4871 * getloadavg.c (getloadavg, main): Define via prototypes.
4873 * getopt.h (struct option.name): Assume C89, and use 'const'.
4874 (getopt, etopt_long, getopt_long_only, _getopt_internal)
4875 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4877 * getopt.c (const): Remove macro.
4878 Include <string.h> unconditionally.
4879 (my_index): Remove; all uses changed to strchr.
4880 (strlen): Remove decl.
4881 (exchange): Remove forward decl; no longer needed.
4882 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4883 Define with prototype.
4884 * getopt1.c (const): Remove macro.
4885 (getopt_long, getopt_long_only, main): Define with prototype.
4887 * getugroups.c: Include <string.h> unconditionally.
4889 * getusershell.c: Include <stdlib.h> unconditionally.
4890 (getusershell, setusershell, endusershell, readname, main):
4891 Define with prototypes.
4893 * group-member.c: Include group-member.h first.
4894 Include <stdlib.h> unconditionally.
4896 * hard-locale.c: Include hard-locale.h first.
4897 Include <stdlib.h>, <string.h> unconditionally.
4899 * hash.c (free, malloc): Remove decls.
4900 Include <stdlib.h> unconditionally.
4902 * human.c: Include <stdlib.h>, <string.h> unconditionally.
4903 (getenv): Do not declare.
4905 * idcache.c: Include <string.h> unconditionally.
4907 * long-options.c: Include long-options.h first, to test interface.
4908 Include <stdlib.h> unconditionally.
4910 * makepath.c: Include makepath.h first, to test interface.
4911 Include <stdlib.h> and <string.h> unconditionally.
4913 * linebuffer.c: Include <stdlib.h>.
4914 (free): Remove decl.
4916 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4917 rpl_malloc returns void *, not char *.
4918 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
4920 * md5.h: Include <limits.h> unconditionally.
4921 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4922 (__P): Remove; all uses removed.
4923 * md5.c: Include "md5.h" first.
4924 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4925 md5_buffer, md5_process_bytes, md5_process_block):
4926 Define with prototypes.
4927 * sha.h (__P): Remove all uses. (It wasn't defined??)
4928 * sha.c: Include "sha.h" first.
4929 Include <stdlib.h>, <string.h> unconditionally.
4931 * memchr.c (__ptr_t): Remove; all uses changed to void *.
4932 * memcmp.c (__ptr_t): Likewise.
4933 * memrchr.c (__ptr_t): Likewise.
4934 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4935 Include <string.h> unconditionally.
4936 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4937 * memchr.c: Include <stdlib.h> unconditionally.
4938 * memchr.c (LONG_MAX): Remove.
4939 * memrchr.c (LONG_MAX): Likewise.
4940 * memchr.c (__memchr): Define via a prototype.
4941 * memrchr.c (__memrchr): Likewise.
4942 * memcmp.c (__P): Remove, and remove all uses.
4943 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4944 Remove forward decls; no longer needed.
4945 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4946 Use types required by C89 in prototype.
4948 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4949 * savedir.c: Likewise.
4950 * mkdir.c (free): Remove decl.
4951 * rmdir.c (rmdir): Define with a prototype.
4952 * savedir.c: Include savedir.h first, to test interface.
4954 * mktime.c (STDC_HEADERS): Remove.
4955 Include <stdlib.h>, <string.h> unconditionally.
4957 * modechange.c: Include <stdlib.h> unconditionally.
4958 (malloc): Remove decl.
4960 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4961 (free): Remove decl.
4963 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4964 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4965 (This type really should be intptr_t, but that's a C99ism.)
4966 (_obstack_memcpy): Remove: all uses changed to memcpy.
4967 Include <string.h> unconditionally.
4968 (struct obstack): Assume __STDC__ for types of members
4969 chunkfun, freefun, extra_arg.
4970 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4971 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4972 obstack_begin, obstack_specify_allocation,
4973 obstack_specify_allocation_with_arg, obstack_chunkfun,
4974 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4975 Remove unprototyped decls and the macros that use them.
4976 * obstack.c (POINTER): Remove. All uses changed to void *.
4977 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4978 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4979 (defined __STDC__ && __STDC__)]:
4980 Remove nonprototyped code.
4981 Include <stdlib.h> unconditionally.
4982 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4983 _obstack_allocated_p, _obstack_free, obstack_free,
4984 _obstack_memory_used, print_and_abort):
4985 Define using prototypes.
4986 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4987 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4988 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4989 obstack_next_free, obstack_object_size, obstack_room) [0]:
4990 Remove unused, unprototyped code.
4992 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4994 * physmem.c (physmem_total, physmem_available, main): Define
4997 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4998 (main): Define with a prototype.
5000 * posixver.c (getenv): Remove decl.
5002 * putenv.c (malloc): Returns void *, not char *.
5003 Include <string.h> unconditionally.
5004 (strchr, memcpy, NULL): Do not define.
5006 * readtokens.c: Include readtokens.h first, to test interface.
5007 Include <stdlib.h>, <string.h> unconditionally.
5008 (init_tokenbuffer): Define with a prototype.
5010 * regex.c (PARAMS): Remove. All uses removed.
5011 All uses of _RE_ARGS removed, too.
5012 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5014 (bzero): Assume memset exists.
5015 (memcmp, memcpy, NULL): Remove.
5016 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
5017 char, or assignments to local vars of type signed char.
5018 (init_syntax_once, PREFIX(extract_number_and_incr),
5019 PREFIX(print_partial_compiled_pattern),
5020 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
5021 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
5022 PREFIX(regex_grow_registers), PREFIX(regex_compile),
5023 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
5024 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
5025 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
5026 wcs_compile_range, byte_compile_range, truncate_wchar,
5027 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
5028 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
5029 count_mbs_length, wcs_re_match_2_internal,
5030 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
5031 PREFIX(alt_match_null_string_p),
5032 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
5033 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
5034 regfree, PREFIX(extract_number)): Define with prototype. Remove
5035 now-unnecessary declaration, if any.
5036 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
5038 Remove now-unnecessary casts among pointer types.
5039 * regex.h (_RE_ARGS): Remove. All uses removed.
5041 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
5042 (free): Remove decl.
5044 * rpmatch.c: Include <stdlib.h> unconditionally.
5046 * same.c: Include <stdlib.h>, <string.h> unconditionally.
5047 (free): Remove decl.
5049 * save-cwd.c: Include <stdlib.h> unconditionally.
5050 * xgetcwd.c: Likewise.
5052 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
5053 (free): Remove decl.
5055 * strchrnul.c (strchrnul): Define with a prototype.
5056 Fix bug: c_in was not converted to char before searching.
5058 The following changes are not K&R related:
5060 * group-member.h: Include <sys/types.h>, so that this file is
5062 * makepath.h: Likewise.
5064 * getusershell.c (readname, default_index, line_size, readname):
5065 Use size_t, not int, for sizes.
5066 (readname): If the size overflows, report an error instead of
5069 2003-09-09 Derek Robert Price <derek@ximbiot.com>
5071 * getndelim2.c: Assume stdlib.h per the C89 spec.
5073 2003-09-08 Paul Eggert <eggert@twinsun.com>
5075 Assume C89 or better; remove K&R cruft.
5076 A few of these changes were first proposed by Derek Robert Price
5077 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
5079 * addext.c: Include <string.h> unconditionally.
5080 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
5081 Don't declare getenv or malloc.
5083 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
5084 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
5086 (find_stack_direction, alloca): Use prototypes.
5088 * atexit.c (atexit): Define using a prototype.
5090 * basename.c, dirname.c, stripslash.c:
5091 Include <string.h> unconditionally.
5093 * bcopy.c: Include <stddef.h>.
5094 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
5096 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
5098 * error.h (error, error_at_line, error_print_progname)
5099 [! (defined (__STDC__) && __STDC__)]: Remove decls.
5100 * error.c: Include error.h first, to check interface.
5101 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5102 (VA_START): Remove; all uses changeed to va_start.
5103 (exit, strerror): Remove decls.
5104 (error_print_progname): Prototype uncondionally.
5105 Don't include <errno.h>; no longer needed.
5106 (private_strerror): Remove.
5107 (error_tail): Always define.
5108 (error, error_at_line): Assume C89 or better; always use prototypes.
5109 * fatal.c: Include "fatal.h" first, to test interface.
5110 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5111 (VA_START): Remove; all uses changed to va_start.
5112 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
5114 (exit): Remove decl.
5115 (fatal): Prototype unconditionally. Assume va_start works.
5116 Abort at end, to pacify gcc.
5118 * euidaccess.c (main): Define with a prototype.
5120 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
5122 * exitfail.c: Include <stdlib.h> unconditionally.
5124 * fnmatch_.h (__P): Remove. All uses changed to assume
5126 * fnmatch.c: Include fnmatch.h first, to test interface.
5127 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
5128 (getenv): Remove decl.
5129 (fnmatch): Define using a prototype.
5130 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
5131 (FCT): Define using a prototype.
5133 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
5135 * gethostname.c: Include <stddef.h>.
5136 (gethostname): Define with prototype. Length is size_t, not int.
5138 2003-09-08 Paul Eggert <eggert@twinsun.com>
5140 * getversion.c: Remove; was migrated to backupfile.c in 1997.
5141 getversion.c should have been removed then, but was accidentally
5144 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
5145 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
5147 2003-09-07 Paul Eggert <eggert@twinsun.com>
5149 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
5150 copy_tm_result. Bug reported by Simon Josefsson in
5151 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
5153 2003-09-06 Paul Eggert <eggert@twinsun.com>
5155 * time_r.c, time_r.h: New files.
5157 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
5159 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
5160 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
5162 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
5164 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
5165 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
5168 * timegm.c: Switch to glibc implementation, with the following changes:
5169 [defined HAVE_CONFIG_H]: Include <config.h>.
5170 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
5171 (__mktime_internal) [!defined _LIBC]: New decl.
5172 (__gmtime_r) [!defined _LIBC]: New macro and function.
5173 (timegm): Use a prototype, since gnulib assumes C89.
5174 Do not bother declaring tmp to be const, as it's not really usefu.
5175 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
5176 (timegm): Declare only if HAVE_DECL_TIMEGM.
5178 2003-09-03 Paul Eggert <eggert@twinsun.com>
5180 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
5181 Bug reported by Lute Kamstra in
5182 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
5184 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
5185 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
5186 course with correspondingly smaller numbers for tomorrow and
5187 yesterday. From Tadayoshi Funaba. Originally installed into
5188 sh-utils on 1999-08-07, but the patch got lost (I guess during the
5191 2003-08-31 Simon Josefsson <jas@extundo.com>
5193 * timegm.h: New file.
5194 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
5196 2003-08-31 Karl Berry <karl@gnu.org>
5198 * argp.h: update from libc.
5200 2003-08-28 Bruno Haible <bruno@clisp.org>
5202 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
5203 warning on QNX, which defines O_BINARY to 000000.
5205 2003-08-24 Bruno Haible <bruno@clisp.org>
5207 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
5208 MSVC7 <stdio.h> is included later.
5210 2003-08-20 Bruno Haible <bruno@clisp.org>
5212 * progname.h: New file, from GNU gettext.
5213 * progname.c: New file, from GNU gettext.
5214 * progreloc.c: New file, from GNU gettext.
5216 2003-08-19 Bruno Haible <bruno@clisp.org>
5218 * xstrdup.c: Assume <string.h> exists.
5220 2003-08-18 Jim Meyering <jim@meyering.net>
5222 * setenv.h: Indent nested cpp directive.
5223 * vasnprintf.c: Remove trailing blanks.
5225 2003-08-17 Simon Josefsson <jas@extundo.com>
5226 Bruno Haible <bruno@clisp.org>
5228 * xstrndup.h: New file.
5229 * xstrndup.c: New file.
5231 2003-08-17 Bruno Haible <bruno@clisp.org>
5233 * strndup.h: New file.
5235 2003-08-16 Paul Eggert <eggert@twinsun.com>
5237 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
5238 space, undoing this 2003-08-12 change:
5239 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
5241 2003-08-16 Jim Meyering <jim@meyering.net>
5243 Merge from coreutils.
5244 * xstrtoimax.c: #else #if -> #elif.
5245 * xstrtoumax.c: Likewise.
5247 2003-08-15 Paul Eggert <eggert@twinsun.com>
5249 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
5250 rather than tab, after '#' in shell-script copyright notices.
5251 Suggested by Bruno Haible.
5253 2003-08-15 Jim Meyering <jim@meyering.net>
5254 and Paul Eggert <eggert@twinsun.com>
5256 Merge from coreutils.
5257 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
5258 member but strut utmpx does not. Needed for AIX 4.3.3.
5259 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
5261 2003-08-15 Jim Meyering <jim@meyering.net>
5263 Merge from coreutils.
5264 * xgethostname.c: Include <stdlib.h>.
5265 (xghostname): Don't exit for anything other than memory-related
5266 failure; just return NULL.
5267 * userspec.c: Include "posixver.h".
5268 (parse_user_spec): Accept `.' as a separator only
5269 in pre-POSIX-200112 mode.
5270 * strtoimax.c: Use #elif rather than #else #if.
5271 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
5272 Remove function, now that we can rely on a working tzset function.
5273 [!_LIBC]: Ensure that the required autoconf test has been run.
5274 [!defined _NL_CURRENT && HAVE_STRFTIME]:
5275 Use underlying_strftime for %r.
5276 * sha.c: Merge in some clean-up and optimization changes from glibc.
5277 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
5278 Ensure that it is a multiple of 64.
5279 Rearrange loop exit tests so as to avoid performing an
5280 additional fread after encountering an error or EOF.
5281 * realloc.c: Update copyright date.
5283 2003-08-14 Jim Meyering <jim@meyering.net>
5285 Merge from coreutils.
5286 * obstack.h: Whitespace changes.
5287 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
5288 and xcalloc return values.
5289 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
5290 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
5291 hang on OSF/1 5.1 for DIR on both local and remote file systems.
5292 Reported by (and fix confirmed by) Nelson H. F. Beebe.
5293 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5295 Use mntctl's return value to drive the entry-processing loop, since
5296 we can't rely on the value of the vmt_length member in the last
5297 entry. On some systems doing so could result in exhausting
5298 virtual memory. Based in part on a patch from Mike Jetzer.
5300 2003-08-14 Jim Meyering <jim@meyering.net>
5301 and Paul Eggert <eggert@twinsun.com>
5303 Merges from coreutils, plus other fixes.
5304 * physmem.c: Merge in portability changes from gcc/libiberty
5305 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
5306 for credits and details. Thanks to Kaveh Ghazi for helping
5307 to keep these files in sync.
5308 (ARRAY_SIZE): Define it.
5309 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
5310 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
5311 (memcasecmp): Don't assume size_t fits in unsigned int.
5312 Remove casts and duplicate code.
5313 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
5314 (memcpy): Remove definition.
5315 Merge in some clean-up and optimization changes from glibc.
5316 [BLOCKSIZE]: Move definition to top of file.
5317 Ensure that it is a multiple of 64.
5318 Rearrange loop exit tests so as to avoid performing an
5319 additional fread after encountering an error or EOF.
5320 * md5.h (md5_uintptr): Define.
5321 * makepath.c (CLEANUP_CWD): Report an error if we failed to
5322 return to the initial working directory. Preserve errno
5324 * idcache.c: Include "xalloc.h".
5325 (xmalloc, xrealloc): Remove decls.
5326 (getuser): Remove casts no longer required in C89.
5327 * human.c: Include stdio.h, for sprintf.
5328 * group-member.c: Include "xalloc.h".
5329 (xmalloc, xrealloc): Remove decls.
5330 (get_group_info): Remove casts no longer required in C89.
5331 * getusershell.c (readname): Remove casts no longer required in C89.
5332 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
5333 * getline.c: Whitespace fix, from coreutils.
5335 2003-08-13 Paul Eggert <eggert@twinsun.com>
5337 * exclude.c: Include <ctype.h>
5338 (IN_CTYPE_DOMAIN): New macro.
5340 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
5343 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5344 Undo previous (whitespace-only) change.
5346 2003-08-12 Paul Eggert <eggert@twinsun.com>
5348 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5349 Normalize leading white space and remove trailing white space.
5350 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
5351 notice, as per ../config/srclist-update.
5353 Merge from coreutils.
5354 * euidaccess.h: New file.
5355 * euidaccess.c: Include it.
5356 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
5357 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
5358 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
5360 2003-08-11 Bruno Haible <bruno@clisp.org>
5362 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
5363 (vasnprintf): Use it instead of wcslen.
5365 2003-08-11 Bruno Haible <bruno@clisp.org>
5367 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
5368 value to ensure that _Bool promotes to int. Use #define for _Bool when
5369 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
5371 2003-08-10 Karl Berry <karl@gnu.org>
5373 * regex.h: update from libc (whitespace fix).
5375 2003-08-09 Paul Eggert <eggert@twinsun.com>
5377 Merge some files from coreutils. These changes were
5378 originally made by Jim Meyering.
5379 * acl.c: Include <sys/types.h> before <sys/stat.h>;
5380 many older Unixes require this.
5381 * alloca.c (alloca): Remove cast to argument of free;
5382 no longer needed in C89.
5383 * alloca_.h, regex.h: Fix white space to match
5384 what GNU indent does.
5386 2003-08-05 Paul Eggert <eggert@twinsun.com>
5388 * bumpalloc.h: Remove.
5390 2003-08-04 Paul Eggert <eggert@twinsun.com>
5392 * getloadavg.c: Change copyright notice and spacing to conform to
5395 Merge from coreutils.
5396 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
5398 * getdate.y (date): Also accept dates like May-23-2003; suggestion
5399 from Karl Berry, implemented by Jim Meyering.
5400 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
5401 from Dmitry V. Levin.
5402 Remove anachronistic cast of xrealloc.
5403 * fnmatch_.h (__const): Remove. Use 'const'.
5404 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
5405 type. Otherwise, it wouldn't compile with at least /bin/cc on
5406 ymp-cray-unicos9.0.2.X.
5407 Combine two mostly-identical uses of alloca into one.
5408 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5410 2003-08-04 Dave Love <d.love@dl.ac.uk>
5414 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
5415 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
5416 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
5417 obsolete NLIST_NAME_UNION.
5418 [__GNU__]: Undef BSD and FSCALE.
5419 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
5421 2003-08-03 Paul Eggert <eggert@twinsun.com>
5423 * stdbool_.h (_Bool): Make it signed char, instead of
5424 an enum type, so that it's guaranteed to promote to int. See:
5425 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
5427 2003-07-31 Paul Eggert <eggert@twinsun.com>
5429 * strerror.c: Include config.h, limits.h. Declare sprintf.
5430 (strerror): Don't assume that a printable int fits in 14 bytes.
5432 2003-07-24 Derek Robert Price <derek@ximbiot.com>
5433 Bruno Haible <bruno@clisp.org>
5435 * getline.h (getline, getdelim): Change return type to ssize_t.
5436 * getline.c (getline, getdelim): Likewise.
5437 Remove _GNU_SOURCE define; now it's defined in config.h through
5440 2003-07-22 Paul Eggert <eggert@twinsun.com>
5442 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5443 over-parenthesization in macros.
5445 Sync with coreutils.
5447 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
5450 Use `exit_failure' for xalloc and xmemcoll instead of their own
5451 private exit-failure variables.
5452 * xalloc.h (xalloc_exit_failure): Remove.
5453 * xmalloc.c: Likewise. Include exitfail.h.
5454 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
5455 * xmemcoll.h (xmemcoll_exit_failure): Remove.
5456 * xmemcoll.c: Likewise. Include exitfail.h.
5457 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
5459 2003-07-18 Paul Eggert <eggert@twinsun.com>
5461 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5462 * closeout.c: Likewise. Include "closeout.h" right after config.h,
5463 to test that it can stand by itself. Include "exitfail.h".
5464 Clients should set exit_failure instead.
5465 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
5467 2003-07-18 Andreas Schwab <schwab@suse.de>
5469 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5471 2003-07-18 Bruno Haible <bruno@clisp.org>
5473 * getndelim2.h: New file.
5474 * getndelim2.c: Make into a module of its own. Include config.h,
5476 (getndelim2): Make non-static. Change return type to ssize_t.
5477 * getline.h: Change argument names.
5478 * getline.c: Include getndelim2.h instead of getndelim2.c.
5479 * getnline.c: Include getndelim2.h.
5481 2003-07-17 Bruno Haible <bruno@clisp.org>
5483 * Makefile.am: Remove file.
5484 * Makefile.in: Remove file.
5486 2003-07-17 Bruno Haible <bruno@clisp.org>
5488 * getnline.h: New file.
5489 * getnline.c: New file.
5490 * getndelim2.c: New file, extracted from getline.c.
5491 (getndelim2): Renamed from getdelim2, with added nmax argument.
5492 * getline.c: Include getndelim2.c.
5493 (getdelim2): Moved out to getndelim2.c.
5494 (getline, getdelim): Update.
5496 2003-07-15 <karl@gnu.org>
5498 * vasnprintf.c: update from gettext.
5500 2003-07-15 Jim Meyering <jim@meyering.net>
5502 * makepath.c (make_path): Enclose diagnostic in _(...).
5504 2003-07-14 Paul Eggert <eggert@twinsun.com>
5506 * asnprintf.c, asprintf.c, config.charset, gettext.h,
5507 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
5508 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
5509 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
5510 vasprintf.c, vasprintf.h: Regenerate. These files are now being
5511 updated automatically by ../config/srclist-update. This changes
5512 their license from LPGL to GPL.
5514 2003-07-14 Jim Meyering <jim@meyering.net>
5516 Don't emit diagnostics. Let callers do that.
5517 * save-cwd.c: Don't include "error.h".
5518 (save_cwd): Don't call error. Ensure that errno is valid
5519 when returning nonzero.
5521 * save-cwd.h (restore_cwd): Update prototype.
5522 * save-cwd.c (restore_cwd): Remove two parameters.
5523 Simplify. Don't call error upon failure. Let callers do that.
5524 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5525 when auditing is enabled. But don't bother updating the #if.
5527 2003-07-14 Simon Josefsson <jas@extundo.com>
5529 * mempcpy.h: New file.
5530 * mempcpy.c: New file.
5532 2003-07-14 Paul Eggert <eggert@twinsun.com>
5534 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
5535 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
5536 unicodeio.c, unicodeio.h, unlocked-io.h:
5537 Switch from LGPL to GPL.
5539 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
5541 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
5542 it breaks C++ compilation.
5543 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
5545 2003-07-10 Jim Meyering <jim@meyering.net>
5547 * vasnprintf.c: Remove trailing blanks.
5548 Make cpp indentation consistent.
5550 2003-07-09 Paul Eggert <eggert@twinsun.com>
5552 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
5553 posixver.c, strftime.c, strnlen.c, strverscmp.c:
5554 Switch from LGPL to GPL.
5556 2003-07-07 Paul Eggert <eggert@twinsun.com>
5558 * mktime.c: Fix some boundary cases and remove need for floating point.
5560 Issue a compile-time diagnostic if time_t is floating point, or if
5561 two's complement arithmetic is not in effect, or if arithmetic
5562 right shift does not propagate the sign. These assumptions were
5563 all in the original code but they weren't checked.
5565 (TIME_T_MIDPOINT, verify): New macros.
5566 (__isleap): Remove; it has integer overflow problems.
5567 (leapyear): New function, without those problems.
5568 (ydhms_tm_diff): Remove; splitting into two parts.
5569 (ydhms_diff): New function, containing the arithmetic part of
5570 the old ydhms_tm_diff function. Issue a compile-time
5571 diagnostic if we are not using C99 integer division.
5572 Avoid casts when possible.
5573 (guess_time_tm): New function, containing the checking part of
5574 the old ydhms_tm_diff function. Return the new value, rather than
5575 the difference between it and the old. Accept a new argument T
5576 so that *T specifies the old value. Check for overflow in the result.
5578 (__mktime_internal): Use a time_t offset, not a long int offset.
5579 This undoes the 2003-06-04 change, which is no longer needed now
5580 that we have better overflow checking.
5581 (localtime_offset): Likewise.
5583 (__mktime_internal): Avoid harmful overflow on hosts where time_t
5584 and long are 64-bit but int is only 32-bit.
5585 (ydhms_diff): Use long int to store year1 and yday1.
5586 Issue a compile-time diagnostic if long int is not wide enough.
5588 (__mktime_internal): Use long int to store adjusted year and yday.
5589 Use plain C rather than preprocessor commands, if that doesn't
5591 Check for overflow (and try to repair) after each probe
5592 rather than checking only at the very end. This avoids some bugs
5593 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5594 does not equal GMT offset at maximum time).
5595 Use integer to check for overflow rather than floating point; this
5596 is more portable to non-IEEE hosts, and is a tad faster.
5597 When we detect that we are oscillating between two values,
5598 don't check whether tm_isdst has the requested value, since
5599 we already know the answer. When tm_isdst has the wrong value,
5600 use a different heuristic to find the right one, based on the
5601 extreme values actually observed in practice in tz2003a,
5602 rather than the (overly optimistic) "previous 3 calendar quarters".
5604 (not_equal_tm, print_tm, check_result): Use "const T" rather than
5605 "T const" to accommodate glibc style.
5606 (check_result): Use less-confusing report format. "long" -> "long int.
5608 Don't loop if the iteration overflows time_t.
5609 Allow a negative step in the iteration.
5611 2003-07-01 Paul Eggert <eggert@twinsun.com>
5613 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5614 having it depend on HAVE_SYS_TYPES_H.
5616 2003-06-25 Bruno Haible <bruno@clisp.org>
5618 * readlink.c: New file.
5620 2003-06-20 Bruno Haible <bruno@clisp.org>
5622 Assume C89, so PARAMS isn't needed.
5623 * unicodeio.h (PARAMS): Remove.
5624 * unicodeio.c: Don't use PARAMS.
5626 2003-06-18 Jim Meyering <jim@meyering.net>
5628 Merge changes from coreutils.
5629 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5630 Remove explicit declarations of xmalloc and realloc.
5632 (read_utmp): Remove anachronistic cast of xmalloc.
5634 2003-06-17 Paul Eggert <eggert@twinsun.com>
5636 Assume C89, so PARAMS isn't needed.
5637 * backupfile.h (PARAMS): Remove. All uses removed.
5638 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5639 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5640 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5641 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5642 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5643 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5644 xstrtol.h: Likewise.
5645 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5646 same.h, strverscmp.h: Do not include config.h; no longer needed.
5647 Anyway, config.h should always be included before any other file.
5649 2003-06-11 Simon Josefsson <jas@extundo.com>
5651 * sysexit_.h: New file.
5653 2003-05-20 Derek Price <derek@ximbiot.com>
5655 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5657 2003-06-10 Simon Josefsson <jas@extundo.com>
5659 * strchrnul.h: New file.
5660 * strchrnul.c: New file.
5662 2003-06-10 Simon Josefsson <jas@extundo.com>
5664 * argp.h: New file, from glibc.
5665 * argp-ba.c: New file, from glibc.
5666 * argp-eexst.c: New file, from glibc.
5667 * argp-fmtstream.c: New file, from glibc.
5668 * argp-fmtstream.h: New file, from glibc.
5669 * argp-fs-xinl.c: New file, from glibc.
5670 * argp-help.c: New file, from glibc.
5671 * argp-namefrob.h: New file, from glibc.
5672 * argp-parse.c: New file, from glibc.
5673 * argp-pv.c: New file, from glibc.
5674 * argp-pvh.c: New file, from glibc.
5675 * argp-xinl.c: New file, from glibc.
5677 2003-06-07 Jim Meyering <jim@meyering.net>
5679 * readtokens.h: Put `Free Software Foundation, Inc.'
5680 in place of my name in the copyright comment.
5681 Remove definition and uses of __P.
5684 * stat.c: Don't declare xmalloc explicitly.
5685 Instead, include "xalloc.h".
5686 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5687 xrealloc, and xcalloc return values.
5688 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5690 * xgetcwd.h: Remove definition/uses of PARAMS.
5692 2003-06-06 Jim Meyering <jim@meyering.net>
5694 * stdbool_.h: Renamed from stdbool.h.in.
5696 2003-06-06 Jim Meyering <jim@meyering.net>
5698 Merge from coreutils.
5699 * same.c: (same_name): Declare *_basename locals to be `const'.
5700 Consolidate declarations and initializations of *_base* locals.
5702 Merge from coreutils.
5703 This avoids a core dump on systems without GNU putenv,
5704 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5705 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5706 (unsetenv): New static function, from GNU libc.
5707 (rpl_putenv): Use it.
5709 * modechange.c: Remove trailing blanks.
5711 Merge from coreutils.
5712 * fsusage.c: Remove declaration of statfs.
5713 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5715 * posixtm.c: Include <stdbool.h> unconditionally.
5717 2003-06-05 Paul Eggert <eggert@twinsun.com>
5719 * mktime.c (__mktime_internal): When resolving a tm_isdst
5720 mismatch, look in future quarters as well as past. This fixes a
5721 bug when processing fall-backwards gaps immediately after a long
5722 period of daylight-saving time.
5724 * mktime.c: Assume freestanding C89 or better.
5725 (HAVE_LIMITS_H): Remove. Assume it's 1.
5726 (__P): Remove; not used.
5727 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5728 (mktime, not_equal_tm, print_tm, check_result,
5729 main): Use prototypes. Use const * where appropriate.
5730 (main): Fix typo in testing code that uncovered by above changes.
5731 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5733 2003-06-04 Paul Eggert <eggert@twinsun.com>
5735 * mktime.c: Fix Debian bug 177940
5736 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5737 (localtime_offset): Now long int, not time_t, because we want it
5738 to be guaranteed to be signed. All uses changed.
5739 (__mktime_internal): If overflow would occur when adding offset,
5742 Merge 'human' changes from coreutils. Rewrite to support
5743 locale-specific notations like thousands separators.
5744 * human.c: Simplify authorship notice.
5745 Include human.h immediately after config.h.
5746 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5747 <limits.h>: Do not include, since human.h does.
5748 (SIZE_MAX, UINTMAX_MAX): New macros.
5749 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5750 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5751 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5752 (power_letter): Renamed from suffixes.
5753 (generate_suffix_backwards): Remove.
5754 (adjust_value): Now takes int style (because of human.h changes)
5755 and long double value (for greater precision on some platforms).
5756 (group_number): New function.
5757 (human_readable): Use it. Use integer options, not enum.
5758 Put the options before the sizes in the arg list.
5759 Support all the new options.
5760 The old human_readable function has been removed;
5761 use inttostr.h instead.
5762 (human_readable, default_block_size, humblock):
5763 Use uintmax_t, not int, for block sizes.
5764 (human_readable_inexact, block_size_types): Remove.
5765 (block_size_opts): New constant.
5766 (human_options): Renamed from human_block_size, with new signature
5767 that allows block sizes up to UINTMAX_MAX. All callers changed.
5768 * human.h: Add copyright and authorship notice.
5769 Include <limits.h> and <stdbool.h> unconditionally.
5770 (PARAMS): Remove. All uses removed.
5771 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5772 (enum human_inexact_style): Remove tag; now a nameless enum.
5773 (human_floor, human_ceiling, human_round_to_even): Now have
5774 values 2, 0, 1 rather than -1, 1, 0.
5775 (human_group_digits, human_suppress_point_zero, human_autoscale,
5776 human_base_1024, human_SI, human_B): New constants.
5777 (human_readable_inexact, human_block_size): Remove.
5778 (human_readable): Size args are now uintmax_t, not int.
5779 (human_options): New decl.
5781 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5782 unnecessary now that we assume C89 or better. This change
5783 imported from coreutils.
5785 * mktime.c (__mktime_internal): Do not reject negative timestamps
5786 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5787 in the 2003-05-30 sync from glibc.
5789 .h files should stand alone, but we shouldn't include <sys/types.h>
5790 if we can get away with just <stddef.h>.
5792 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5793 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5794 rather than <sys/types.h>, as we merely need size_t.
5795 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5797 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5798 Include <stdio.h>, to get FILE.
5799 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5800 memcasecmp.h has included <stddef.h> and all we need is size_t.
5801 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5802 our interface, instead of including <sys/types.h>
5804 2003-06-02 Paul Eggert <eggert@twinsun.com>
5807 Fix some minor time-related bugs with POSIX time arguments.
5808 Some valid time stamps were being rejected (notably -1, and
5809 time stamps before 1900 on 64-bit hosts). And some invalid
5810 time stamps were being accepted, e.g. September 31.
5812 * posixtm.h (posixtime): Return bool instead of time_t, so
5813 that we can return (time_t) -1 successfully.
5814 * posixtm.c: Likewise.
5815 [HAVE_STDBOOL_H]: Include <stdbool.h>.
5816 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5817 (t): Remove static var.
5818 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5819 of static var. All uses changed.
5820 (year): Do not reject years before 1900; they can occur with
5822 (posix_time_parse): Do not check for out-of-range components;
5823 that is now the caller's responsibility, since our checks were
5824 only approximations.
5825 (posixtime): Use mktime to check for out-of-range components,
5826 since it knows them exactly.
5827 If mktime returns (time_t) -1, check whether an error actually occurred
5828 by invoking localtime on -1.
5829 (main) [TEST_POSIXTIME]: Check for input data errors, and report
5830 posixtime failures better.
5831 Improve the test data (in comments only).
5833 2003-05-30 <karl@gnu.org>
5835 * mktime.c: update from libc.
5837 2003-05-30 Bruno Haible <bruno@clisp.org>
5839 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5840 * localcharset.h: Likewise.
5841 * localcharset.c: Likewise.
5843 2003-05-28 Paul Eggert <eggert@twinsun.com>
5845 Assume the headers required for C89 freestanding compilers.
5846 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5847 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5848 without checking for HAVE_LIMITS_H.
5849 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5850 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5852 * fatal.c: Include <stdarg.h> without checking for __STDC__.
5853 * exclude.c: Include <stdbool.h> unconditionally.
5854 * tempname.c: Include <stddef.h> unconditionally.
5855 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5856 * modechange.c, rpmatch.c (NULL): Don't define, since
5857 <stddef.h> does that.
5858 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5859 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5860 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5861 * xstrtol.c: Likewise.
5862 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5863 * savedir.c: Include <stddef.h> instead of defining NULL.
5865 * addext.c (addext): Use assignment rather than cast, to avoid
5866 warnings on some platforms.
5868 * mktime.c (__mktime_internal): Do not reject negative timestamps
5871 2003-05-10 Bruno Haible <bruno@clisp.org>
5873 * linebreak.c (iconv_string_length): Don't return -1 just because the
5874 string is longer than 4 KB.
5876 2003-05-12 Jim Meyering <jim@meyering.net>
5878 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5879 the space-padded-by-default conversion specifiers, %e, %k, %l.
5881 2003-05-03 Bruno Haible <bruno@clisp.org>
5883 Upgrade to Unicode-4.0.
5884 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
5885 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
5886 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
5887 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
5888 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
5889 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
5890 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
5891 Change width of U+E0100..U+E01EF from 1 to 0.
5893 2003-04-25 Bruno Haible <bruno@clisp.org>
5895 * copy-file.c: Include <stddef.h>, for size_t.
5897 2003-04-25 Jim Meyering <jim@meyering.net>
5899 * copy-file.c (copy_file_preserving): Declare buf_size to be
5900 of type size_t, not int.
5902 2003-04-11 Jim Meyering <jim@meyering.net>
5904 Merge changes from Coreutils.
5906 2003-03-22 Jim Meyering <jim@meyering.net>
5908 * strftime.c (widen): Cast alloca return value to proper type.
5910 2003-01-19 Ulrich Drepper <drepper@redhat.com>
5913 * strftime.c (my_strftime): Handle very large width
5914 specifications for numeric values correctly. Improve checks for
5917 2003-01-19 Jim Meyering <jim@meyering.net>
5919 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5920 (nl_get_alt_digit) [! defined my_strftime]: Define.
5921 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5922 _nl_get_alt_digit and _nl_get_walt_digit.
5924 * strftime.c (my_strftime): Merge in locale-related changes from libc.
5925 These changes have no effect outside of _LIBC.
5927 2003-04-10 Bruno Haible <bruno@clisp.org>
5929 * findprog.h: New file, from GNU gettext.
5930 * findprog.c: New file, from GNU gettext.
5932 2003-04-05 Jim Meyering <jim@meyering.net>
5934 Merge changes from Coreutils.
5936 * exclude.h (PARAMS): Remove definition and uses.
5937 * exclude.c: Remove uses of `PARAMS'.
5939 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5940 Add test-cases for DOS filenames. Declare program_name.
5941 (main): Set up program_name. Patch by Rich Dawe.
5943 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5945 Use mntctl's return value to drive the entry-processing loop, since
5946 we can't rely on the value of the vmt_length member in the last
5947 entry. On some systems doing so could result in exhausting
5948 virtual memory. Based in part on a patch from Mike Jetzer.
5950 2003-04-04 Bruno Haible <bruno@clisp.org>
5952 * linebreak.h: New file, from GNU gettext.
5953 * linebreak.c: New file, from GNU gettext with slight modifications.
5954 * lbrkprop.h: New file, from GNU gettext.
5956 2003-04-03 Bruno Haible <bruno@clisp.org>
5958 * utf8-ucs4.h: New file, from GNU gettext.
5959 * utf16-ucs4.h: New file, from GNU gettext.
5960 * ucs4-utf8.h: New file, from GNU gettext.
5961 * ucs4-utf16.h: New file, from GNU gettext.
5963 2003-04-02 Bruno Haible <bruno@clisp.org>
5965 * binary-io.h: New file, from GNU gettext.
5967 2003-04-01 Bruno Haible <bruno@clisp.org>
5969 * pathname.h: New file, from GNU gettext.
5970 * concatpath.c: New file, from GNU gettext.
5972 2003-03-30 Bruno Haible <bruno@clisp.org>
5974 * copy-file.c (copy_file_preserving): Don't set owner if the function
5975 chown() doesn't exist.
5977 2003-03-28 Bruno Haible <bruno@clisp.org>
5979 * copy-file.h: New file, from GNU gettext.
5980 * copy-file.c: New file, from GNU gettext.
5982 2003-03-18 Jim Meyering <jim@meyering.net>
5984 * quote.c (quote_n): Fix typo in comment.
5986 2003-03-14 Jim Meyering <jim@meyering.net>
5988 Merge changes from Coreutils.
5989 * obstack.h (obstack_object_size): Declare temporary, __o,
5990 to be const, in order to avoid warnings.
5991 (obstack_room): Likewise.
5992 (obstack_empty_p): Likewise.
5994 2003-03-13 Paul Eggert <eggert@twinsun.com>
5996 Merge changes from Bison.
5997 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5998 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5999 when compiling Bison 1.875's `bitset bset = obstack_alloc
6000 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
6001 * hash.c: Include <stdbool.h> unconditionally.
6003 2003-03-09 Paul Eggert <eggert@twinsun.com>
6005 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
6006 Reported by Bruce Becker; see:
6007 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
6009 2003-03-03 Paul Eggert <eggert@twinsun.com>
6010 Bruno Haible <bruno@clisp.org>
6012 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
6013 Reported by John Hughes, see
6014 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
6016 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
6018 * poll_.h: New file.
6021 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
6023 * mathl.h: New file.
6024 * acosl.c: New file.
6025 * asinl.c: New file.
6026 * atanl.c: New file.
6027 * ceill.c: New file.
6030 * floorl.c: New file.
6031 * frexpl.c: New file.
6032 * ldexpl.c: New file.
6034 * sincosl.c: New file.
6036 * sqrtl.c: New file.
6038 * trigl.c: New file.
6039 * trigl.h: New file.
6041 2003-02-17 Bruno Haible <bruno@clisp.org>
6043 * mkdtemp.h: New file, from GNU gettext.
6044 * mkdtemp.c: New file, from GNU gettext.
6046 2003-01-31 Bruno Haible <bruno@clisp.org>
6048 * rename.c: #undef rename before defining rpl_rename.
6049 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
6051 2003-01-30 Bruno Haible <bruno@clisp.org>
6053 * printf-args.h: New file, from GNU gettext.
6054 * printf-args.c: New file, from GNU gettext.
6055 * printf-parse.h: New file, from GNU gettext.
6056 * printf-parse.c: New file, from GNU gettext.
6057 * vasnprintf.h: New file, from GNU gettext.
6058 * vasnprintf.c: New file, from GNU gettext.
6059 * asnprintf.c: New file, from GNU gettext.
6060 * vasprintf.h: New file, from GNU gettext with modifications.
6061 * vasprintf.c: New file, from GNU gettext.
6062 * asprintf.c: New file, from GNU gettext.
6064 2003-01-29 Bruno Haible <bruno@clisp.org>
6066 * stpncpy.h: New file, from GNU gettext with modifications.
6067 * stpncpy.c: New file, from GNU gettext with modifications.
6069 2003-01-28 Bruno Haible <bruno@clisp.org>
6071 * c-ctype.h: New file, from GNU gettext, with changes suggested by
6073 * c-ctype.c: New file, from GNU gettext, with changes suggested by
6076 2003-01-27 Bruno Haible <bruno@clisp.org>
6078 * xsetenv.h: New file, from GNU gettext.
6079 * xsetenv.c: New file, from GNU gettext.
6081 2003-01-23 Bruno Haible <bruno@clisp.org>
6083 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
6085 2003-01-22 Bruno Haible <bruno@clisp.org>
6087 * exit.h: New file, from GNU gettext.
6089 2003-01-11 Bruno Haible <bruno@clisp.org>
6091 * stpcpy.h (stpcpy): Use ANSI C function declarations.
6092 * strcase.h (strcasecmp, strncasecmp): Likewise.
6094 2003-01-14 Jim Meyering <jim@meyering.net>
6096 * same.c (same_name): Tweak a comment.
6098 2003-01-11 Bruno Haible <bruno@clisp.org>
6100 * same.c (same_name): Reorder tests so as to avoid calling stat()
6101 when a string comparison is sufficient.
6103 2003-01-11 Bruno Haible <bruno@clisp.org>
6105 * readtokens.c (readtoken): Cast character to 'unsigned char', not
6108 2003-01-11 Bruno Haible <bruno@clisp.org>
6110 * hash-pjw.c: Add comment about low quality of this function.
6112 2003-01-12 Paul Eggert <eggert@twinsun.com>
6114 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
6115 to avoid collisions with libcurses and libreadline.
6117 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
6118 * getstr.h, getstr.c: Remove.
6119 * getline.c: Include "getline.h", to check interface.
6120 Move body of old getstr.c here: this defines MIN_CHUNK and
6121 declares getdelim2, which is renamed from getstr.
6122 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
6124 * linebuffer.c (readlinebuffer): Renamed from readline.
6126 * linebuffer.h: Likewise.
6127 (readline): Remove backward-compatibility macro.
6129 2003-01-12 Jim Meyering <jim@meyering.net>
6131 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
6133 2003-01-10 Bruno Haible <bruno@clisp.org>
6135 * alloca_.h: New file.
6136 * getdate.y: Unconditionally include alloca.h.
6137 * makepath.c: Likewise.
6138 * setenv.c: Likewise.
6139 * userspec.c: Likewise.
6141 2003-01-09 Bruno Haible <bruno@clisp.org>
6143 * stdbool.h.in: New file.
6145 2003-01-08 Bruno Haible <bruno@clisp.org>
6147 * safe-read.c: Include specification header first, to ensure its
6149 * full-write.c: Likewise.
6151 2003-01-08 Jim Meyering <jim@meyering.net>
6153 * full-write.c: Undefine and define-away `const' after inclusion
6154 of errno.h, not before. Suggestion from Bruno Haible.
6156 2003-01-07 Jim Meyering <jim@meyering.net>
6158 * full-write.c: Rework so that it may serve to define full_read, too.
6159 * full-read.c: Simply #define FULL_READ and include full-write.c.
6161 2003-01-06 Jim Meyering <jim@meyering.net>
6163 * version-etc.c: Update year in translatable copyright string.
6165 2002-12-25 Bruno Haible <bruno@clisp.org>
6167 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
6168 * xstrtol.h: Likewise.
6169 * xstrtoimax.c: Likewise.
6170 * xstrtoumax.c: Likewise.
6171 * human.h: Likewise.
6173 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
6174 on systems that have <inttypes.h> but not <stdint.h>.
6176 2002-12-31 Paul Eggert <eggert@twinsun.com>
6178 * memcoll.c (memcoll): Fall back on a simple algorithm using
6179 memcmp if strcoll doesn't work.
6181 2002-12-23 Bruno Haible <bruno@clisp.org>
6183 * localcharset.h: New file.
6184 * localcharset.c: Include it.
6185 * unicodeio.c: Likewise.
6187 2002-12-22 Bruno Haible <bruno@clisp.org>
6189 * utime.c (utime_null): No need to call ftruncate if the file was
6192 2002-12-23 Bruno Haible <bruno@clisp.org>
6194 * memcoll.c (STRCOLL): New macro.
6197 2002-12-22 Bruno Haible <bruno@clisp.org>
6199 * getstr.h (getstr): Define, to avoid clash with libcurses.
6200 * linebuffer.h (readline): Define, to avoid clash with libreadline.
6202 2002-12-22 Bruno Haible <bruno@clisp.org>
6204 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
6206 2002-12-23 Bruno Haible <bruno@clisp.org>
6208 * getline.h: Include <stddef.h>, for size_t.
6210 * unicodeio.h: Include <stddef.h>, for size_t.
6211 * unicodeio.c: Don't include <stddef.h>.
6213 2002-12-17 Bruno Haible <bruno@clisp.org>
6215 * canon-host.c (strdup): Remove unused declaration.
6217 * fsusage.c: Include full_read.h.
6218 (get_fs_usage): Use full_read instead of safe_read.
6220 * utime.c (utime_null): Use SAFE_READ_ERROR.
6222 2002-12-11 Bruno Haible <bruno@clisp.org>
6224 * setenv.h: Rewritten to cope with systems that have setenv() but not
6226 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
6229 2002-12-11 Bruno Haible <bruno@clisp.org>
6231 * setenv.c (alloca): Fall back to malloc.
6233 (setenv): Use freea() to free memory allocated with alloca().
6235 2002-11-13 Bruno Haible <bruno@clisp.org>
6237 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
6238 function declarations.
6239 * unsetenv.c (unsetenv): Likewise.
6241 2002-03-04 Bruno Haible <bruno@clisp.org>
6243 Portability to AIX 4.3.3.
6244 * unsetenv.c: New file, extracted from setenv.c.
6245 * setenv.c: Move the unsetenv() function to unsetenv.c.
6247 2001-12-20 Bruno Haible <bruno@clisp.org>
6249 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
6250 use malloc instead. For SunOS 4.
6252 2001-12-11 Bruno Haible <bruno@clisp.org>
6254 * setenv.c: Declare alloca.
6255 (compar_fn_t): New typedef.
6256 (KNOWN_VALUE, STORE_VALUE): Use it.
6258 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
6261 2002-12-10 Paul Eggert <eggert@twinsun.com>
6263 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
6264 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
6265 Choose values that are less likely to collide with system fnmatch
6267 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
6268 defined (e.g., a pure POSIX system).
6269 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
6270 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
6272 2002-12-06 Jim Meyering <jim@meyering.net>
6274 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
6276 Merge in changes from libc's misc/error.c, in preparation
6277 for the merge of gnulib's changes back into libc.
6279 * error.c (_): Define only if not already defined.
6280 Move definition to follow all #include directives.
6281 Include unlocked-io.h only if !_LIBC.
6282 [_LIBC]: Include <libio/libioP.h>.
6283 [USE_IN_LIBIO]: Include <libio/iolibio.h>
6284 (fflush): Tweak definition to use INTUSE.
6287 2002-12-05 Paul Eggert <eggert@twinsun.com>
6289 * alloca.c [defined emacs]: Include "lisp.h".
6290 (xalloc_die) [defined emacs]: New macro.
6291 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
6292 [! defined emacs]: Include <xalloc.h>.
6293 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
6294 (pointer): Typedef to POINTER_TYPE *.
6295 (malloc): Remove decl; we now always use xmalloc.
6296 (alloca): Use old-style definition, since Emacs needs this.
6297 Check for arithmetic overflow when computing combined size.
6299 2002-12-04 Paul Eggert <eggert@twinsun.com>
6301 Do not generate unlocked-io.h automatically, since it's easier to
6302 maintain it by hand.
6304 * unlocked-io.h: New file, from GNU diffutils,
6305 but with proper copyright notice and attribution.
6307 * Makefile.am: Add copyright notice.
6308 (libfetish_a_SOURCES): Add unlocked-io.h.
6309 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
6310 (DISTCLEANFILES, io_functions): Remove macros.
6311 (EXTRA_DIST): Remove gen_uio.
6312 (unlocked-io.h): Remove rule.
6314 2002-12-04 Jim Meyering <jim@meyering.net>
6316 Reflect the fact that stat.c and lstat.c are no longer generated.
6317 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
6318 (DISTCLEANFILES): Likewise.
6319 (EXTRA_DIST): Likewise.
6320 (all_local): Don't depend on stat.c or lstat.c.
6321 (stat.c, lstat.c): Remove rules.
6322 (EXTRA_DIST): Remove xstat.in.
6324 * xstat.in: Remove file. Contents moved into stat.c.
6325 * stat.c: New file. Contents mostly from xstat.in.
6326 * stat.c: Rework so that it may serve to define rpl_lstat, too.
6327 * lstat.c: New file. Simply #define LSTAT and include stat.c.
6329 * safe-read.c: Rework so that it may serve to define safe_write, too.
6330 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
6332 2002-12-03 Jim Meyering <jim@meyering.net>
6334 * safe-read.c, safe-write.c: Change variable names and comments, but
6335 not semantics, to minimize the differences between these two files.
6336 (safe_read): Change comment to mention SAFE_READ_ERROR.
6338 * safe-read.c (IS_EINTR): Define.
6339 (safe_read): Use IS_EINTR in place of in-function cpp directives.
6341 2002-12-02 Bruno Haible <bruno@clisp.org>
6343 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
6344 Define, taken from safe-read.c.
6345 (INT_MAX): Provide fallback.
6346 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
6347 * safe-write.h (SAFE_WRITE_ERROR): Define.
6349 * safe-read.c (EINTR): Remove definition.
6350 (safe_read): Don't use EINTR if it is absent.
6352 2002-12-02 Jim Meyering <jim@meyering.net>
6354 * safe-read.c (EINTR): Define.
6355 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6356 (INT_MAX): Provide fallback.
6357 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6359 * safe-read.h (SAFE_READ_ERROR): Define.
6361 2002-12-01 Jim Meyering <jim@meyering.net>
6363 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
6364 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6366 2002-11-27 Paul Eggert <eggert@twinsun.com>
6368 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6369 hash_rehash): Replace `if (limit <= value) abort ();' with
6370 `if (! (value < limit)) abort ();', for readability.
6372 2002-11-26 <karl@gnu.org>
6374 * strdup.c: copy from libc again, with jim's ok.
6375 * .cppi-disable: re-add strdup.c
6377 2002-11-25 <karl@gnu.org>
6379 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
6380 instead of "strtol.c".
6382 2002-11-25 Jim Meyering <jim@meyering.net>
6384 * mktime.c: Sync from libc, now that it has the latest fix.
6386 2002-11-24 <karl@gnu.org>
6388 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
6389 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
6391 2002-11-24 Jim Meyering <jim@meyering.net>
6393 Update from coreutils:
6395 * mktime.c: Merge in changes from libc.
6397 Avoid a link-time failure on some Linux systems.
6398 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6399 (__mon_yday): Declare with the STATIC attribute.
6400 (__mktime_internal): Likewise.
6401 Based on a report from Greg Schafer.
6403 2002-11-23 Jim Meyering <jim@meyering.net>
6405 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
6406 Use `unsigned', not `int', as type of index.
6408 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
6410 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6412 2002-11-22 Paul Eggert <eggert@twinsun.com>
6414 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
6415 hint that one should use `if (! x) abort ();' rather than `assert
6416 (x);', and anyway it's one less thing to worry about configuring.
6417 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6418 hash_rehash, hash_insert): Use abort rather than assert.
6420 2002-11-22 Paul Eggert <eggert@twinsun.com>
6422 * quotearg.h: Allow multiple inclusion by surrounding with
6423 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
6424 so that we can be included first.
6425 (PARAMS): Remove; we now assume C89 or later. All uses removed.
6426 * quotearg.c: Include quotearg.h immediately after config.h.
6427 No need to include stddef.h or sys/types.h any more.
6428 Surround local include files with "", not "<>".
6429 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6430 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6431 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6432 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6433 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6434 (ISPRINT): Remove; no longer needed now that we assume C89.
6436 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6439 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6440 quotearg_char): Use SIZE_MAX rather than
6441 (size_t) -1 when we are talking about "infinity".
6443 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6445 2002-11-22 Bruno Haible <bruno@clisp.org>
6447 * safe-read.h: Assume C89. Add comments.
6448 (safe_read): Change return type to size_t.
6449 * safe-read.c (safe_read): Change return type to size_t. Handle byte
6450 counts > SSIZE_MAX correctly.
6451 * safe-write.h: New file.
6452 * safe-write.c: New file.
6453 * full-read.h: New file.
6454 * full-read.c: New file.
6455 * full-write.h: Assume C89. Add comments.
6456 * full-write.c: Include safe-write.h.
6457 (full_write): Rewritten to use safe_write.
6458 Suggested by Jim Meyering and Paul Eggert.
6460 2002-11-21 Bruno Haible <bruno@clisp.org>
6462 Remove case insensitive option matching.
6463 * argmatch.h (argcasematch): Remove declaration.
6464 (ARGCASEMATCH): Remove macro.
6465 (__xargmatch_internal): Remove case_sensitive argument.
6466 (XARGMATCH): Update.
6467 (XARGCASEMATCH): Remove macro.
6468 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6469 case_sensitive argument.
6470 (argcasematch): Remove function.
6471 (__xargmatch_internal): Remove case_sensitive argument.
6472 (main): Use XARGMATCH instead of XARGCASEMATCH.
6474 * xmalloc.c: Change compile-time error message. Add comment about
6475 required autoconf version.
6477 2002-11-21 Jim Meyering <jim@meyering.net>
6479 * strdup.c (strdup): Tweak comment and initial #if/#include.
6481 Merge in changes from the coreutils.
6483 2002-09-25 Paul Eggert <eggert@twinsun.com>
6484 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6485 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6486 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6487 int. Work more efficiently if X is the same width as uintmax_t.
6488 Do not compare X to -1, to avoid bogus compiler warning.
6489 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6490 Don't assume that f_frsize and f_bsize are the same type.
6492 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6495 * makepath.c (make_path): Restore umask *before* creating the final
6497 (make_path): Minor reformatting.
6499 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6500 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6502 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6503 ones. At least on GNU/Linux systems, `auto' means something else.
6506 2002-11-20 Paul Eggert <eggert@twinsun.com>
6508 Merge argmatch cleanups from Bison. Assume C89.
6510 * argmatch.c: Include config.h here, not in argmatch.h.
6511 Include stdlib.h, for EXIT_FAILURE.
6512 Always include <string.h>, since we assume C89.
6513 (EXIT_FAILURE): Remove pre-C89 bug workaround.
6514 * argmatch.h: Do not include <config.h> or <sys/types.h>.
6515 Include <stddef.h> instead, since it's all we need for size_t.
6516 (PARAMS): Remove. All uses removed.
6517 (ARRAY_CARDINALITY): Do not bother to #undef.
6518 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6519 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6520 Remove unnecessary parentheses.
6521 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6522 Insert necessary parentheses.
6523 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6524 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6526 2002-11-19 Bruno Haible <bruno@clisp.org>
6528 * mbswidth.c: Include mbswidth.h right at the beginning.
6529 * mbswidth.h: Include <stddef.h>, for size_t.
6531 * mbswidth.h (PARAMS): Remove macro.
6532 (mbswidth, mbsnwidth): Use ANSI C function declarations.
6533 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
6535 * gcd.h (PARAMS): Remove macro.
6536 (gcd): Use ANSI C function declarations.
6537 * gcd.c (gcd): Likewise.
6539 2002-11-15 Bruno Haible <bruno@clisp.org>
6541 * strcspn.c: Include <stddef.h>.
6542 (strcspn): Use ANSI C function declaration. Change return type to
6544 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
6545 (strpbrk): Use NULL.
6546 * strpbrk.h (PARAMS): Remove macro.
6547 (strpbrk): Use ANSI C function declaration.
6548 * strstr.c: Don't include <sys/types.h>.
6549 * strstr.h (PARAMS): Remove macro.
6550 (strstr): Use ANSI C function declarations.
6552 2002-11-06 Bruno Haible <bruno@clisp.org>
6554 * gcd.h (gcd): Change argument type to 'unsigned long'.
6555 * gcd.c (gcd): Likewise.
6557 2002-11-05 Bruno Haible <bruno@clisp.org>
6559 * gcd.h: New file, from gettext-0.11.5.
6560 * gcd.c: New file, from gettext-0.11.5.
6562 2002-11-05 Bruno Haible <bruno@clisp.org>
6564 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6565 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6566 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6567 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6569 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6570 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6572 * closeout.c: Include gettext.h instead of <libintl.h>.
6573 * human.c: Include gettext.h instead of <libintl.h>.
6574 * quotearg.c: Include gettext.h instead of <libintl.h>.
6575 * rpmatch.c: Include gettext.h instead of <libintl.h>.
6576 * unicodeio.c: Include gettext.h instead of <libintl.h>.
6577 * userspec.c: Include gettext.h instead of <libintl.h>.
6578 * version-etc.c: Include gettext.h instead of <libintl.h>.
6579 * xmalloc.c: Include gettext.h instead of <libintl.h>.
6580 (textdomain): Remove definition.
6581 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
6583 * long-options.c: Remove include of <libintl.h> and definition of _.
6584 * same.c: Remove include of <libintl.h> and definition of _.
6586 2002-11-04 Bruno Haible <bruno@clisp.org>
6588 * stpcpy.h: New file, from GNU gettext-0.11.5.
6589 * strcase.h: New file, from GNU gettext-0.11.5.
6590 * strpbrk.h: New file, from GNU gettext-0.11.5.
6591 * strstr.h: New file, from GNU gettext-0.11.5.
6592 * xgetcwd.h: New file, from GNU gettext-0.11.5.
6594 2002-05-09 Bruno Haible <bruno@clisp.org>
6596 * config.charset: Update for newest glibc. Add canonical names
6597 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6599 2002-05-09 Bruno Haible <bruno@clisp.org>
6601 * localcharset.c (get_charset_aliases): Add more Windows specific
6604 2002-05-08 Owen Taylor <otaylor@redhat.com>
6606 * config.charset: A few additions for Solaris.
6608 2001-12-05 Bruno Haible <bruno@clisp.org>
6610 * localcharset.c (locale_charset): Don't return an empty string.
6612 2001-10-23 Bruno Haible <haible@clisp.cons.org>
6614 * config.charset: msdos in uk_UA uses CP1125.
6616 2001-08-05 Bruno Haible <haible@clisp.cons.org>
6618 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6619 * localcharset.c (locale_charset): Declare as extern "C".
6621 2002-02-15 Bruno Haible <bruno@clisp.org>
6623 * config.charset [msdosdjgpp]: For Russian, use CP866.
6625 2002-02-11 Bruno Haible <bruno@clisp.org>
6627 * config.charset: Add support for NetBSD.
6629 2002-09-25 <karl@gnu.org>
6631 * strdup.c: copy from libc/string (via ../config/srclist*).
6632 * getopt*: copy from libc/posix.
6633 * gettext.h: copy from gettext.
6634 * .cppi-disable: add strdup.c, gettext.h.
6636 2002-07-01 Jim Meyering <meyering@lucent.com>
6638 * c-stack.c: Include sys/time.h.
6639 From Volker Borchert.
6641 2002-06-11 Paul Eggert <eggert@twinsun.com>
6643 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6644 New macro. Use it uniformly instead of
6645 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6646 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6647 reported by Vin Shelton.
6649 2002-06-22 Jim Meyering <meyering@lucent.com>
6651 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6652 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6654 2002-06-22 Paul Eggert <eggert@twinsun.com>
6656 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6657 Do not assume SA_SIGINFO behavior.
6658 Bug reported by Jim Meyering on NetBSD 1.5.2.
6660 2002-06-22 Jim Meyering <meyering@lucent.com>
6662 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6664 * exitfail.c, exitfail.h: Likewise.
6665 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6667 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6669 (EXTRA_DIST): Add fnmatch_loop.c.
6670 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6672 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6673 * fnmatch.c: Update from diffutils-2.8.2.
6674 * fnmatch_.h: New file. From diffutils-2.8.2.
6675 * fnmatch.h: Remove file.
6677 2002-06-18 Paul Eggert <eggert@twinsun.com>
6679 * file-type.h: Report an error if neither S_ISREG nor
6680 S_IFREG is defined, instead of using a test specific to glibc
6681 2.2. This should be safe, since POSIX requires S_ISREG and
6682 Unix Version 7 had S_IFREG. We don't need to check for
6683 <sys/types.h> since we don't use any symbols that it defines.
6685 2002-06-15 Jim Meyering <meyering@lucent.com>
6687 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6688 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6689 have been included before this file.
6691 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6693 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6694 so that each temporary file name is unique and valid in the first
6695 8 characters, for operation under DOS.
6697 2002-06-15 Jim Meyering <meyering@lucent.com>
6699 Work even with DJGPP 2.03, which lacks support for symlinks.
6701 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6703 * lchown.c (S_ISLNK): Likewise.
6705 2002-06-14 Jim Meyering <meyering@lucent.com>
6707 * file-type.h: Use the version from diffutils-2.8.2.
6708 * file-type.c: Likewise.
6710 2002-05-27 Jim Meyering <meyering@lucent.com>
6712 Fix a problem seen only on nonconforming systems whereby ls.c's
6713 use of localtime, and then of gettimeofday would cause trouble:
6714 the localtime call used to initialize rpl_gettimeofday's save
6715 mechanism would clobber ls's current local time information so
6716 that in any long listing the first file would always be listed
6717 with date 1970-01-01. Analysis by Volker Borchert.
6719 * gettimeofday.c (localtime): Undefine.
6720 (rpl_localtime): New function.
6722 2002-05-22 Jim Meyering <meyering@lucent.com>
6724 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6725 * file-type.h: New file.
6726 * file-type.c (file_type): New file/function. Extracted from diffutils.
6728 2002-04-29 Paul Eggert <eggert@twinsun.com>
6730 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6732 2002-04-28 Paul Eggert <eggert@twinsun.com>
6734 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6735 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6736 of 127, since 64 is the largest conceivable number for ancient
6738 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6740 2002-04-28 Jim Meyering <meyering@lucent.com>
6742 * sig2str.c (WTERMSIG): Remove definition (unused).
6744 2002-04-28 Paul Eggert <eggert@twinsun.com>
6746 * sig2str.h, sig2str.c: New files.
6747 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6749 2002-04-24 Jim Meyering <meyering@lucent.com>
6751 * gettext.h: New file, from Gettext.
6752 * Makefile.am (INCLUDES): Remove -I../intl.
6753 (libfetish_a_SOURCES): Add gettext.h.
6755 2002-04-16 Jim Meyering <meyering@lucent.com>
6757 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6758 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6759 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6761 2002-04-12 Jim Meyering <meyering@lucent.com>
6763 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6765 2002-03-10 Jim Meyering <meyering@lucent.com>
6767 * makepath.c (make_path): Remove a comma from a diagnostic.
6768 Suggestion from Santiago Vila.
6770 2002-03-08 Jim Meyering <meyering@lucent.com>
6772 * rename.c: Mention that this wrapper is needed also on
6773 mips-dec-ultrix4.4 systems.
6775 2002-03-02 Jim Meyering <meyering@lucent.com>
6777 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6778 not HAVE_CLOCK_SETTIME.
6780 2002-02-27 Paul Eggert <eggert@twinsun.com>
6782 * nanosleep.h: Rename to....
6783 * timespec.h: New name for nanosleep.h. All uses changed.
6785 * gettime.c: New file.
6786 * settime.c: New file.
6789 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6790 timespec.h. Remove nanosleep.h.
6792 2002-02-25 Paul Eggert <eggert@twinsun.com>
6794 * acl.c, acl.h: New files.
6795 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6797 2002-02-24 Jim Meyering <meyering@lucent.com>
6799 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6800 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6801 cause trouble. Reported by Nelson Beebe.
6803 2002-02-23 Paul Eggert <eggert@twinsun.com>
6805 * path-concat.c (xpath_concat): Reorder code to pacify
6806 compilers that don't know that xalloc_die never returns.
6808 2002-02-20 Jim Meyering <meyering@lucent.com>
6810 * getdate.c: Regenerate using bison-1.33.
6812 2002-02-15 Paul Eggert <eggert@twinsun.com>
6814 * posixver.c, posixver.h: New files.
6815 * Makefile.am (libfetish_a_SOURCES): Add them.
6817 2002-02-02 Paul Eggert <eggert@twinsun.com>
6818 Bruno Haible <bruno@clisp.org>
6820 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6821 (fwrite_success_callback): New declaration.
6822 * unicodeio.c (unicode_to_mb): New function, extracted from
6823 print_unicode_char. Call failure callback instead of error.
6824 (fwrite_success_callback): New function.
6825 (exit_failure_callback): New function.
6826 (fallback_failure_callback): New function.
6827 (print_unicode_char): Call unicode_to_mb.
6829 2002-01-26 Jim Meyering <meyering@lucent.com>
6831 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6833 2002-01-22 Jim Meyering <meyering@lucent.com>
6835 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6836 Otherwise, some versions of automake would omit the rule that makes
6837 Makefile from Makefile.in.
6839 2001-01-21 Paul Eggert <eggert@twinsun.com>
6841 * xmemcoll.h, xmemcoll.c: New files.
6842 * Makefile.am (libfetish_a_SOURCES): Add them.
6843 * memcoll.c: Include errno.h, and declare errno if not defined.
6844 (memcoll): Set errno to zero if there is no error.
6846 * quotearg.c (quotearg_buffer_restyled):
6847 Fix bug with quoting buffers containing NUL when backslashing escapes.
6848 This bug was exposed by the other changes in this patch.
6849 (quotearg_n_options): New arg ARGSIZE.
6850 All callers changed.
6851 (quoting_options_from_style): New function.
6852 (quotearg_n_style): Use it.
6853 (quotearg_n_style_mem): New function.
6855 * quotearg.h (quotearg_n_style_mem): New function.
6857 2002-01-16 Jim Meyering <meyering@lucent.com>
6859 * getdate.y: Add three semicolons, each just before a closing brace.
6860 Bison (as of version 1.31) no longer papers over that mistake.
6862 2002-02-14 Paul Eggert <eggert@twinsun.com>
6864 * backupfile.c (ISDIGIT): Comment fix.
6865 * getdate.y (ISDIGIT): Likewise.
6866 * posixtm.c (ISDIGIT, year): Likewise.
6867 * strverscmp.c (ISDIGIT): Likewise.
6868 * userspec.c (ISDIGIT): Likewise.
6870 2002-01-05 Jim Meyering <meyering@lucent.com>
6872 * version-etc.c (version_etc_copyright): Update copyright year.
6874 2001-01-19 Paul Eggert <eggert@twinsun.com>
6876 * closeout.c (close_stdout_status): If ferror (stdout), do
6877 not silently exit merely because the output buffer happens to
6878 have nothing pending.
6880 2001-12-18 Paul Eggert <eggert@twinsun.com>
6882 See the big note in ../ChangeLog.
6883 * human.c (suffixes): Prefer K to k for 1024.
6884 (generate_suffix_backwards): New function.
6885 (human_readable_inexact): Use it.
6886 * xstrtol.c (__xstrtol): If there is no number but there
6887 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
6888 Accept 'K' as well as 'k'.
6890 2001-12-15 Jim Meyering <meyering@lucent.com>
6892 * regex.h (__restrict_arr): Update from libc.
6894 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6895 as `remote' if the name starts with `//'. Suggested by Michael Stone.
6898 2001-12-10 Jim Meyering <meyering@lucent.com>
6900 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6901 Instead, include "xalloc.h".
6902 (initbuffer): Don't cast xmalloc return value to char*.
6903 (readline): Reword comment.
6904 Don't cast xrealloc return value to char*
6907 2001-12-09 Jim Meyering <meyering@lucent.com>
6909 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6910 `signed and unsigned type in conditional expression'.
6911 * posixtm.c (posix_time_parse): Likewise.
6913 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6915 * readtokens.c (readtoken): Declare an index to be of type unsigned
6916 to avoid a pedantic warning.
6918 * getstr.c: Don't include assert.h.
6919 (getstr): Remove warning-evoking assertions.
6920 Return -1 if offset parameter is out of bounds.
6921 Change the type of a local from int to size_t.
6923 * strftime.c (my_strftime_localtime_r): Include this function
6924 definition in the `#if ! HAVE_TM_GMTOFF' block.
6926 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6927 Include xalloc.h instead.
6929 2001-12-02 Jim Meyering <meyering@lucent.com>
6931 * tempname.c: Don't declare getenv, thus reverting the change of
6932 2001-11-18. It's no longer necessary, now that stdlib.h is always
6935 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6936 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
6938 2001-11-30 Akim Demaille <akim@epita.fr>
6940 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6941 before being defined.
6943 2001-11-27 Paul Eggert <eggert@twinsun.com>
6945 * quotearg.h (quotearg_n, quotearg_n_style):
6946 First arg is int, not unsigned.
6947 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6948 (SIZE_MAX, UINT_MAX): New macros.
6949 (quotearg_n_options): Abort if N is negative.
6950 Avoid overflow check on hosts where size_t is 64 bits and int
6951 is 32 bits, as overflow is impossible there.
6952 Fix off-by-one typo that caused unnecessary reallocation.
6954 2001-11-27 Jim Meyering <meyering@lucent.com>
6956 * tempname.c: Merge with version from libc.
6957 * regex.c: Likewise.
6959 * tempname.c: Include stdlib.h unconditionally. On some old systems
6960 for which STDC_HEADERS is 0, it was not included, resulting in a
6961 warning about an integer-to-pointer conversion problem with getenv.
6962 Reported by Volker Borchert.
6964 2001-11-26 Jim Meyering <meyering@lucent.com>
6966 * gtod.h: Remove file.
6967 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6968 * gettimeofday.c: Don't include gtod.h.
6969 (GTOD_init): Remove function.
6970 (rpl_gettimeofday): Do its job here instead, rather than aborting.
6971 Suggestion from Volker Borchert.
6973 2001-11-23 Jim Meyering <meyering@lucent.com>
6975 * hash.h (struct hash_table): Don't define here. Merely declare it.
6976 * hash.c (struct hash_table): Define it here instead.
6978 2001-11-22 Jim Meyering <meyering@lucent.com>
6980 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6982 2001-11-18 Paul Eggert <eggert@twinsun.com>
6984 * tempname.c (TMP_MAX): Remove; no longer needed.
6985 (TEMPORARIES): New macro.
6986 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
6987 removes an artificial limitation (e.g. HP-UX 10.20, where
6990 2001-11-18 Jim Meyering <meyering@lucent.com>
6992 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6995 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6996 files will be created before anything else.
6998 2001-11-17 Jim Meyering <meyering@lucent.com>
7000 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
7001 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
7002 rather than group writable. Patch by Juan F. Codagnone.
7004 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
7005 Instead, include "xalloc.h".
7007 * mountlist.c: Include unlocked-io.h after all system headers.
7008 Remove explicit declarations of xmalloc, xrealloc,
7009 and xstrdup. Instead, include "xalloc.h".
7011 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
7012 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
7013 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
7015 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
7016 Reported by Padraig Brady.
7018 * mkstemp.c: #undef mkstemp.
7020 (rpl_mkstemp): Rename from mkstemp.
7023 2001-11-16 Jim Meyering <meyering@lucent.com>
7025 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
7026 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
7027 determine the amount of total physical memory, use pstat_getstatic.
7028 HPUX-11 doesn't define _SC_PHYS_PAGES.
7029 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
7030 If sysconf couldn't be used to determine the amount of available
7031 physical memory, use both pstat_getstatic and pstat_getdynamic.
7032 Based on a patch from Bob Proulx.
7034 2001-11-05 Jim Meyering <meyering@lucent.com>
7036 * xstat.in (slash_aware_lstat): Correct a misleading comment.
7038 2001-11-03 Jim Meyering <meyering@lucent.com>
7040 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
7041 in argmatch_to_argument call.
7043 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
7046 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
7047 e.g., a fault due to an attempt to free a NULL pointer.
7049 2001-11-01 Jim Meyering <meyering@lucent.com>
7051 * dirfd.c, dirfd.h: New files.
7052 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
7054 * hash.c (hash_print) [TESTING]: Clean up.
7056 2001-10-22 Paul Eggert <eggert@twinsun.com>
7058 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
7059 to avoid a warning if -Wall.
7061 2001-10-21 Paul Eggert <eggert@twinsun.com>
7063 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
7065 2001-10-21 Jim Meyering <meyering@lucent.com>
7067 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
7068 this code would end up calling gettext even in packages built
7070 * getopt.c (_): Likewise.
7071 * regex.c (_): Likewise.
7073 2001-10-20 Paul Eggert <eggert@twinsun.com>
7075 * error.c (strerror_r): Do not declare unless !_LIBC.
7076 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
7077 Use strerror_r that is only a macro, even if it is not a function.
7078 (strerror): Check for HAVE_DECL_STRERROR before declaring.
7079 (private_strerror): Use prototypes, not old-style function definition.
7080 (print_errno_message): New function.
7081 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
7083 (error_tail, error, error_at_line): Use it.
7085 2001-10-11 Jim Meyering <meyering@lucent.com>
7087 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
7088 and quote_n (1, ... to avoid clobbering a buffer.
7090 2001-10-05 Jim Meyering <meyering@lucent.com>
7092 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
7093 * hash-pjw.c: New file (factored out of fileutils' remove.c).
7094 * hash-pjw.h: New file.
7096 2001-09-30 Jim Meyering <meyering@lucent.com>
7098 * mountlist.c [MOUNTED_GETFSSTAT]:
7099 Include <sys/ucred.h>, for Apple Darwin.
7100 Include sys/mount.h and sys/fs_types.h only if available.
7102 (read_filesystem_list): Use FS_TYPE.
7104 2001-09-29 Paul Eggert <eggert@twinsun.com>
7106 * exclude.c (excluded_filename): 0 -> false, since it's
7109 2001-09-28 Paul Eggert <eggert@twinsun.com>
7111 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
7112 #defines strtoimax. Also treat the other strto* functions
7115 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
7116 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
7117 (strtoimax, strtoumax): Do not declare if already defined as a macro.
7119 2001-09-26 Jim Meyering <meyering@lucent.com>
7121 Most macros in unlocked-io.h had the wrong number of arguments.
7122 * gen-uio: New script.
7123 (USE_UNLOCKED_IO): Define to 1 if not already defined.
7124 * unlocked-io.hin: Remove file.
7125 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
7126 rather than trying to embed it here.
7127 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
7128 Reported by Padraig Brady.
7130 2001-09-25 Volker Borchert <bt@teknon.de>
7132 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
7134 2001-09-23 Jim Meyering <meyering@lucent.com>
7136 * mountlist.c: Remove useless parentheses in #if directives.
7137 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
7138 the deprecated MOUNTED symbol is no longer defined in mntent.h.
7140 2001-09-22 Jim Meyering <meyering@lucent.com>
7142 * localcharset.c: Update from latest gettext.
7143 * config.charset: Likewise.
7145 2001-09-20 Jim Meyering <meyering@lucent.com>
7147 * xstrtol.c (strtoimax): Guard declaration with
7148 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
7149 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
7150 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
7151 (strtoumax): Likewise, for completeness (it wasn't necessary).
7153 2001-09-06 Paul Eggert <eggert@twinsun.com>
7155 * strtoimax.c (HAVE_LONG_LONG):
7156 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
7157 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
7158 to work around bug in IBM C compiler.
7160 2001-09-16 Jim Meyering <meyering@lucent.com>
7162 * mkdir.c: New file.
7164 2001-09-04 Paul Eggert <eggert@twinsun.com>
7166 * xgetcwd.c: Revert some of the previous change; intead,
7167 fix the HAVE_GETCWD_NULL code to behave more like the
7168 !HAVE_GETCWD_NULL code used to.
7171 (xgetcwd): Do not return NULL when memory is exhausted; instead,
7174 2001-09-04 Paul Eggert <eggert@twinsun.com>
7176 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
7177 Use ssize_t, not int, to store result of readlink.
7178 Check for ssize_t overflow as well as size_t overflow,
7179 as POSIX says the result of readlink is implementation-defined
7180 when ssize_t overflows.
7181 Remove unnecessary cast to char*.
7182 Use free+malloc instead of realloc, as the storage doesn't need
7183 to be preserved and it's clearer and can be more efficient that way.
7184 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
7185 * xreadlink.h (xreadlink): Update prototype.
7187 2001-09-03 Paul Eggert <eggert@twinsun.com>
7189 * exclude.c (fnmatch_no_wildcards): Fix confusion between
7190 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
7191 spotted by Jim Meyering.
7193 2001-09-03 Jim Meyering <meyering@lucent.com>
7195 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
7197 2001-09-03 Paul Eggert <eggert@twinsun.com>
7199 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
7200 like the HAVE_GETCWD_NULL code.
7201 Include pathmax.h if not HAVE_GETCWD.
7202 Do not include xalloc.h.
7203 (INITIAL_BUFFER_SIZE): New symbol.
7204 Do not use xmalloc / xrealloc, since the caller is responsible for
7205 handling errors. Preserve errno around `free' during failure.
7206 Do not overrun buffer when using getwd.
7208 2001-09-03 Paul Eggert <eggert@twinsun.com>
7210 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
7211 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
7213 2001-09-02 Jim Meyering <meyering@lucent.com>
7215 * error.c: Update from GNU libc.
7217 2001-09-01 Jim Meyering <meyering@lucent.com>
7219 * xreadlink.c: New file.
7220 * xreadlink.h: New file.
7221 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
7223 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
7224 doesn't conflict with sparc Solaris 7's definition in
7225 /usr/include/sys/int_types.h.
7227 * exclude.c: Use `""', not `<>' to #include non-system header files.
7228 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7229 and strncasecmp as r-values. Unixware didn't have declarations.
7231 2001-08-31 Jim Meyering <meyering@lucent.com>
7233 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7234 Use an initial, malloc'd, buffer of length 128 rather than
7235 a statically allocated one of length 1024.
7237 2001-08-30 Paul Eggert <eggert@twinsun.com>
7239 * xgetcwd.c: Don't include pathmax.h.
7240 Include stdlib.h and unistd.h if available.
7242 (xmalloc, xstrdup, free): Remove decls.
7243 (xgetcwd): Don't assume sizes fit in unsigned.
7244 Check for overflow when computing sizes.
7245 Simplify reallocation code.
7247 2001-08-28 Paul Eggert <eggert@twinsun.com>
7249 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
7251 * strtoimax.c: Renamed from strtoxmax.c, removing the
7254 Also, make the following further changes to make this file's
7255 configuration more similar to that of strtol.c:
7256 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
7257 (strtoumax, uintmax_t, strtoull, strtol): Remove.
7258 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7259 (strtoimax): Renamed from strtoumax. All uses of unsigned values
7260 changed to signed values.
7262 And make the following changes as well:
7263 Fix copyright notice, as 1999 was missing.
7264 (verify): New macro.
7265 (strtoimax): Check sizes at compile-time, not run-time.
7266 Prefer strtol to strtoll if both work.
7267 (main): Remove; it was not that useful and was a pain to maintain.
7269 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
7271 2001-08-30 Paul Eggert <eggert@twinsun.com>
7273 * savedir.c (savedir): Remove size parameter, as POSIX says that
7274 a directory's st_size can have an arbitrary value, so the old
7275 usage could waste an arbitrary amount of memory. All uses
7277 * savedir.h: Update prototype.
7279 2001-08-30 Paul Eggert <eggert@twinsun.com>
7281 * xstrtol.c (strtoimax): New decl.
7283 2001-08-28 Paul Eggert <eggert@twinsun.com>
7285 * xstrtol.h: Add copyright notice.
7286 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
7287 LONGINT_INVALID_SUFFIX_CHAR.
7289 2001-08-30 Paul Eggert <eggert@twinsun.com>
7291 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
7294 2001-08-30 Paul Eggert <eggert@twinsun.com>
7296 * hash.c: Remove '2001' from copyright notice.
7298 2001-08-30 Paul Eggert <eggert@twinsun.com>
7300 * full-write.h: New file.
7301 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
7302 * full-write.c: Correct credits, as cccp.c no longer
7303 exists and anyway it was so heavily changed from the old cccp
7304 code as to be unrecognizable. Include full-write.h.
7305 (full_write) Return size_t, with short writes meaning failure.
7306 All callers changed. This fixes a bug with large buffers
7308 * utime.c: Include full-write.h.
7310 2001-08-30 Paul Eggert <eggert@twinsun.com>
7312 Merge 'exclude' changes from tar 1.13.22.
7313 This fixes one or two unlikely storage allocation overflow bugs,
7314 but doesn't change user-visible behavior otherwise.
7316 2001-08-30 Paul Eggert <eggert@twinsun.com>
7318 * exclude.c (bool): Declare, perhaps by including stdbool.h.
7319 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7320 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7321 Include if available.
7322 (<xalloc.h>): Include
7323 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7324 (verify): New macro. Use it to verify that EXCLUDE macros do not
7325 collide with FNM macros.
7326 (struct patopts): New struct.
7327 (struct exclude): Use it, as exclude patterns now come with options.
7328 (new_exclude): Support above changes.
7329 (new_exclude, add_exclude_file):
7330 Initial size must now be a power of two to simplify overflow checking.
7331 (free_exclude, fnmatch_no_wildcards): New function.
7332 (excluded_filename): No longer requires options arg, as the options
7333 are determined by add_exclude. Now returns bool, not int.
7334 (excluded_filename, add_exclude):
7335 Add support for the fancy new exclusion options.
7336 (add_exclude, add_exclude_file): Now takes int options arg.
7337 Check for arithmetic overflow when computing sizes.
7338 (add_exclude_file): xrealloc might modify errno, so don't
7339 realloc until after errno might be used.
7341 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7343 (free_exclude): New decl.
7344 (add_exclude, add_exclude_file): Now takes int options arg.
7345 (excluded_filename): No longer requires options arg, as the options
7346 are determined by add_exclude. Now returns bool, not int.
7348 2001-08-30 Paul Eggert <eggert@twinsun.com>
7350 * alloca.c (alloca): Arg is of type size_t, not unsigned.
7352 2001-08-27 Jim Meyering <meyering@lucent.com>
7354 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7356 * version-etc.c (N_): Remove definition.
7357 Revert most of last change.
7358 Instead, simply don't mark the `Copyright...' string for translation.
7359 Based on advice from Paul Eggert.
7361 * strtoxmax.c: Tweak comment.
7363 2001-08-26 Jim Meyering <meyering@lucent.com>
7365 * version-etc.c (version_etc_copyright_fmt): Replace literal year
7366 of copyright with `%s' so translators don't get an untranslated
7368 (COPYRIGHT_YEAR): Define.
7369 (version_etc): Use fprintf rather than fputs.
7370 Suggestion from Ulrich Drepper.
7372 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7374 * strtoll.c: New file, from GNU libc.
7375 * xstrtoimax.c: New file.
7377 * xstrtol.h: Add xstrtoimax.
7378 * strtoumax.c: New file. Simply include "strtoumax.c".
7379 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
7381 * strtoumax.c: Factor to work both for unsigned and signed types, ...
7382 * strtoxmax.c: ... then renamed to this.
7384 2001-08-13 Paul Eggert <eggert@twinsun.com>
7386 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7387 Port to Solaris 8, where 'sed' requires a space after the 'r'
7388 command, and where sh dislikes "$/". Clean up the spacing a bit.
7389 Redirect output to $tmp just once.
7391 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
7393 * addext.c (<errno.h>): Include.
7394 (errno): Declare if not defined.
7395 (addext): Work correctly when pathconf returns -1 and leaves
7396 errno alone because there is no limit. Also, work even if
7397 pathconf returns a value greater than SIZE_MAX.
7399 2001-08-12 Jim Meyering <meyering@lucent.com>
7401 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7402 Simply `return getcwd (NULL, 0);'.
7403 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7404 Use 1300 as initial value for length, not PATH_MAX.
7406 * pathmax.h: Clean up cpp syntax.
7408 2001-08-12 Jim Meyering <meyering@lucent.com>
7410 * gettimeofday.c: New file.
7412 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7414 2001-08-04 Jim Meyering <meyering@lucent.com>
7416 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7417 to get in sync with glibc.
7419 2001-08-03 Paul Eggert <eggert@twinsun.com>
7421 The following changes are from gettext 0.10.39 as maintained by
7424 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7425 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7426 with inverted sense. All uses changed.
7428 * mbswidth.c: Don't include <limits.h>.
7429 Include <stdlib.h> and <string.h> unconditionally.
7430 (iswcntrl, mbsinit, ISCNTRL): New macros.
7431 (mbsnwidth): Use K&R style function declarations.
7432 Don't bother checking for MB_LEN_MAX == 1, since the compiler
7433 can optimize it when MB_CUR_MAX == 1.
7434 The width of control characters is zero, not 1.
7436 2001-07-15 Jim Meyering <meyering@lucent.com>
7438 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7439 (BUILT_SOURCES): Add unlocked-io.h.
7440 (io_functions): Define.
7441 (unlocked-io.h): New rule.
7442 (DISTCLEANFILES): Add unlocked-io.h.
7443 (all-local): Depend on unlocked-io.h, to ensure it is created.
7445 * unlocked-io.hin: New file
7447 * regex.c: Update from glibc.
7449 2001-07-05 Jim Meyering <meyering@lucent.com>
7451 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7453 (libfetish_a_SOURCES): Put all .h files here instead.
7454 Remove a thus-exposed (better checks in automake) duplicate and
7455 two unnecessary .h files.
7457 2001-06-11 Jim Meyering <meyering@lucent.com>
7459 * regex.c: Update from GNU libc.
7461 2001-05-27 Jim Meyering <meyering@lucent.com>
7463 * readutmp.h (UT_TYPE): Define.
7465 2001-05-24 Jim Meyering <meyering@lucent.com>
7467 * argmatch.c: Include "quote.h".
7468 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
7469 quote function. Reported by Göran Uddeborg.
7471 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
7473 * dirname.c (dir_name): Compute append_dot using path, not newpath
7474 which is not yet declared.
7476 2001-05-11 Paul Eggert <eggert@twinsun.com>
7478 * Makefile.am (libfetish_a_SOURCES):
7479 Add strftime.c, since we now compile it on all hosts.
7481 * strftime.c (my_strftime):
7482 Define to nstrftime if emacs, but only if my_strftime is not defined.
7483 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7484 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7485 Add one more extra argument: a nanoseconds value.
7488 (my_strftime function): Add %N format.
7489 (emacs_strftimeu): Renamed from emacs_strftime,
7490 with extra ut argument.
7492 2001-05-11 Paul Eggert <eggert@twinsun.com>
7494 dirname code cleanup. base_name now behaves more compatibly
7495 with POSIX basename when given file names that have trailing
7496 slashes, and similarly for dir_name. Add new primitives
7497 base_len and dir_len. Put the directory-name-related decls
7500 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7501 * backupfile.c (base_name): Likewise.
7502 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7503 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7504 * makepath.c (strip_trailing_slashes): Likewise.
7505 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7507 * rename.c (strip_trailing_slashes): Likewise.
7508 * same.c (base_name): Likewise.
7509 * stripslash.c (ISSLASH): Likewise.
7511 * addext.c: Include <dirname.h> after size_t is defined.
7512 * backupfile.c: Likewise.
7514 * addext.c (addext): Use base_len to trim redundant
7515 trailing slashes instead of doing it ourselves.
7516 But do not trim the last slash if it is not redundant.
7518 * backupfile.c (find_backup_file_name,
7519 max_backup_version): Use base_len instead of rolling it ourselves.
7520 Handle the case of "" and (on DOS) "C:" correctly.
7522 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7523 Include <string.h>, <dirname.h>.
7524 (base_name): Allow file names ending in slashes, other than names
7525 that are all slashes. In this case, return the basename followed
7526 by the slashes. This is more general, and can be used in places
7527 where the original base_name purposely had an assertion failure.
7528 (base_len): New function.
7530 * dirname.c: Include <string.h> instead of <stdlib.h>.
7531 Do not include <assert.h>; no longer needed.
7533 (memrchr): Remove decl.
7534 (dir_name_r): Remove.
7535 (dir_len): Renamed from dirlen. All callers changed.
7536 Rewrite in terms of base_name, for simplicity and consistency.
7537 (dir_name): Never return NULL. All callers changed.
7538 Do not include <stdlib.h> in test program; no longer needed.
7539 return 0; is fine for test program.
7541 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7543 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7545 * path-concat.c (path_concat): Use base_len to compute
7546 base length, not strlen; this means we cannot rely on memcpy
7549 * same.c (STREQ): Remove.
7550 (same_name): Handle the case where the basename ends in trailing '/'.
7552 * stripslash.c (strip_trailing_slashes): Return nonzero if
7553 a slash was stripped. Do not strip the last slash after a
7556 2001-04-08 Jim Meyering <meyering@lucent.com>
7558 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7559 recomputed; that's necessary when the offset spans a DST transition.
7560 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
7562 2001-04-02 Jim Meyering <meyering@lucent.com>
7564 * regex.h, regex.c: Update from GNU libc.
7566 2001-03-19 Paul Eggert <eggert@twinsun.com>
7568 * version-etc.c (version_etc_copyright): Update to 2001.
7570 2001-03-16 Paul Eggert <eggert@twinsun.com>
7572 * tempname.c (uint64_t): Define to uintmax_t if
7573 not defined, and if UINT64_MAX is not defined.
7574 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7575 Reported by John David Anglin.
7577 2001-03-10 Bruno Haible <haible@clisp.cons.org>
7579 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7580 alias if codeset is empty.
7581 * config.charset (BeOS): Use wildcard syntax.
7583 2001-03-13 Jim Meyering <meyering@lucent.com>
7585 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7586 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7589 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7591 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7593 * unicodeio.c (print_unicode_char): Simplify accordingly.
7595 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7597 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7598 support for DOS/DJGPP.
7600 2001-02-28 Paul Eggert <eggert@twinsun.com>
7602 * Makefile.am (libfetish_a_SOURCES):
7603 Add dup-safer.c, fopen-safer.c.
7604 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7606 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7608 2001-02-25 Paul Eggert <eggert@twinsun.com>
7610 The mkstemp replacement is taken from glibc 2.2.2, with some
7611 portability fixes for use outside glibc, as follows:
7613 * tempname.c (struct_stat64): New macro.
7614 (direxists, __gen_tempname): Use it.
7615 This avoids a portability problem with Solaris 8.
7617 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7618 (<stddef.h>, <stdint.h>, <string.h>):
7619 Include only if STDC_HEADERS || _LIBC.
7620 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7621 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7622 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7623 (__set_errno): Define this macro if <errno.h> doesn't.
7624 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7625 Define these macros if <stdio.h> doesn't.
7626 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7627 Define these macros if <sys/stat.h>
7628 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7629 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7630 __xstat64): Define if not _LIBC.
7631 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7632 (__gen_tempname): Invoke gettimeofday only if
7633 HAVE_GETTIMEOFDAY || _LIBC;
7634 otherwise, fall back on plain "time".
7635 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7637 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7639 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7641 2001-02-17 Jim Meyering <meyering@lucent.com>
7643 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7644 around included file name.
7646 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7648 * strftime.c: Update from GNU libc (the only changes were to comments).
7650 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7652 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7654 2001-02-17 Paul Eggert <eggert@twinsun.com>
7656 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7657 Remove workaround macros for hosts that have mbrtowc but not
7658 mbstate_t, as we now insist on proper declarations for both
7659 before using mbrtowc.
7661 2001-02-17 Jim Meyering <meyering@lucent.com>
7663 * regex.c: Update from libc.
7665 2001-02-16 Paul Eggert <eggert@twinsun.com>
7667 * alloca.c (malloc): Undef before defining, since stdlib.h
7668 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7669 Reported by Mark Hounschell via Paul Eggert.
7671 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7673 * config.charset: Update for FreeBSD 4.2.
7675 2001-01-26 Jim Meyering <meyering@lucent.com>
7677 * quotearg.c: Include stddef.h.
7678 * quote.c: Include stddef.h.
7679 Reported by Axel Kittenberger.
7681 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7682 line in double quotes so that it evokes a better diagnostic.
7683 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7684 Reported by Axel Kittenberger.
7686 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7688 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7689 to avoid a warning. Add back 'const' to inptr.
7691 2001-01-16 Jim Meyering <meyering@lucent.com>
7693 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7696 2001-01-14 Jim Meyering <meyering@lucent.com>
7698 * rename.c: New file. From Volker Borchert.
7699 Include stdlib.h, string.h or strings.h, and xalloc.h.
7700 Use strip_trailing_slashes rather than open-coding it.
7702 2001-01-03 Paul Eggert <eggert@twinsun.com>
7704 * strftime.c: Sync with glibc time/strftime.c 1.81.
7706 2001-01-03 Jim Meyering <meyering@lucent.com>
7708 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7709 local `inptr' to avoid warning with some system declarations of iconv.
7711 2000-12-29 Paul Eggert <eggert@twinsun.com>
7713 * modechange.c: Do not assume that mode_t uses the
7714 traditional octal encoding. E.g. "chmod 1 FOO" should set
7715 the other-execute bit of FOO even if S_IXOTH != 1.
7717 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7718 WOTH, XOTH, ALLM): New macros.
7719 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7720 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7722 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7723 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7725 No need to use uintmax_t; unsigned long is long enough.
7726 Don't bother to get suffix since we don't use it.
7728 2000-12-24 Jim Meyering <meyering@lucent.com>
7730 * hash.c (is_prime): Return explicit boolean values.
7731 (hash_get_first): Return NULL to appease Irix5.6's 89.
7732 Reported by Nelson Beebe.
7734 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7736 * localcharset.c (locale_charset): Add support for Win32.
7738 2000-12-18 Paul Eggert <eggert@twinsun.com>
7740 * physmem.h, physmem.c: New files.
7742 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7743 (noinst_HEADERS): Add physmem.h.
7745 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7746 't' for compatibility with Solaris 8 sort.
7748 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7750 * config.charset: Add support for BeOS.
7752 2000-12-16 Jim Meyering <meyering@lucent.com>
7754 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7755 SHELLS_FILE to a file name that's useful on djgpp systems.
7757 (ADDITIONAL_DEFAULT_SHELLS): Define.
7758 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7759 Based mostly on a patch from Prashant TR.
7761 2000-12-16 Jim Meyering <meyering@lucent.com>
7763 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7764 N and M) would have treated it like `chown N:N FILE'.
7766 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7768 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7770 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7771 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7772 to the list of canonical encodings. Rename EUC-CN to GB2312.
7774 2000-12-08 Andreas Schwab <schwab@suse.de>
7776 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7777 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7779 2000-12-07 Jim Meyering <meyering@lucent.com>
7781 * stripslash.c (ISSLASH): Define.
7782 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7785 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7786 (dir_name_r): Declare this function as static.
7787 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7788 manifest itself on a name containing a mix of slashes and
7790 Make this function work with names starting with a DOS-style
7791 drive letter and colon prefix.
7792 (dir_name): Append `.' if necessary.
7793 Based mostly on patches from Prashant TR and Eli Zaretskii.
7795 * dirname.h (dir_name_r): Remove prototype.
7797 2000-12-05 Jim Meyering <meyering@lucent.com>
7799 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7801 2000-12-04 Jim Meyering <meyering@lucent.com>
7803 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7804 Also include memory.h, stdlib.h, unistd.h if appropriate.
7805 Reported by Andreas Jaeger (conflicting declaration of malloc).
7807 2000-12-02 Jim Meyering <meyering@lucent.com>
7809 * closeout.h: Make idempotent, to avoid some obscure warnings.
7811 2000-12-01 Paul Eggert <eggert@twinsun.com>
7813 * memrchr.c: Include <config.h> before any system include file.
7815 2000-11-29 Paul Eggert <eggert@twinsun.com>
7817 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7819 2000-11-26 Jim Meyering <meyering@lucent.com>
7821 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7823 2000-11-22 Paul Eggert <eggert@twinsun.com>
7825 * strftime.c (my_strftime): Do not invoke mbrlen with a
7826 size of (size_t) -1; it's not portable.
7828 2000-11-17 Akim Demaille <akim@epita.fr>
7830 * obstack.h: Formatting changes.
7831 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7832 prevent type checking.
7833 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7834 cast the value to (void *): assigning a `foo *' to a `void *'
7836 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7838 2000-11-17 Jim Meyering <meyering@lucent.com>
7840 * strstr.c: Update from GNU libc.
7842 2000-11-16 Jim Meyering <meyering@lucent.com>
7844 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7846 2000-11-11 Jim Meyering <meyering@lucent.com>
7848 * error.c: Add a couple #includes, merging from GNU libc version.
7850 2000-11-10 Jim Meyering <meyering@lucent.com>
7852 * obstack.h: Update from GNU libc.
7853 * obstack.c: Likewise.
7855 2000-11-06 Paul Eggert <eggert@twinsun.com>
7857 * getusershell.c (setusershell): Use rewind rather than
7858 fseek/fseeko, to avoid configuration hassles with fseeko.
7859 Don't bother opening SHELLS_FILE if shellstream is NULL;
7862 2000-11-05 Jim Meyering <meyering@lucent.com>
7864 * makepath.h (make_dir): Declare.
7865 * makepath.c (make_dir): Remove `static' attribute.
7868 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7870 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7871 last one in a bucket, advance to the next bucket.
7873 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
7875 * fnmatch.c: Do not comment out all the code if we are using
7876 the GNU C library, because in some cases we are replacing buggy
7877 code in the GNU C library itself.
7879 2000-10-30 Paul Eggert <eggert@twinsun.com>
7881 * error.h, getline.h, modechange.h:
7882 Remove "2000" from Copyright line, as the file hasn't been
7883 changed this year other than in the copyright notice.
7885 * xalloc.h: Add "2000" to Copyright line, as this file
7886 was changed this year.
7888 2000-10-30 Paul Eggert <eggert@twinsun.com>
7890 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7891 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7892 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7894 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
7896 * regex.h (__restrict_arr): Move definition out of #ifndef block.
7897 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7898 doesn't define __restrict_arr.
7900 2000-10-29 Jim Meyering <meyering@lucent.com>
7902 * xstat.in: Fix grammar in comment.
7904 2000-10-28 Jim Meyering <meyering@lucent.com>
7906 * memchr.c: Update from libc.
7907 Adjust for portability:
7908 [HAVE_STDLIB_H]: Include stdlib.h.
7909 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7910 Undef __memchr, too.
7911 [!weak_alias]: Define __memchr to memchr.
7913 * regex.c: Update from libc.
7914 * regex.h: Likewise.
7915 * getopt1.c: Likewise.
7916 * memcmp.c: Likewise.
7918 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7919 Avoid using fseek, when possible -- it's broken by design.
7920 Patch by Ulrich Drepper.
7922 2000-10-26 Jim Meyering <meyering@lucent.com>
7924 * strftime.c: Update from libc.
7926 2000-10-25 Jim Meyering <meyering@lucent.com>
7928 * obstack.c: Update from libc.
7930 2000-10-23 Jim Meyering <meyering@lucent.com>
7932 * hard-locale.c (hard_locale): Revert last change -- it was simply
7933 wrong. That set_locale call must not have any side effects.
7936 2000-10-22 Jim Meyering <meyering@lucent.com>
7938 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7939 [CYCLIC]: Remove now-unused definition.
7941 * save-cwd.c (O_DIRECTORY): Define, if needed.
7942 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7943 Suggestion from Ulrich Drepper.
7945 2000-10-21 Jim Meyering <meyering@lucent.com>
7947 * dirname.c (dir_name_r): New function, factored out of dir_name.
7948 (dir_name): Use dir_name_r.
7949 * dirname.h (dir_name_r): Declare it.
7951 2000-10-21 Jim Meyering <meyering@lucent.com>
7953 * dirname.c (memrchr): Declare if necessary.
7954 (dir_name): Remove the restriction that there be no
7955 trailing slashes. Now, this code skips past them, effectively
7957 [TEST_DIRNAME] (main): New unit tests.
7959 * memrchr.c: New file from GNU libc.
7960 Undef __memrchr, too.
7961 [!weak_alias]: Define __memrchr to memrchr.
7962 Guard weak_alias use with `#ifdef weak_alias'.
7964 2000-10-17 Jim Meyering <meyering@lucent.com>
7966 * quote.h (PARAMS): Define and use.
7967 Reported by Akim Demaille.
7969 * getopt.c: Update from libc.
7971 2000-10-16 Jim Meyering <meyering@lucent.com>
7973 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7976 2000-09-25 Jim Meyering <meyering@lucent.com>
7978 * md5.h (rol): Define (from GnuPG).
7980 * sha.c: Give credit (GnuPG) where due.
7981 (M): Use rol rather than open-coding it.
7982 Add a FIXME comment.
7984 2000-09-21 Jim Meyering <meyering@lucent.com>
7986 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7987 Reported by Michael Stone.
7989 2000-09-20 Jim Meyering <meyering@lucent.com>
7991 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7992 (noinst_HEADERS): Add sha.h.
7993 Based on code from Scott G. Miller and from GnuPG.
7995 2000-09-15 Jim Meyering <meyering@lucent.com>
7997 * regex.c: Update from libc.
7999 2000-09-10 Jim Meyering <meyering@lucent.com>
8001 * getopt.c (_getopt_internal): Update from glibc.
8003 2000-09-09 Jim Meyering <meyering@lucent.com>
8005 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
8006 think it should be used as a general replacement for isascii.
8007 * fnmatch.c: Likewise.
8008 * mbswidth.c: Likewise
8009 * regex.c: Likewise.
8012 * userspec.c: Include sys/param.h and limits.h.
8014 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8015 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
8016 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
8017 UID, GID. Check range.
8019 2000-09-06 Jim Meyering <meyering@lucent.com>
8021 * getopt.c (_getopt_internal): Update from glibc.
8023 2000-08-30 Jim Meyering <meyering@lucent.com>
8025 * strftime.c: Merge in changes from GNU libc.
8027 2000-08-26 Jim Meyering <meyering@lucent.com>
8029 * closeout.c: Include "__fpending.h".
8030 (close_stdout_status): Return right away if there's nothing to flush.
8032 * Makefile.am (noinst_HEADERS): Add __fpending.h.
8033 * __fpending.c: New file.
8034 * __fpending.h: New file.
8036 2000-08-07 Paul Eggert <eggert@twinsun.com>
8038 Standardize on "memory exhausted" instead of "Memory exhausted"
8039 or "virtual memory exhausted".
8040 * obstack.c (print_and_abort): Use "memory exhausted", not
8041 "virtual memory exhausted".
8042 * same.c (same_name): Invoke xalloc_die instead of printing
8044 * userspec.c (parse_user_spec): Likewise.
8045 * bumpalloc.h: comment fix
8046 * same.c, userspec.c: Include xalloc.h.
8048 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
8049 not char *const and pointing to a constant array.
8050 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
8051 (xrealloc): Comment fix.
8053 * userspec.c (parse_user_spec):
8054 Don't translate a message until just before returning,
8055 to avoid unnecessary translation.
8057 2000-08-07 Jim Meyering <meyering@lucent.com>
8059 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
8060 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
8061 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
8062 getgroups.c, gethostname.c, getopt.h, group-member.c,
8063 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
8064 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
8065 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
8066 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
8067 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
8068 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
8069 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
8070 yesno.c: Back out Copyright date changes for each file with no change
8071 this year. This eases coordination with other programs using the same
8072 source code modules. From Paul Eggert.
8074 2000-08-03 Greg McGary <greg@mcgary.org>
8076 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
8077 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
8078 (EXTEND_BUFFER): Use them.
8080 2000-08-01 Jim Meyering <meyering@lucent.com>
8082 * dirname.c (ISSLASH): Define.
8083 (BACKSLASH_IS_PATH_SEPARATOR): Define.
8084 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
8085 both `\' and `/' may be use as path separators.
8086 Based on a patch from Prashant TR.
8088 2000-07-31 Paul Eggert <eggert@twinsun.com>
8090 * quotearg.c (quotearg_n_options): Don't make the initial
8091 slot vector a constant, since it might get modified.
8093 2000-07-31 Jim Meyering <meyering@lucent.com>
8095 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
8096 * obstack.c (print_and_abort): Likewise.
8098 2000-07-30 Paul Eggert <eggert@twinsun.com>
8100 * quotearg.c (quotearg_n_options): Preallocate a slot 0
8101 buffer, so that the caller can always quote one small
8102 component of a "memory exhausted" message in slot 0.
8103 From a suggestion by Jim Meyering.
8105 2000-07-30 Jim Meyering <meyering@lucent.com>
8107 * makepath.c (make_path): Quote the other instance, too.
8109 * quotearg.c (N_STATIC_SLOTVECS): Define.
8110 (STATIC_BUF_SIZE): Define.
8111 (quotearg_n_options): Use only statically allocated storage when
8112 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
8113 than STATIC_BUF_SIZE.
8115 2000-07-29 Jim Meyering <meyering@lucent.com>
8117 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
8118 * dirname.c (dir_name): Likewise.
8120 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
8122 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
8123 (dir_name): Assert that there are no trailing slashes.
8125 2000-07-18 Bruno Haible <haible@clisp.cons.org>
8127 * mbswidth.h (mbswidth): Add a flags argument.
8128 (mbswidth): New declaration.
8129 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
8130 * mbswidth.c (mbswidth): Add a flags argument.
8131 (mbsnwidth): New function.
8133 2000-07-24 Jim Meyering <meyering@lucent.com>
8135 * mbswidth.c: Remove useless #else. From Bruno Haible.
8137 2000-07-23 Paul Eggert <eggert@twinsun.com>
8139 * mbswidth.c (_XOPEN_SOURCE):
8140 Don't define; this causes problems on Solaris 7.
8141 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
8143 2000-07-23 Paul Eggert <eggert@twinsun.com>
8146 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
8147 so that mbstate_t is always defined.
8149 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
8150 be 1 in at least one GCC installation, and this configuration
8151 error is likely to be common. Ignoring MB_LEN_MAX hurts
8152 performance on hosts that have mbrtowc but have only unibyte
8153 locales, but I assume these hosts are rare.
8155 2000-07-23 Paul Eggert <eggert@twinsun.com>
8157 * quotearg.c: Streamline by invoking multibyte code only if needed.
8158 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
8159 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
8160 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
8161 invoke multibyte primitives.
8163 2000-07-23 Jim Meyering <meyering@lucent.com>
8165 * basename.c (base_name): Add an assertion.
8167 2000-07-15 Bruno Haible <clisp.cons.org>
8169 * quotearg.c: When the system forces us to redefine mbstate_t,
8170 shadow its mbsinit function.
8172 2000-07-16 Bruno Haible <haible@clisp.cons.org>
8174 * mbswidth.h: New file.
8175 * mbswidth.c: New file.
8176 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
8177 (noinst_HEADERS): Add mbswidth.h.
8179 2000-07-17 Bruno Haible <haible@clisp.cons.org>
8181 * config.charset: Add support for FreeBSD. Improve support for HP-UX
8184 2000-07-15 Jim Meyering <meyering@lucent.com>
8186 * makepath.c: Include quote.h.
8187 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
8188 corresponding argument in a `quote (...)' call.
8189 Give better diagnostics.
8191 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
8192 (noinst_HEADERS): Add quote.h.
8194 * quote.c (quote, quote_n): New file. Two functions taken verbatim
8195 from tar's src/misc.c.
8196 * quote.h: New file. Prototypes for same.
8198 2000-07-10 Paul Eggert <eggert@twinsun.com>
8200 From a suggestion by Bruno Haible.
8201 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
8202 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
8203 to decide whether to define the BeOS workaround macro;
8204 this adjusts to the change to AC_MBSTATE_T.
8206 2000-07-13 Paul Eggert <eggert@twinsun.com>
8208 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
8210 * quotearg.c (quoting_style_args, quoting_style_vals,
8211 quotearg_buffer_restyled): Add support for
8212 clocale_quoting_style. Undo previous change to
8213 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
8214 and "{RIGHT QUOTATION MARK}" msgids.
8216 2000-07-05 Paul Eggert <eggert@twinsun.com>
8218 The old behavior of quoting `like this' doesn't look good with
8219 newer, ISO-style fonts. See:
8220 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
8222 Instead, quote "like this" by default. Let the translator
8223 tailor the locale-specific quoting behavior by providing
8224 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
8226 * quotearg.c (N_): New macro.
8227 (gettext_default): New function.
8228 (quotearg_buffer_restyled): Use
8229 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
8230 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
8232 2000-07-09 Jim Meyering <meyering@lucent.com>
8234 * Most files: Update copyright dates to include 2000.
8236 2000-07-08 Jim Meyering <meyering@lucent.com>
8238 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
8240 (xgethostname): Remove now-unnecessary #ifdef.
8241 Move declaration of `err' into loop where it's used.
8243 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8245 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
8246 by allocating a larger buffer. Test the gethostname return value for
8247 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
8248 returns an error and ENAMETOOLONG isn't defined.
8250 2000-07-05 Paul Eggert <eggert@twinsun.com>
8251 and Bruno Haible <haible@clisp.cons.org>
8253 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8255 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8257 * quotearg.c (struct quoting_options): Simplify quote_these_too
8260 2000-07-03 Jim Meyering <meyering@lucent.com>
8262 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
8263 Reported by Bruno Haible.
8265 2000-07-04 Jim Meyering <meyering@lucent.com>
8267 * quotearg.c: Make inclusion of <wchar.h> independent of whether
8268 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
8271 2000-07-03 Paul Eggert <eggert@twinsun.com>
8272 and Bruno Haible <haible@clisp.cons.org>
8274 * quotearg.c (mbrtowc):
8275 Assign to *pwc, and return 1 only if result is nonzero.
8276 (iswprint): Use ISPRINT when substituting our own mbrtowc.
8278 2000-07-03 Jim Meyering <meyering@lucent.com>
8280 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
8281 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
8284 2000-07-02 Jim Meyering <meyering@lucent.com>
8286 * quotearg.c (mbstate_t): Don't define here.
8288 2000-07-02 Jim Meyering <meyering@lucent.com>
8290 * nanosleep.c (SIGCONT): Define if not already defined.
8292 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8294 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
8295 per change in ../m4/ls-mntd-fs.m4.
8296 (read_filesystem_list): Ignore symbolic links.
8298 2000-06-29 Jim Meyering <meyering@lucent.com>
8300 * same.c: Include <string.h> or <strings.h>, as appropriate,
8301 for declaration of strcmp.
8303 * long-options.c: Include <stdlib.h>, for declaration of exit.
8305 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
8306 Avoid warning by casting result to `char *' to remove `const'.
8308 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8310 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
8312 2000-06-26 Paul Eggert <eggert@twinsun.com>
8314 savedir now sets errno on failure and invokes xmalloc to get memory.
8315 Fix a couple of other minor bugs while we're at it.
8317 * savedir.c (<unistd.h>): Do not include; there's no need.
8318 (NAMLEN): Remove macro.
8319 (malloc, realloc): Remove decls.
8321 ("xalloc.h"): Include.
8322 (NAME_SIZE_DEFAULT): New macro.
8323 (savedir): Use xmalloc / xrealloc to allocate memory.
8324 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
8325 Skip "" directory entries.
8326 Use strlen to calculate directory entry length, since the old method
8327 is rarely used these days and isn't worth supporting.
8328 Don't use a pointer after freeing it.
8329 Check for integer overflow when calculating allocation size.
8330 Use memcpy to copy entries, instead of stpcpy.
8331 Set errno properly when returning NULL.
8332 Check for readdir error.
8334 2000-06-26 Jim Meyering <meyering@lucent.com>
8336 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
8338 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8340 * getusershell.c (xmalloc, xrealloc): Remove functions.
8342 Don't include <stdlib.h>. Don't declare malloc, realloc.
8344 2000-06-23 Bruno Haible <haible@clisp.cons.org>
8346 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
8348 2000-06-24 Jim Meyering <meyering@lucent.com>
8350 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
8352 2000-06-21 Jim Meyering <meyering@lucent.com>
8354 * getpass.c: New file, from Bruno Haible. Required for BeOS.
8356 2000-06-19 Paul Eggert <eggert@twinsun.com>
8358 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8359 (mbrtowc, mbstate_t): Define substitutes if
8360 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8361 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8362 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8364 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8366 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8367 than 1024, return a memory chunk of least possible size, instead
8368 of size PATH_MAX + 2. In the loop, increment the size proportionally.
8369 Use free/xmalloc instead of xrealloc to avoid copying for very long
8372 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8374 * canon-host.c (canon_host): Use malloc and memcpy to copy an
8375 address, not strdup. Include <stdlib.h> and don't declare free().
8377 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8379 * path-concat.c (path_concat): Don't access dir[-1] if dir is
8382 2000-06-21 Jim Meyering <meyering@lucent.com>
8384 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8385 (noinst_HEADERS): Add getstr.h.
8387 * getline.c (getstr): Move into a separate file.
8388 * getstr.c (getstr): New file, extracted from getline.c, with
8389 the following changes: new parameter, delim2; both delim[12]
8390 parameters have type `int', not `char'. The latter would lose
8391 with 8-bit delimiters.
8392 * getstr.h: New file.
8394 2000-06-19 Jim Meyering <meyering@lucent.com>
8396 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8398 2000-06-18 Jim Meyering <meyering@lucent.com>
8400 * mkdir.c: Remove file, due mainly to copyright incompatibility.
8401 Besides, these days every porting target provides a mkdir function.
8403 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8404 (this snippet comes from src/system.h).
8406 2000-06-15 Paul Eggert <eggert@twinsun.com>
8408 * human.c (adjust_value): New function.
8409 (human_readable_inexact): Apply rounding style even when
8410 printing approximate values.
8412 2000-06-14 Paul Eggert <eggert@twinsun.com>
8414 * human.c (human_readable_inexact): Allow an input block
8415 size that is not a multiple of the output block size, and vice versa.
8416 Reported by Piergiorgio Sartor.
8418 2000-06-14 Paul Eggert <eggert@twinsun.com>
8420 * getdate.y (get_date): Apply relative times after time
8421 zone indicator, not before. Reported by Todd A. Jacobs.
8423 2000-06-13 Jim Meyering <meyering@lucent.com>
8425 * Makefile.am (all-local): Depend on lstat.c and stat.c.
8427 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8429 2000-06-12 Paul Eggert <eggert@twinsun.com>
8431 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8433 2000-06-04 Paul Eggert <eggert@twinsun.com>
8435 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8437 2000-06-04 Jim Meyering <meyering@lucent.com>
8439 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8440 SunOS 4.1.4 for which gid_t is an unsigned type.
8442 2000-06-03 Jim Meyering <meyering@lucent.com>
8444 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8446 2000-05-26 Bruno Haible <haible@clisp.cons.org>
8448 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8449 newer, don't install charset.alias.
8450 * config.charset: Change the Linux/glibc rules so they become empty
8451 on glibc-2.1 or newer.
8453 2000-06-02 Jim Meyering <meyering@lucent.com>
8455 * mountlist.c: Back out last change. Instead, do this...
8456 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8457 member using the same `ignore'-testing code.
8458 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8462 2000-05-29 Jim Meyering <meyering@lucent.com>
8464 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8465 with the `ignore' attribute. Based on a patch from Mark D. Roth.
8467 2000-05-22 Jim Meyering <meyering@lucent.com>
8469 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8471 2000-05-18 Jim Meyering <meyering@lucent.com>
8473 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8474 back, too, since it may have been modified by allocate_entry.
8475 (hash_delete): Rewrite to use neither the assignment operator
8476 nor the comma operator in an if-expression.
8478 2000-05-15 Paul Eggert <eggert@twinsun.com>
8481 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8482 Remove; no longer needed.
8483 "quotearg.h": Add include.
8484 (file_name): Do not bother to explicitly initialize to NULL; it's less
8485 efficient on some hosts.
8486 (close_stdout_status): Remove test as to whether stdout was already
8487 closed; it breaks for the case "echo x | sort >&-".
8488 Quote file name colons.
8489 Do not assume that _("write error") lacks format strings.
8491 2000-05-15 Jim Meyering <meyering@lucent.com>
8493 * version-etc.c (version_etc_copyright): Update the copyright string
8494 used in all --version output.
8496 2000-05-14 Jim Meyering <meyering@lucent.com>
8498 * closeout.c (close_stdout_set_file_name): New function.
8499 (close_stdout_status): Use new file-scoped global.
8500 Return right away if fstat says the stdout file descriptor is invalid.
8501 * closeout.h (close_stdout_set_file_name): Declare.
8503 2000-05-10 Jim Meyering <meyering@lucent.com>
8505 * closeout.c [default_exit_status]: New file-scoped variable.
8506 (close_stdout_set_status): New function.
8507 * closeout.h (close_stdout_set_status): Declare.
8509 2000-05-08 Jim Meyering <meyering@lucent.com>
8511 * long-options.c: Don't include closeout.h.
8512 (parse_long_options): Don't call close_stdout for --version.
8514 2000-05-06 Jim Meyering <meyering@lucent.com>
8516 * strnlen.c: Undefine __strnlen and strnlen.
8517 [!weak_alias]: Define __strnlen to strnlen.
8519 * atexit.c: New file, from libiberty.
8521 2000-05-06 Jim Meyering <meyering@lucent.com>
8523 * closeout.c (close_stdout_status): Also check for errors on the
8526 2000-05-05 Bruno Haible <haible@clisp.cons.org>
8528 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8529 instead of xmalloc, xrealloc, path_concat.
8530 (locale_charset): Treat empty environment variables as absent.
8531 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8533 2000-05-04 Jim Meyering <meyering@lucent.com>
8535 * getopt.c: Update from glibc.
8536 * obstack.c: Likewise.
8537 * obstack.h: Likewise.
8538 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
8540 * regex.h: Likewise.
8541 * strndup.c: Likewise.
8542 * strnlen.c: New file, from glibc.
8544 2000-05-01 Jim Meyering <meyering@lucent.com>
8546 * full-write.c (full_write): Remove `FIXME' part of comment.
8548 2000-04-29 Jim Meyering <meyering@lucent.com>
8550 * path-concat.c: Declare strdup only if it's not defined.
8551 * canon-host.c: Likewise.
8553 2000-04-28 Jim Meyering <meyering@lucent.com>
8555 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8556 redefinition warning on some systems (HPUX). Otherwise, regex.h is
8557 included first, then limits.h is included by locale.h by libintl.h.
8558 From John David Anglin.
8560 2000-04-25 Jim Meyering <meyering@lucent.com>
8562 * makepath.c (S_IRWXUGO): Define.
8563 (make_path): Always perform explicit chmod if MODE specifies any
8564 of the `special' permission bits. Prompted by a bug report against
8565 install from Mate Wierdl and Joost van Baal.
8567 2000-04-18 Jim Meyering <meyering@lucent.com>
8571 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8572 getpagesize. For BeOS. Based on a patch from Bruno Haible.
8574 2000-04-17 Jim Meyering <meyering@lucent.com>
8576 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8577 the definition of it to rpl_strftime also defined-away the system's
8580 2000-04-15 Jim Meyering <meyering@lucent.com>
8582 Use `C' to denote so-called `contiguous' files, the same way
8584 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8585 (ftypelet): Use S_ISCTG.
8586 From Michael Deutschmann.
8588 2000-04-14 Jim Meyering <meyering@lucent.com>
8590 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8592 2000-04-08 Jim Meyering <meyering@lucent.com>
8594 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8595 names don't conflict. Reported by Eli Zaretskii.
8597 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8599 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8600 bug. Deal with the different error behavior of Irix iconv.
8602 2000-04-07 Jim Meyering <meyering@lucent.com>
8604 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8605 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8607 2000-04-05 Jim Meyering <meyering@lucent.com>
8609 Portability tweaks required for ultrix4.3.
8610 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8611 * readutmp.c: Include sys/types.h before sys/stat.h.
8612 * canon-host.c: Declare strdup.
8613 * path-concat.c: Likewise.
8614 From John David Anglin.
8616 2000-04-04 Jim Meyering <meyering@lucent.com>
8618 Be more DOS 8.3-friendly.
8619 * ref-add.sin: Renamed from ref-add.sed.in.
8620 * ref-del.sin: Renamed from ref-del.sed.in.
8621 * Makefile.am: Reflect renaming.
8622 Reported by Eli Zaretskii.
8624 Use a temporary file name that won't clash with `charset.alias'
8625 in the DOS 8.3 name space.
8626 * Makefile.am (charset_tmp): Define.
8627 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8628 (uninstall-local): Likewise.
8629 Reported by Eli Zaretskii.
8631 2000-03-29 Paul Eggert <eggert@twinsun.com>
8633 * time/strftime.c (my_strftime): Make sure we call the system
8634 strftime, not ourselves, when invoking the underlying strftime.
8636 2000-03-24 Jim Meyering <meyering@lucent.com>
8638 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8639 (charset_alias): Define.
8640 (install-exec-local): Factor out common code.
8641 (uninstall-local): Split lines longer than 80.
8642 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8644 (.sed.in.sed): New rule. Don't redirect directly to $@.
8645 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8647 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8649 * config.charset: Output a line containing "Packages using this file".
8650 * ref-add.sed.in, ref-del.sed.in: New files.
8651 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8652 ref-del.sed): New rules.
8654 2000-03-17 Jim Meyering <meyering@lucent.com>
8656 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8657 Otherwise, include <strings.h>
8659 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8661 * unicodeio.c (utf8_wctomb): New function.
8662 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8663 format instead of in UCS-4 with platform dependent endianness.
8665 2000-03-07 Paul Eggert <eggert@twinsun.com>
8667 * savedir.c (savedir): Work even if directory size is
8668 negative; this can happen with some screwy NFS configurations.
8670 2000-03-06 Jim Meyering <meyering@lucent.com>
8672 * localcharset.c (get_charset_aliases): Don't try to free file_name
8673 if it's NULL (because we ran out of memory). From Bruno Haible.
8675 2000-03-05 Jim Meyering <meyering@lucent.com>
8677 * localcharset.c ("path-concat.h"): Include.
8678 (get_charset_aliases): Use path_concat instead of ANSI string
8681 * unicodeio.h (PARAMS): Define.
8682 Use it to guard prototype.
8684 2000-03-04 Jim Meyering <meyering@lucent.com>
8686 * Makefile.am (install-exec-local): Create $(libdir) before installing
8688 (uninstall-local): Uncomment this rule so `make distcheck' works
8691 * unicodeio.c (<errno.h>): Include it.
8692 (errno): Declare if not defined.
8694 * localcharset.c: Add Bruno's comment justifying use of volatile.
8696 * config.charset: New version, incorporating remarks from a linux
8697 i18n mailing list. From Bruno Haible.
8699 2000-03-02 Jim Meyering <meyering@lucent.com>
8701 * Makefile.am (EXTRA_DIST): Add config.charset.
8703 2000-03-01 Jim Meyering <meyering@lucent.com>
8705 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8706 * unicodeio.c: Likewise.
8708 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8710 * config.charset: New file.
8711 * localcharset.c: New file.
8712 * unicodeio.h, unicodeio.c: New files.
8713 * Makefile.am (DEFS): Add -DLIBDIR=...
8714 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8715 (noinst_HEADERS): Add unicodeio.h.
8716 (all-local, install-exec-local, charset.alias): New targets.
8718 2000-02-28 Paul Eggert <eggert@twinsun.com>
8720 * quotearg.c (ALERT_CHAR): New macro.
8721 (quotearg_buffer_restyled): Use it.
8723 2000-02-27 Jim Meyering <meyering@lucent.com>
8725 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8726 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8728 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8729 not `#if STDC_HEADERS'.
8730 Declare malloc if needed.
8732 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8733 now that autoconf always defines the HAVE_DECL_ symbols.
8734 * human.c: Likewise.
8736 * strtoumax.c: Likewise.
8738 * backupfile.c: Arrange for cpp to fail if the configure-time
8739 declaration check was not run.
8741 * human.c: Likewise.
8743 * strtoumax.c: Likewise.
8745 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8746 then first look up the entire `.'-containing string as a login name.
8748 2000-02-18 Paul Eggert <eggert@twinsun.com>
8750 * getdate.y: Handle two-digit years with leading zeros correctly.
8751 (textint): New typedef.
8752 (parser_control): Member year changed from int to textint.
8754 (YYSTYPE): Removed; replaced by %union with int and textint members.
8755 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8756 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8757 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8758 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8759 (date, number, to_year): Use width of number in digits, not its value,
8760 to determine whether it's a 2-digit year, or a 2-digit time.
8761 (yylex): Store number of digits of numeric tokens.
8762 Reported by John Kendall.
8764 (parser_control): Changed from struct parser_control to typedef (for
8765 consistency). All uses changed.
8767 (tID): Removed; not used.
8768 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8770 2000-02-14 Paul Eggert <eggert@twinsun.com>
8772 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8773 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8775 2000-02-12 Jim Meyering <meyering@lucent.com>
8777 * userspec.c (ISDIGIT): Define it.
8778 (isdigit): Remove definition.
8779 (is_number): Use ISDIGIT, not isdigit.
8780 <libintl.h>: Include.
8782 (parse_user_spec): Mark translatable strings.
8784 2000-02-10 Jim Meyering <meyering@lucent.com>
8786 With these changes, nanosleep.[ch] are finally enough like the other
8787 lib/* replacement files to compile on a few more losing systems.
8789 * nanosleep.h: Don't include config.h.
8790 Remove prototype from declaration of nanosleep.
8791 (PARAMS): Remove now-unneeded definition.
8792 * nanosleep.c: #undef nanosleep.
8793 (rpl_nanosleep): Rename from nanosleep.
8795 2000-02-03 Jim Meyering <meyering@lucent.com>
8797 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8798 rather than with `#if HAVE_UTMPNAME'.
8800 2000-02-01 Jim Meyering <meyering@lucent.com>
8802 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8804 2000-01-31 Jim Meyering <meyering@lucent.com>
8806 * nanosleep.h (nanosleep): Guard declaration with
8807 `#if ! HAVE_DECL_NANOSLEEP'.
8808 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8809 the declaration in that vendor's sys/timers.h.
8810 Reported by Christian Krackowizer.
8812 * quotearg.c (ISASCII): Add #undef and move definition to follow
8813 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8814 (ISPRINT): Likewise.
8815 Reported by Tom Tromey.
8817 2000-01-30 Jim Meyering <meyering@lucent.com>
8819 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8820 uses of ->ut_name. The latter doesn't work with new Linux header files
8821 where only utmpx.ut_user is declared.
8823 * readutmp.h (UT_USER): Define.
8825 2000-01-23 Jim Meyering <meyering@lucent.com>
8827 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8830 2000-01-22 Jim Meyering <meyering@lucent.com>
8832 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8833 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8834 Required for some AIX systems. Reported by Christian Krackowizer.
8835 [TESTING] (main): New function.
8837 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8838 * dirname.c (dir_name): Support for DOS-style file names with drive
8841 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8843 * strverscmp.c (ISDIGIT): Define.
8844 (strverscmp): Use ISDIGIT, not isdigit.
8846 2000-01-17 Paul Eggert <eggert@twinsun.com>
8848 * nanosleep.c (nanosleep):
8849 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8850 POSIX.1 doesn't require SA_INTERRUPT and some systems
8851 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8852 it's been part of POSIX.1 since day 1 (in 1988).
8854 2000-01-17 Jim Meyering <meyering@lucent.com>
8856 * interlock: Remove unused file. Reported by François Pinard.
8858 2000-01-16 Paul Eggert <eggert@twinsun.com>
8860 * quotearg.c (quotearg_buffer_restyled): Do not quote
8861 alert, backslash, formfeed, and vertical tab unnecessarily in
8862 shell quoting style.
8865 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8866 Free Software Foundation, Inc.
8867 Copying and distribution of this file, with or without modification,
8868 are permitted provided the copyright notice and this notice are preserved.