1 2005-03-15 Bruno Haible <bruno@clisp.org>
3 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
6 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
8 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
9 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
13 2005-03-14 Simon Josefsson <jas@extundo.com>
15 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
18 2005-03-14 Jim Meyering <jim@meyering.net>
20 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
21 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
22 to be nonzero so that we (and caller) can detect the difference
23 between a valid zero-length expansion and an error return, even
24 when the underlying strftime fails before writing anything into
27 2005-03-10 Jim Meyering <jim@meyering.net>
29 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
30 so that this module works on systems without fchdir.
32 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
34 Factor int-properties macros into a single file, except for
36 * intprops.h: New file.
37 * getloadavg.c: Include it instead of limits.h.
38 (INT_STRLEN_BOUND): Remove.
39 * human.c: Include intprops.h.
40 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
41 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
42 * inttostr.h: Include intprops.h instead of limits.h.
43 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
44 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
45 for consistency with intprops.h.
46 (time_t_is_integer, twos_complement_arithmetic): Use them.
47 * sig2str.h: Include <signal.h>, intprops.h.
48 (INT_STRLEN_BOUND): Remove.
49 * strftime.c (TYPE_SIGNED): Remove.
50 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
51 * strtol.c: Adjust comments to match intprops.h.
52 * userspec.c: Include intprops.h.
53 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
54 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
55 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
56 instead of rolling our own expressions.
57 * xstrtol.c: Include xstrtol.h first, to test interface.
59 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
61 (my_strftime): Do not mishandle years close to INT_MAX, by doing
62 the right thing even if adding 1900 would overflow. Similarly
63 for tm_mon + 1 and tm_yday + 1.
64 Make %Y always equivalent to %C%y, and similarly for %G and %g.
65 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
66 (DO_SIGNED_NUMBER): New macro.
67 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
69 2005-03-07 Bruno Haible <bruno@clisp.org>
71 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
73 2005-03-03 Derek R. Price <derek@ximbiot.com>
74 Bruno Haible <bruno@clisp.org>
76 * pagealign_alloc.h: New file.
77 * pagealign_alloc.c: New file.
79 2005-01-28 Bruno Haible <bruno@clisp.org>
81 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
84 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
86 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
87 The workaround isn't strictly needed for POSIX conformance, and
88 it's too much of a pain to configure and maintain. We'll ask
89 people to fix their kernels instead.
90 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
91 (NANOSLEEP_BUG_WORKAROUND): Remove.
92 (xnanosleep): Remove the workaround.
94 2005-02-12 Bruno Haible <bruno@clisp.org>
96 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
98 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
100 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
101 * timespec.h (gettime): Return void, since it always
102 succeeds now. All uses changed.
103 * gettime.c (gettime) Likewise.
104 [HAVE_NANOTIME]: Prefer nanotime.
105 Assume gettimeofday succeeds, as POSIX requires.
106 Assime time () succeeds, since other code already does.
107 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
108 (timespec_subtract): Remove.
109 (NANOSLEEP_BUG_WORKAROUND): New constant.
110 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
111 things considerably. Use it only on GNU/Linux hosts, since the
112 workaround shouldn't be needed elsewhere.
114 2005-02-24 Bruno Haible <bruno@clisp.org>
116 * gettext.h: Update from GNU gettext 0.14.2.
118 2005-02-24 Bruno Haible <bruno@clisp.org>
120 * localcharset.c: Update from GNU gettext 0.14.2.
121 * config.charset: Update from GNU gettext 0.14.2.
123 2005-02-22 Simon Josefsson <jas@extundo.com>
125 * iconvme.h, iconvme.c: New files, from libc.
127 2005-02-20 Neil Conway <neilc@samurai.com>
129 * xgethostname.c (xgethostname): Check for ENOMEM, which is
130 returned by OSX/Darwin if the specified buffer is not large
131 enough for the hostname.
133 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
135 * memrchr.h: New file.
136 * chdir-long.c: Include it.
137 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
138 Don't bother including stddef.h.
140 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
142 * argp-help.c (__argp_help): Create a fake struct argp_state and
143 pass it to _help, otherwise the latter coredumps trying to
144 dereference state.root_argp.
146 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
148 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
150 Include <sys/types.h>, for dev_t.
151 (ME_DUMMY, ME_REMOTE): Move from here....
152 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
153 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
155 Include mountlist.h first, to test the interface.
157 2005-01-29 Bruno Haible <bruno@clisp.org>
159 * progname.c (program_name): Initialize.
160 Needed when linking statically on MacOS X.
162 2005-01-28 Bruno Haible <bruno@clisp.org>
164 * javacomp.sh.in: New file, from GNU gettext.
165 * javacomp.h: New file, from GNU gettext.
166 * javacomp.c: New file, from GNU gettext.
168 2005-01-26 Bruno Haible <bruno@clisp.org>
170 * javaexec.sh.in: New file, from GNU gettext.
171 * javaexec.h: New file, from GNU gettext.
172 * javaexec.c: New file, from GNU gettext.
174 2005-01-26 Simon Josefsson <jas@extundo.com>
176 * gai_strerror.c: Use GPL in header.
178 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
180 * argp-help.c (hol_entry_help): Avoid using non-constant
181 initializers for struct pentry_state.
182 (__argp_error): Check return value of __asprintf
183 (__argp_failure): Translate error message
185 * argp-parse.c: Removed braces around the expansion of N_()
187 2005-01-21 Jim Meyering <jim@meyering.net>
189 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
190 same value as for Solaris 9.
192 * chdir-long.c (chdir_long): Rewrite to remove limitation on
193 component length. This included changing the parameter to be
194 of type `char *' rather than `char const *'.
195 * chdir-long.h (chdir_long): Update prototype.
197 * openat.c (fdopendir, fstatat): New functions.
198 * openat.h: Include headers required for use of DIR and struct stat.
199 [AT_SYMLINK_NOFOLLOW]: Define.
200 (fdopendir, fstatat): Add prototypes.
202 2005-01-21 Bruno Haible <bruno@clisp.org>
204 * classpath.h: New file, from GNU gettext.
205 * classpath.c: New file, from GNU gettext.
207 2005-01-20 Simon Josefsson <jas@extundo.com>
209 * version-etc-fsf.c: New file, with version_etc_copyright.
210 * version-etc.c: Remove version_etc_copyright.
211 * version-etc.h (version_etc_copyright): Use [] instead of * in
212 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
214 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
216 * save-cwd.c (save_cwd): Remove code to support the case
217 where fchdir is missing or flaky.
219 2005-01-20 Simon Josefsson <jas@extundo.com>
221 * base64.h (isbase64): Add.
223 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
224 using a unsigned prototype, don't inline.
225 (base64_decode): Use it.
227 2005-01-19 Bruno Haible <bruno@clisp.org>
229 * sh-quote.h: New file, from GNU gettext.
230 * sh-quote.c: New file, from GNU gettext.
232 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
234 Merge changes from coreutils, as described below in several
235 changelogs dated today.
237 * save-cwd.c: Include "save-cwd.h" before other include files.
238 (O_DIRECTORY): Remove; not needed here, since "." must be
239 a directory. All uses removed.
240 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
241 universal on Suns, and we also need to test for IRIX.
242 Revamp code to use 'if' rather than '#if'.
243 Avoid unnecessary comparison of cwd->desc to 0.
245 * utimens.c (futimens): Robustify the previous patch, by checking
246 for known valid error numbers rather than observed invalid ones.
248 2005-01-18 Jim Meyering <jim@meyering.net>
250 * version-etc.c (version_etc_copyright): Update copyright date.
252 * utimens.c (futimens): Account for the fact that futimes
253 can also fail with errno == ENOSYS or errno == ENOENT.
254 Patch from Dmitry V. Levin.
256 Change the name of the robust chdir function from chdir to chdir_long.
257 * save-cwd.c: Include chdir-long.h rather than chdir.h.
258 (restore_cwd): Use chdir_long, not chdir.
259 * chdir-long.c: Renamed from chdir.c.
260 * chdir-long.h: Renamed from chdir.h.
261 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
264 2005-01-18 Bob Proulx <bob@proulx.com>
266 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
267 offsetof() macro construct to avoid compile failure with native HP-UX
268 11.0 ANSI C compiler.
270 2005-01-06 Bruno Haible <bruno@clisp.org>
272 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
273 because stpncpy.m4 takes care of it.
275 2004-01-24 Bruno Haible <bruno@clisp.org>
277 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
279 2003-10-09 Bruno Haible <bruno@clisp.org>
281 * progreloc.c: Include xalloc.h instead of xmalloc.h.
283 2005-01-06 Bruno Haible <bruno@clisp.org>
285 * fwriteerror.h (fwriteerror): Change specification to include fclose.
286 * fwriteerror.c: Include <stdbool.h>.
287 (fwriteerror): At the end, close the file stream. Record whether
288 stdout was already closed.
290 2004-05-27 Bruno Haible <bruno@clisp.org>
292 * execute.c (environ): Declare if needed.
293 * pipe.c (environ): Likewise.
294 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
296 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
298 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
299 definitions to be after all include files, to avoid collisions.
300 Problem reported by Bob Proulx.
302 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
304 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
305 not needed. This removes a dependency on the gettext module.
306 [defined _LIBC]: Do not include <libintl.h>; not needed.
308 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
310 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
313 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
315 * argp-parse.c: Include <stddef.h>.
316 (alignof, alignto): New macros.
317 (parser_init): Don't assume that void * is aligned sufficiently
320 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
321 need to extend the stack.
322 (YYINITDEPTH): New macro, so that the initial stack isn't overly
325 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
327 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
329 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
331 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
332 Remove now-obsolete comment about AIX.
333 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
334 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
335 (YYMAXDEPTH): New macro.
337 2004-12-18 Bruno Haible <bruno@clisp.org>
339 * fatal-signal.c (fatal_signals): Make non-const.
340 (init_fatal_signals): New function.
341 (uninstall_handlers, install_handlers): Ignore signals that were set to
343 (at_fatal_signal): Call init_fatal_signals.
344 (init_fatal_signal_set): Likewise. Ignore signals that were set to
346 Reported by Paul Eggert.
348 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
350 * getdate.y (textint): New member "negative".
351 (time_zone_hhmm): New function.
352 Expect 14 shift-reduce conflicts, not 13.
353 (o_colon_minutes): New rule.
354 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
355 (yylex): Set the "negative" member of signed numbers.
357 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
359 Changes imported from coreutils.
360 * hard-locale.c: Assume <locale.h> exists.
362 (GLIBC_VERSION): New macro.
363 (hard_locale): Assume setlocale exists.
364 Rewrite to avoid #ifdef.
365 Use strdup rather than malloc + strcpy.
366 * human.c: Assume <locale.h> exists.
367 (human_readable): Assume localeconv exists.
369 2004-12-01 Jakub Jelinek <jakub@redhat.com>
371 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
372 convert T2, not T. (Imported from libc.)
374 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
376 * getcwd.c (is_ENAMETOOLONG): New macro.
377 (__getcwd.c): Don't restore errno; glibc doesn't.
378 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
379 first, falling back to our code only if its results look suspicious.
380 Ensure that the resulting buffer is only as large as necessary.
382 * readutmp.c: Include readutmp.h first.
383 Include <errno.h>, since readutmp.h no longer does that.
384 * readutmp.h: Don't include <errno.h>,
385 <sys/param.h>, <time.h>; not needed to establish interface.
386 (errno): Remove decl.
387 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
388 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
389 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
391 2004-11-28 Simon Josefsson <jas@extundo.com>
393 * base64.h, base64.c: New file.
395 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
397 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
399 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
401 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
402 HP's ANSI C compiler.
403 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
404 Declaring int functions causes warnings on some modern systems and
405 shouldn't be needed to compile on ancient ones.
406 * same.c (MIN) [defined MIN]: Don't define, since it's already
409 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
410 with the following changes.
411 (__set_errno): Parenthesize properly.
413 (MIN, MAX, MATCHING_INO): New macros.
414 (__getcwd): Define with prototype, not K&R form.
415 Use heuristics to allocate default buffer on stack if possible.
416 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
417 behavior, and to avoid the PATH_MAX limit when computing
419 Use MATCHING_INO to compare inode number to file.
420 Check for arithmetic overflow in size calculations.
421 Fix bug in reallocation of dot array that caused getcwd to fail
422 on directories nested deeper than 75.
423 Be more careful about saving errno on error.
424 Do not use realloc; use only free+malloc, as this is a bit
425 more flexible and avoids a needless copy operation.
426 Do not inspect st_dev and st_ino for symbolic links; POSIX
427 doesn't specify the latter.
428 Check for closedir errors.
429 Avoid needless casts.
430 Use "#ifdef weak_alias" around weak_alias, to be like other
432 The following changes to getcwd.c have effect only when used in
433 gnulib; they have no effect inside glibc proper.
434 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
435 as alloca isn't used.
436 (alloca, __alloca): Likewise.
437 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
438 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
439 unconditionally, as gnulib assumes C89 or better.
440 Do not include <sys/param.h>.
441 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
442 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
444 (NULL) [!defined NULL]: Remove; we assume C89 or better.
445 Include <dirent.h> in a way that is compatible with modern Autoconf.
446 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
447 New macros, if not already defined.
448 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
449 Use "_LIBC", not "defined _LIBC", for consistency.
450 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
452 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
453 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
454 * xgetcwd.c: David MacKenzie's old code was removed, so give
455 credit only to Jim Meyering and adjust the copyright dates.
456 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
457 <stdlib.h>, <unistd.h>, "pathmax.h".
458 Instead, include "xgetcwd.h" (first) and "getcwd.h".
459 (INITIAL_BUFFER_SIZE): Remove.
460 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
462 2004-11-23 Jim Meyering <jim@meyering.net>
464 * getopt_.h: Remove trailing blanks.
466 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
468 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
469 (futimens): New function, which uses futimes if available.
470 (futimens, utimens): Support timespec==NULL, with same semantics
471 as utime and utimens.
472 * utimens.h (futimens): New decl.
474 2004-11-23 Jim Meyering <jim@meyering.net>
476 * __fpending.c: Add comment.
478 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
480 * getopt_.h: Re-addition of __getopt_argv_const caused
481 redefinition warnings. To avoid them, include the defines
482 in `#if !defined __need_getopt ... #endif'. The only place
483 where __getopt_argv_const is used is in definitions
484 of getopt_long and getopt_long_only below, which are as well
485 protected by `#ifndef __need_getopt'.
486 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
487 __need_getopt after including <stdio.h> and <unistd.h> These
488 headers might have defined it.
490 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
492 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
494 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
495 optopt): Use them instead of invoking ## directly; otherwise, the
496 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
498 2004-11-19 Bruno Haible <bruno@clisp.org>
500 * strtok_r.c: Move comments from here...
501 * strtok_r.h: ... to here.
503 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
505 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
506 might fail. Problem reported by Yoann Vandoorselaere.
507 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
508 that mishandle size_t overflow.
510 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
512 * canon-host.c: Include "strdup.h".
513 (canon_host): Use getaddrinfo if available, so that IPv6 works.
514 Use strdup instead of malloc/strcpy to duplicate strings.
516 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
517 (human_space_before_unit): New constant.
518 * human.c (human_readable): Support it.
520 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
521 (xgetcwd): Set errno correctly when failing.
522 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
523 the failure is actually due to a PATH_MAX problem.
525 Further getopt changes to make it more likely that glibc will
526 buy the changes back.
527 * getopt.c (POSIXLY_CORRECT): New constant.
528 (getopt): Use it, so to preserve glibc semantic
529 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
530 when compiling for libc.
531 * getopt_.h (__getopt_argv_const): Bring it back.
532 (getopt_long, getopt_long_only): Use it.
534 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
535 New arg POSIXLY_CORRECT. All callers changed.
536 (getopt): Argv is now char * const *, as per standard.
537 (_getopt_internal_r, _getopt_internal): Argv is now char **,
538 not char *__getopt_argv_const *.
539 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
540 _getopt_long_only_r): Likewise.
541 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
542 * getopt_int.h (_getopt_internal, _getopt_internal_r,
543 _getopt_long_r, _getopt_long_only_r): Likewise.
544 * getopt_.h (__getopt_argv_const): Remove.
545 (getopt): Argv is now char * const *, as per standard.
547 * getdate.y (tORDINAL): New token.
548 (day, relunit): Allow it for relative times.
549 (relative_time_table): Use tORDINAL for ordinals.
551 2004-11-15 Jim Meyering <jim@meyering.net>
553 * closeout.c: Include "__fpending.h" once again.
555 (close_stdout): Don't fail just because stdout was closed initially,
556 since some programs don't write to stdout in the normal course of
557 operation (other than --version and --help), and we don't want this
558 function to make e.g. `touch file >&-' fail.
559 But do fail if it was closed and someone has tried to write to it.
560 E.g., `printf foo >&-' must fail.
562 2004-11-11 Simon Josefsson <jas@extundo.com>
564 * strtok_r.h, strtok_r.c: New file.
566 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
568 * getopt_.h (__getopt_argv_const): New macro, to be used so that
569 we can stop lying to compilers about the constness of argv when we
570 are compiled outside glibc.
571 (getopt, getopt_long, getopt_long_only): Use it.
572 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
574 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
575 _getopt_long_only_r): Likewise.
576 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
577 _getopt_long_only_r): Likewise.
579 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
580 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
581 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
582 the other external symbols.
583 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
584 declaration, since the above renaming now works around collisions.
586 2004-11-11 Jim Meyering <jim@meyering.net>
588 * linebreak.c: Remove trailing blanks.
589 * alloca_.h: Likewise.
591 * euidaccess.c: Likewise.
592 * allocsa.h: Likewise.
594 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
596 * mktime.c (SHR): New macro, which is a portable
597 substitute for >> that should work even on Crays.
598 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
599 Problem reported by Mark D. Baushke in
600 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
601 * getdate.y (SHR): Likewise.
603 * strftime.c (SHR): Likewise.
605 * quotearg.c (struct quoting_options): Use unsigned int for
606 quote_these_too, so that right shifts are well defined. All uses
609 2004-11-10 Simon Josefsson <jas@extundo.com>
611 * getaddrinfo.h, getaddrinfo.c: New files.
613 2004-11-10 Jim Meyering <jim@meyering.net>
615 Ensure that no close failure goes unreported.
616 * closeout.c (close_stdout): Always close stdout. I.e., don't
617 return early when it seems there's nothing to flush.
618 Don't include __fpending.h.
620 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
622 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
624 2004-11-05 Bruno Haible <bruno@clisp.org>
626 * readlink.c: Include stddef.h, needed for size_t on Woe32.
627 Reported by Mark D. Baushke <mdb@cvshome.org>.
629 2004-11-04 Bruno Haible <bruno@clisp.org>
631 2004-09-11 Bruno Haible <bruno@clisp.org>
632 * allocsa.valgrind: New file.
633 2004-02-06 Bruno Haible <bruno@clisp.org>
634 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
635 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
636 Reported by Christopher Seip <chris.seip@hp.com>.
638 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
640 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
641 with errno == ERANGE if the buffer is too small.
642 Problem reported by Mark D. Baushke.
644 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
646 * xreadlink.c (MAXSIZE): New macro.
647 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
648 size does not exceed MAXSIZE. Avoid cast.
649 As suggested by Mark D. Baushke in
650 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
651 if readlink fails with buffer size just under MAXSIZE, try again
654 2004-11-02 Derek R. Price <derek@ximbiot.com>
655 and Paul Eggert <eggert@cs.ucla.edu>
657 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
658 (get_date): Overparenthesize to avoid GCC warning.
660 2004-11-02 Bruno Haible <bruno@clisp.org>
662 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
663 function returns void.
665 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
667 * getpass.c (fflush_unlocked, flockfile, funlockfile)
668 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
671 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
673 * getdate.y: Add support for TZ="foo" within a date string.
674 Fix some bugs near time_t boundaries. Reject dates with
675 out-of-range components, e.g., "Sept 31".
676 Include <stdlib.h>, "setenv.h", "xalloc.h".
677 (ISDIGIT_LOCALE): Remove; unused.
678 Note that the TZ and time functions used here are not reentrant.
679 (mktime_ok, get_tz): New functions.
680 (TZBUFSIZE): New constant.
681 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
682 This requires that we sometimes generate our own TZ="XXX..." setting.
684 2004-10-27 Derek R. Price <derek@ximbiot.com>
686 * mktime.c (not_equal_tm): Remove redundant check.
688 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
690 * getdate.y: Use Bison 1.875 features, and some minor
691 code cleanups. This change does not affect semantics.
692 Don't include <stdlib.h>; no longer needed.
693 Don't include unlocked-io.h; only the "#if TEST" code uses
694 stdio, and performance isn't crucial there.
695 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
696 Bison 1.875 features as described below.
697 All uses of "PC." replaced by "pc->".
698 (YYSTYPE): Add a forward declaration.
699 (yylex, yyerror): Use full prototypes in forward decls.
700 Use "%pure-parser" rather than obsolescent "%pure_parser".
701 Use %parse-param and %lex-param instead of obsolescent
702 YYPARSE_PARAM and YYLEX_PARAM.
703 (meridian_table, month_and_day_table, time_units_table,
704 relative_time_table, time_zone_table, military_table,
705 lookup_zone, lookup_word, get_date):
706 Use NULL instead of 0 where appropriate.
707 (to_hour): Avoid abort (), to avoid a dependency on
709 (yyerror, yylex): Now accepts parser_control * arg.
710 (main) [TEST]: Use '\0' rather than 0 for char.
712 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
714 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
715 It's now the caller's responsibility to handle the case where
716 !HAVE_GETPAGESIZE && !defined getpagesize.
718 * mktime.c (leapyear): Arg is long int, not int.
720 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
722 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
724 2004-10-12 Simon Josefsson <jas@extundo.com>
726 * getpass.c (fflush_unlocked, flockfile, funlockfile)
727 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
730 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
732 * vsnprintf.h: New file.
733 * vsnprintf.c: New file.
735 2004-10-07 Bruno Haible <bruno@clisp.org>
737 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
738 into the provided buffer.
740 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
742 * diacrit.c, diacrit.h: Add GPL notice.
744 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
745 * atanl.c (atanl): Keep the code as similar to glibc as possible.
746 * logl.c (logl): Keep the code as similar to glibc as possible.
747 This avoids a potential constant-folding bug.
749 2004-10-05 Bruno Haible <bruno@clisp.org>
751 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
753 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
755 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
756 * xmalloc.c (xmemdup): Likewise.
757 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
758 XFREE): Remove these long-obsolescent macros.
759 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
762 * regex.c (re_comp): Cast gettext return value to char *,
763 Problem reported by Martin Neitzel via Mark D. Baushke.
765 2004-10-04 Simon Josefsson <jas@extundo.com>
767 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
768 '#ifdef USE_UNLOCKED_IO'.
770 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
772 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
773 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
774 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
775 regex.c, sha1.c, version-etc.c, yesno.c:
776 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
777 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
778 the includer's responsibility.
782 * modechange.c (mode_compile): Don't decrement a pointer that
783 points to the start of a string, as the C Standard says the
784 resulting behavior is undefined.
786 * backupfile.h (enum backuptype): Rename none -> no_backups,
787 simple -> simple_backups, numbered_existing ->
788 numbered_existing_backups, numbered -> numbered_backups
789 to avoid shadowing problems. All uses changed.
790 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
791 * backupfile.c (check_extension, numbered_backup):
792 Rename locals to avoid shadowing 'basename'.
793 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
796 * .cppi-disable: Add getopt_.h, getopt_int.h.
797 * .cvsignore: Add getopt.h.
799 2004-10-04 Simon Josefsson <jas@extundo.com>
801 * memmem.h: New file.
802 * memmem.c: New file, taken from glibc.
804 2004-10-02 Jim Meyering <jim@meyering.net>
806 * dirfd.h, getpagesize.h: Add copyright notice.
808 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
810 * snprintf.c: Remove comments as to why each header is needed.
812 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
814 * strsep.h: New file.
815 * strsep.c: New file.
817 2004-10-01 Simon Josefsson <jas@extundo.com>
819 * snprintf.c (snprintf): Handle size==0.
821 2004-10-01 Simon Josefsson <jas@extundo.com>
822 Bruno Haible <bruno@clisp.org>
824 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
825 (snprintf): Declare 'args'.
827 2004-09-30 Simon Josefsson <jas@extundo.com>
829 * snprintf.h, snprintf.c: New files.
831 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
833 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
834 (hol_entry_help): Never translate an empty string.
835 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
836 * argp.h (OPTION_NO_TRANS): New option.
838 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
840 * xvasprintf.c: Include xalloc.h.
841 (xvasprintf): Use xalloc_die, not xmalloc_die.
843 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
845 * dummy.c: Change copyright notice to FSF, and license to GPL.
847 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
849 * argp-pvh.c (argp_program_version_hook): Provide initial value.
850 Problem reported by Bruno Haible in:
851 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
853 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
855 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
856 in case some system header has #define'd it. Problem reported by
858 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
860 2004-09-08 Bruno Haible <bruno@clisp.org>
862 * stdint_.h.in: New file, taken from GNU clisp.
864 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
866 * xvasprintf.h: New file.
867 * xvasprintf.c: New file.
868 * xasprintf.c: New file.
870 2004-09-08 Bruno Haible <bruno@clisp.org>
872 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
874 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
876 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
878 Import from coreutils.
879 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
880 strings on unbounded length. alloca's performance benefits aren't
883 (parse_with_separator): New function, with most of the internals
884 of the old parse_user_spec. Allow user to omit both user and group,
885 for compatibility with FreeBSD.
886 Clone only the user name, not the entire spec.
887 Do not set *uid, *gid unless entirely successful.
888 Avoid memory leak in some failing cases.
889 Fix regression for USER.GROUP reported by Dmitry V. Levin in
890 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
891 (parse_user_spec): Rewrite to use parse_with_separator.
893 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
895 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
896 its complicated substitute.
897 * argp-help.c: Include <errno.h>, for program_invocation_short_name
898 and program_invocation_name.
899 (__argp_basename) [!_LIBC]: Remove; the only use was
900 replaced by its body.
901 (__argp_short_program_name): Change condition from
902 !defined __argp_short_program_name to
903 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
904 to match argp-namefrob.h.
905 (__argp_failure): Don't assume strerror_r returns char *.
906 * argp-parse.c (N_): Define unconditionally.
907 (argp_default_options): Fill out initializers with 0 to avoid
910 2004-08-12 Simon Josefsson <jas@extundo.com>
912 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
913 * getopt_.h: Renamed from getopt.h.
915 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
917 Merge from coreutils.
919 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
920 wmemchr or wmemcpy. Problem reported by Robert Dahlem
921 for Reliant Unix 5.43.
923 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
924 (union fooround): Use uintmax_t, not long int.
925 The rest is a merge from libc:
926 [defined _LIBC]: Include <shlib-compat.h>.
927 (_obstack) [defined _LIBC]: Remove after 2.3.4.
929 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
931 * strverscmp.c: Convert to UTF-8.
933 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
935 * obstack.h (obstack_empty_p):
936 Don't assume that chunk->contents is suitably aligned.
937 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
938 Likewise. Problem reported by Benno in
939 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
941 * chown.c (rpl_chown): Work even if the file is writeable but not
942 readable. This could be improved further but it'd take some work.
944 2004-08-08 Simon Josefsson <jas@extundo.com>
946 * xgethostname.c: Don't include error.h (not used).
949 * getpass.c: Include getpass.h first.
951 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
953 * xalloc-die.c: New files.
954 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
956 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
957 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
958 (_, N_, xalloc_die): Move to xalloc-die.c.
959 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
960 so that we needn't mess with xalloc_msg_memory_exhausted.
962 * sha1.h: Renamed from sha.h.
963 (SHA1_H): Renamed from _SHA_H.
964 (sha1_ctx): Renamed from sha_ctx.
965 (sha1_init_ctx): Renamed from sha_init_ctx.
966 (sha1_process_block): Renamed from sha_process_block.
967 (sha1_process_bytes): Renamed from sha_process_bytes.
968 (sha1_finish_ctx): Renamed from sha_finish_ctx.
969 (sha1_read_ctx): Renamed from sha_read_ctx.
970 (sha1_stream): Renamed from sha_stream.
971 (sha1_buffer): Renamed from sha_buffer.
972 * sha1.c: Likewise; renamed from sha.c.
973 Do not include <sys/types.h>.
974 Include <stddef.h> rather than <stdlib.h>.
976 2004-08-08 Bruno Haible <bruno@clisp.org>
978 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
979 FILESYSTEM_PREFIX_LEN.
980 * progreloc.c: Likewise.
981 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
983 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
986 * argp-help.c (make_hol, hol_append): Don't assume that
987 SIZE_MAX is a valid preprocessor constant.
988 (__argp_basename): Change from "#ifndef _LIBC"
989 to "#ifndef __argp_short_program_name", so that
990 we don't compile these functions for tar.
992 More merges from coreutils.
993 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
994 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
996 * addext.c: Remove; no longer needed.
997 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
998 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
999 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1000 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1001 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1002 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1003 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1004 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1005 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1006 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1007 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1008 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1009 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1010 Import changes from coreutils.
1012 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1014 Merge from coreutils.
1016 * .gdb-history: Remove; this doesn't belong here.
1018 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1019 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1020 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1022 * dirname.h: Include <stdbool.h>.
1023 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1024 for consistency with POSIX terminology. All uses changed.
1025 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1026 (strip_trailing_slashes): Use bool for booleans.
1027 * stripslash.c (strip_trailing_slashes): Likewise.
1029 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1030 sometimes returns a positive errno value even when it succeeds.
1031 (print_errno_message) [!LIBC]: Fall back on strerror if
1034 * path-concat.c (mempcpy): Don't define if a system header defines it.
1035 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1036 (longest_relative_suffix): New function.
1037 (path_concat): Use it. Assume first argument is not NULL.
1038 Port to DOS. Omit redundant separators.
1039 Report an error instead of returning NULL.
1040 Use mempcpy instead of memcpy.
1041 (xpath_concat): Remove: not declared or used.
1043 * same.h: Include <stdbool.h>
1044 (same_name): Return bool, not int.
1045 * same.c (same_name): Likewise.
1046 (errno): Don't declare; we assume C89 or better now.
1048 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1049 if not already defined.
1051 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1052 * dup-safer.c (errno): Likewise.
1054 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1056 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1059 2004-08-03 Simon Josefsson <jas@extundo.com>
1061 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1062 * progname.h: Don't include stdbool.h.
1064 2004-08-02 Simon Josefsson <jas@extundo.com>
1066 * getsubopt.h: New file, with comments from Bruno Haible.
1067 * getsubopt.c: New file, from glibc, but slightly modified based on
1068 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1070 2004-08-01 Simon Josefsson <jas@extundo.com>
1072 * xgetdomainname.c: Include stdlib.h, for free().
1074 2004-07-16 Simon Josefsson <jas@extundo.com>
1076 * dummy.c: New file.
1078 2004-07-16 Bruno Haible <bruno@clisp.org>
1080 * backupfile.h: Add extern "C" for C++.
1081 * closeout.h: Likewise.
1082 * copy-file.h: Likewise.
1083 * findprog.h: Likewise.
1084 * full-write.h: Likewise.
1085 * pathname.h: Likewise.
1086 * progname.h: Likewise.
1087 * stpcpy.h: Likewise.
1088 * stpncpy.h: Likewise.
1089 * strcase.h: Likewise.
1090 * strstr.h: Likewise.
1091 * xalloc.h: Likewise.
1093 * mbswidth.h: Add extern "C" for C++.
1094 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
1096 2004-07-09 Simon Josefsson <jas@extundo.com>
1098 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
1099 failed without this.)
1101 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
1103 * fchown-stub.c: New file.
1105 2004-06-24 Jim Meyering <jim@meyering.net>
1107 * obstack.h (obstack_base): Cast to (void *), per documentation.
1109 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1111 * argz.c, argz_.h: New files, which are autoupdated from libtool.
1113 2004-06-01 Jim Meyering <jim@meyering.net>
1115 * calloc.c: New file.
1117 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
1119 * getdate.y (yylex): Allow space between sign and number.
1120 Problem reported by Dan Jacobson.
1122 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
1123 and Jim Meyering <jim@meyering.net>
1125 Merge from coreutils CVS.
1127 * stat-macros.h: New file, with contents from file-type.h
1128 and coreutils' system.h.
1129 * file-type.c: Include "stat-macros.h".
1130 * file-type.h (file_type): Move all macro definitions to new file,
1133 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1134 Wrap old code with this conditional.
1135 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1136 function that does not dereference symlinks.
1137 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1139 * xreadlink.c: Include xreadlink.h first, to catch .h file
1140 dependency problems.
1141 (xreadlink): Accept new arg SIZE, for efficiency.
1142 All decls and uses changed.
1143 * xreadlink.h: Include <stddef.h>, for size_t.
1145 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
1146 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
1148 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
1150 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
1152 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
1153 macros to be defined.
1154 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
1155 the allocator returns NULL because the requested size is zero.
1157 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
1159 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
1160 var. Add comment explaining why libc still defines it. This
1161 merges the following patch from glibc:
1162 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
1164 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
1166 * obstack.c (_obstack): Remove unused variable. It hasn't been
1167 present in glibc since revision 1.1 of this file.
1168 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
1169 obstack_alignment_mask, obstack_alloc, obstack_base,
1170 obstack_blank, obstack_blank_fast, obstack_chunk_size,
1171 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
1172 obstack_grow0, obstack_init, obstack_int_grow,
1173 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
1174 obstack_next_free, obstack_object_size, obstack_ptr_grow,
1175 obstack_ptr_grow_fast, obstack_room): Remove declarations of
1176 nonexistent functions.
1178 2004-05-17 Derek R. Price <derek@ximbiot.com>
1179 Paul Eggert <eggert@cs.ucla.edu>
1181 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
1183 2004-05-14 Bruno Haible <bruno@clisp.org>
1185 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
1186 that consists of a '.' followed by an empty digit string.
1187 Patch by Tor Lillqvist <tml@iki.fi>.
1189 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
1191 Port obstack to the AS/400, where pointers are 16 bytes wide and
1192 you cannot cast an integer to a valid pointer. This patch is
1193 currently waiting to be integrated into glibc; see
1194 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
1196 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
1197 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
1198 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
1199 (struct obstack): temp member is now a union of a pointer and
1200 an integer, instead of an integer. All integer uses changed.
1201 This does not affect the physical layout of struct obstack,
1202 except on hosts (like the AS/400) where the size or alignment of
1203 void * is greater than that of ptrdiff_t.
1204 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
1205 __STDC__)]: Store temporary in pointer member of union, not
1207 * obstack.c: Include <stddef.h>, for offsetof.
1208 (struct fooalign): Remove; it doesn't need a name.
1209 (union fooround): Change double to long double, and add void *.
1210 (DEFAULT_ALIGNMENT): Use offsetof to compute.
1211 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
1212 not a macro. Hence the values are always int; so remove all
1213 casts-to-int in uses.
1215 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1216 Derek Price <derek@ximbiot.com>
1218 * alloca.c: Include <alloca.h>, to get our interface.
1219 * alloca_.h: Use __alloca on AIX, so that we don't have to
1220 include <alloca.h> first. Use C89 prototype for alloca; this
1221 requires including <stddef.h> for size_t. Use extern "C" if C++.
1222 Use #elif for simplicity, since we can assume C89 now.
1223 Don't try to source the system alloca.h since it will not be found
1224 and to prevent recursively including its replacement.
1225 * fnmatch.c: Include <alloca.h> instead of opencoding.
1226 * regex.c: Likewise.
1228 2004-05-16 Derek Price <derek@ximbiot.com>
1229 Paul Eggert <eggert@cs.ucla.edu>
1231 getline cleanup. This changes the getndelim2 API: both order of
1232 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1235 * getline.c: Don't include stddef.h or stdio.h, since our
1236 interface does that.
1237 (getline): Always use getdelim, so that we don't have two
1238 copies of this code.
1239 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1241 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1242 (GETNDELIM2_MAXIMUM): New macro.
1243 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1244 instead of the old practice of delim2==0. All callers changed.
1245 Return -1 on overflow, instead of returning junk.
1246 Do not set *linesize unless allocation succeeds.
1247 * getndelim2.h: Do not include stddef.h; no longer needed, now
1248 that we include sys/types.h.
1249 * getnline.h: Likewise.
1250 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
1251 (getndelim2): Reorder arguments.
1252 * getnline.c (getnline, getndelim):
1253 Don't discard the NMAX argument.
1254 (getnline): Invoke getndelim, to avoid code duplication.
1255 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
1256 of (size_t) -1 by callers of the getnline family.
1258 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
1260 * nanosleep.c (suspended): Change its type from int to
1261 sig_atomic_t volatile.
1262 (first_call): Make it private to rpl_nanosleep, and have it
1263 be zero initially as that's a bit faster.
1264 (my_usleep): Round up fractional times instead of truncating them,
1265 as this is the usual meaning for 'sleep'.
1267 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
1269 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
1270 (ENOSYS): Define if not defined.
1271 (settime): Fall back on stime if it exists and settimeofday fails.
1272 But don't bother with fallbacks if a method fails with errno == EPERM.
1274 2004-05-11 Jim Meyering <jim@meyering.net>
1276 Prior to this change, the save_cwd caller required read access to the
1277 current directory on most systems (ones with the fchdir function).
1279 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
1280 fails, try write-only, and finally, resort to using xgetcwd.
1282 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
1284 * obstack.c, obstack.h: Import changes from libc.
1286 2004-04-28 Bruno Haible <bruno@clisp.org>
1288 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
1289 implicitly appends .exe to executables.
1290 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
1291 accepts Windows pathnames.
1292 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1293 Cygwin like Windows, since it now accepts Windows pathnames.
1294 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1295 Cygwin like Windows, since it now accepts Windows pathnames.
1296 Reported by Derek Robert Price <derek@ximbiot.com>.
1298 2004-04-20 Jim Meyering <jim@meyering.net>
1300 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
1302 2004-04-20 Jim Meyering <jim@meyering.net>
1303 Bruno Haible <bruno@clisp.org>
1305 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
1306 memory when realloc fails.
1308 2004-04-18 Jim Meyering <jim@meyering.net>
1310 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
1311 don't leak memory and do call END_UTMP_ENT.
1313 2004-04-11 Paul Eggert <eggert@twinsun.com>
1315 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
1316 (CHAR_BIT): Remove, since we assume C89.
1317 Include <stdint.h> if available, as per current Autoconf CVS advice.
1319 2004-03-30 Paul Eggert <eggert@twinsun.com>
1321 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
1322 not bool, to be more consistent with Unix conventions.
1323 Suggested by Bruno Haible.
1325 Merge from coreutils.
1327 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
1330 * getdate.h: Include stdbool.h, and timespec.h instead of
1331 the usual <time.h> dance.
1332 (get_date): Change signature to support fractional time stamps.
1333 All callers changed.
1334 * getdate.y: Include "getdate.h" first, as we can now
1335 assume C89 and don't need to worry about 'const'.
1336 Similarly, include "unlocked-io.h" near start, not in middle.
1338 (textint.value): Use long int rather than int.
1339 (textint.digits): Use size_t rather than int.
1340 (BILLION, LOG10_BILLION): New constants.
1341 (parser_control): New member rel_ns. Members day_ordinal,
1342 time_zone, month, day, hour, minutes, rel_year, rel_month,
1343 rel_day, rel_hour, rel_minutes, rel_seconds
1344 are now long int, not int. Member seconds is now struct timespec,
1345 not int. New member timespec_seen. Members dates_seen, days_seen,
1346 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
1348 (%union.intval): Now long int, not int.
1349 New member timespec.
1350 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
1351 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
1352 (spec): Now is a timespec or an item list.
1353 (timespec, items): New nonterminals.
1354 (time, rel, relunit, number, get_date):
1355 Add support for fractional seconds.
1356 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
1357 (gmtime, localtime, mktime): Remove decls; not needed with C89.
1358 (to_hour): First arg is now long int, not int.
1359 (to_year): Returns long int, not int.
1360 Don't treat year -70 like 70.
1361 (tm_diff): Returns long int, not int.
1362 (lookup_word): Use bool instead of int when appropriate.
1363 (yylex): Use size_t for count, not int.
1364 Detect overflow when parsing large integer constants.
1365 Add support for fractions.
1366 (get_date): Make pointers 'const' if possible.
1367 Use more-portable code to detect integer overflow.
1368 (main) [TEST]: Adjust to above changes. Test for localtime failure.
1369 Don't use ctime; it's not reliable if the year has >4 digits.
1371 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
1372 This is for compatibility with BSD.
1374 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
1375 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
1376 From coreutils' system.h.
1378 * userspec.c: Don't include "posixver.h".
1379 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
1380 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
1381 compatible extension. Simplify code by removing a boolean int
1382 that was always nonzero if a string was nonnull.
1384 2004-03-30 Jim Meyering <jim@meyering.net>
1386 Merge from coreutils.
1388 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
1390 * readtokens.c (readtoken): Don't leak 64 bytes when reading
1391 an empty input stream.
1393 * readtokens.c: Include <stdbool.h>.
1394 (readtoken): Use `size_t' rather than int/long.
1395 All callers adjusted.
1396 Use `bool' rather than `int' where appropriate.
1397 Use memset rather than an explicit loop.
1398 Use x2nrealloc rather than xrealloc.
1399 Allow the use of `\0' as a delimiter.
1400 (readtokens): Likewise.
1401 * readtokens.h (readtoken, readtokens): Update prototypes.
1403 2004-03-30 Bruno Haible <bruno@clisp.org>
1405 * getloadavg.c (getloadavg): Don't assume setlocale returns
1408 2004-03-29 Paul Eggert <eggert@twinsun.com>
1410 Merge changes to getloadavg.c from coreutils and Emacs.
1412 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
1413 Define to an expression, not to the empty string.
1414 Include cloexec.h and xalloc.h.
1415 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
1416 Use set_cloexec_flag rather than rolling our own.
1417 * cloexec.c, cloexec.h: New files.
1419 2004-03-18 Paul Eggert <eggert@twinsun.com>
1421 * getopt.h: Sync with libc CVS.
1423 2004-03-18 Paul Eggert <eggert@twinsun.com>
1424 Bruno Haible <bruno@clisp.org>
1426 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
1427 not on all platforms that have <wchar.h>.
1428 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
1430 2004-03-09 Paul Eggert <eggert@twinsun.com>
1432 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
1434 * getopt_int.h: New file, also synced from libc.
1436 2004-03-07 Paul Eggert <eggert@twinsun.com>
1438 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
1439 '#if' expressions. Unlike the code it replaces, it does not
1440 depend on (defined _SC_PAGESIZE). However, it does depend on
1441 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
1442 first reported by Jason Andrade in
1443 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
1445 2004-01-18 Simon Josefsson <jas@extundo.com>
1447 * strdup.h: New file.
1448 * strdup.c: Include it.
1449 * path-concat.c: Include strdup.h. Drop strdup declaration.
1450 * userspec.c: Include strdup.h. Drop strdup declaration.
1452 2004-02-06 Karl Berry <karl@gnu.org>
1454 * config.charset: update from gettext 0.14.1.
1456 2004-02-05 Paul Eggert <eggert@twinsun.com>
1458 Add comments and code, prompted by suggestions from Bruno Haible
1460 * quotearg.h (quotearg_alloc): New decl. Improve the comments
1461 describing the enum quoting_style values.
1462 * quotearg.c (quotearg_alloc): New function.
1463 (quotearg_buffer_restyled): Treat lone { and } as special.
1464 Treat = as special. Work around bug with older shells
1465 that "see" a '\' that is really the 2nd byte of a multibyte char.
1466 Quote empty string with shell_quoting_style.
1468 2004-02-03 Bruno Haible <bruno@clisp.org>
1470 * pipe.h: New file, from GNU gettext.
1471 * pipe.c: New file, from GNU gettext.
1473 2004-01-27 Bruno Haible <bruno@clisp.org>
1475 * execute.h: New file, from GNU gettext.
1476 * execute.c: New file, from GNU gettext.
1477 * w32spawn.h: New file, from GNU gettext.
1479 2004-01-23 Paul Eggert <eggert@twinsun.com>
1481 Exit-status fix from coreutils.
1483 Use exit_failure consistently in place of EXIT_FAILURE,
1484 so that program exit statuses are consistent on failure.
1486 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
1487 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
1488 * argmatch.h: Comment fix to match the above.
1489 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
1490 Now a macro referring to exit_failure, instead of a separate
1491 variable. Include "exitfail.h" to get it.
1492 * xstrtol.h: Include "exitfail.h".
1493 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
1495 * long-options.c (parse_long_options): Use prototype
1496 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
1499 2004-01-21 Jim Meyering <jim@meyering.net>
1501 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
1502 so as not to conflict with a different-sized __mktime_internal
1503 function in GNU libc.
1504 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
1505 Problem building statically-linked `ls' reported by Michael Brunnbauer.
1507 2004-01-18 Paul Eggert <eggert@twinsun.com>
1509 Merge from diffutils.
1511 * file-type.c (file_type): Add typed memory objects.
1512 * file-type.h (S_TYPEISTMO): New macro.
1514 * c-stack.h (c_stack_action): Remove argv argument.
1515 * c-stack.c (c_stack_action): Likewise. All uses changed.
1516 (die): Don't calculate message unless segv_action returns.
1517 (get_stack_location, min_address_from_argv, max_address_from_argv,
1518 volatile stack_base, volatile_stack_size): Remove.
1519 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
1520 that every segmentation violation is a stack overflow. (Ouch!)
1521 See Debian bug 136249 (still outstanding) for more info about why
1522 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
1524 2003-11-30 Bruno Haible <bruno@clisp.org>
1526 Safer stack allocation.
1527 * setenv.c: Include allocsa.h.
1528 (alloca): Remove fallback definition.
1529 (freea): Remove macro.
1530 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
1533 2003-10-17 Bruno Haible <bruno@clisp.org>
1535 * binary-io.h: Avoid warnings on Cygwin.
1537 2003-12-28 Bruno Haible <bruno@clisp.org>
1539 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
1540 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
1542 2003-11-28 Bruno Haible <bruno@clisp.org>
1544 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
1546 2003-11-27 Bruno Haible <bruno@clisp.org>
1548 * wait-process.c: On Windows, include windows.h. Needed on mingw.
1550 2003-11-17 Bruno Haible <bruno@clisp.org>
1552 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
1554 2003-11-24 Bruno Haible <bruno@clisp.org>
1556 * xallocsa.h: New file, from GNU gettext.
1557 * xallocsa.c: New file, from GNU gettext.
1559 2003-11-24 Bruno Haible <bruno@clisp.org>
1561 * allocsa.h: New file, from GNU gettext.
1562 * allocsa.c: New file, from GNU gettext.
1564 2003-11-24 Bruno Haible <bruno@clisp.org>
1566 * eealloc.h: New file.
1568 2004-01-15 Jim Meyering <jim@meyering.net>
1570 Merge from coreutils.
1572 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
1573 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
1574 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
1576 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
1577 optional configure-time default.
1579 * version-etc.c (version_etc_copyright): Update copyright date.
1581 * xreadlink.c (xreadlink): Correct outdated comment.
1583 2004-01-15 Paul Eggert <eggert@twinsun.com>
1585 Merge from coreutils.
1587 * posixver.c: Include posixver.h.
1589 * same.c: Include <stdbool.h>, <limits.h>.
1590 (_POSIX_NAME_MAX): Define if not defined.
1592 (same_name): If file names are silently truncated, report
1593 that the file names are the same if they are the same after
1594 the silent truncation.
1596 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
1597 conversion function.
1598 * xstrtod.c (xstrtod): Likewise. All callers changed to
1599 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
1602 2004-01-14 Paul Eggert <eggert@twinsun.com>
1604 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
1605 with like-named macro in fnmatch.c.
1606 (EXT): Use an internal constant instead.
1608 Merge fnmatch patches from glibc.
1609 * fnmatch.c (mbsinit): Remove define.
1610 Add libc_hidden_ver (__fnmatch, fnmatch).
1611 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
1612 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
1614 2003-12-14 Karl Berry <karl@gnu.org>
1616 * config.charset: update from gettext-runtime.
1618 2003-12-03 Paul Eggert <eggert@twinsun.com>
1620 * getgroups.c (getgroups): xmalloc takes one argument, not two.
1621 Bug reported by Alfred M. Szmidt.
1623 2003-11-29 Karl Berry <karl@gnu.org>
1625 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
1627 2003-11-23 Paul Eggert <eggert@twinsun.com>
1628 Bruno Haible <bruno@clisp.org>
1630 * printf-parse.h: Don't include sys/types.h.
1631 (ARG_NONE): New macro.
1632 (char_directive): Change type of *arg_index fields to size_t.
1633 * printf-parse.c: Don't include sys/types.h.
1634 (SSIZE_MAX): Remove macro.
1635 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
1636 Remove unnecessary overflow check.
1637 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
1640 2003-11-24 Paul Eggert <eggert@twinsun.com>
1642 * alloca.c: Remove dependency on xalloc module.
1643 (xalloc_die): Remove.
1644 (memory_full) [!defined emacs]: New macro.
1645 [!defined emacs]: Don't include xalloc.h.
1646 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
1647 address arithmetic overflows. Change datatypes a bit to avoid
1650 2003-11-22 Jim Meyering <jim@meyering.net>
1652 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
1654 2003-11-17 Bruno Haible <bruno@clisp.org>
1656 * vasnprintf.c (alloca): Remove fallback definition.
1657 (freea): Remove definition.
1658 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
1659 Reported by Paul Eggert.
1661 2003-11-17 Jim Meyering <jim@meyering.net>
1663 On systems without utime and without a utimes function capable of
1664 dealing with a NULL struct utimbuf* argument, this utime replacement
1665 could -- in unusual circumstances -- leak a file descriptor.
1666 * utime.c: Include <unistd.h> and <errno.h>.
1667 (utime_null): Be sure to close `fd' and to preserve errno.
1668 Reported by Geoff Collyer via Arnold Robbins.
1670 2003-11-16 Paul Eggert <eggert@twinsun.com>
1671 Bruno Haible <bruno@clisp.org>
1673 Protect against address arithmetic overflow.
1674 * printf-args.h: Include stddef.h.
1675 (arguments): Change type of field 'count' to size_t.
1676 * printf-args.c (printf_fetchargs): Use size_t instead of
1677 'unsigned int' where appropriate.
1678 * printf-parse.h: Include sys/types.h.
1679 (char_directive): Change type of *arg_index fields to ssize_t.
1680 (char_directives): Change type of fields 'count', max_*_length to
1682 * printf-parse.c: Include sys/types.h and xsize.h.
1683 (SSIZE_MAX): Define fallback value.
1684 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
1685 instead of 'int' where appropriate. Check a_allocated, d_allocated
1686 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
1687 * vasnprintf.c: Include xsize.h.
1688 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
1689 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
1690 overflow. Avoid wraparound when converting a width or precision from
1693 2003-11-16 Bruno Haible <bruno@clisp.org>
1695 Update from GNU gettext.
1696 * printf-parse.c: Generalize to it can be compiled for wide strings.
1697 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
1698 * vasnprintf.c: Generalize to it can be compiled for wide strings.
1699 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
1700 SNPRINTF): New macros.
1701 Don't include <alloca.h> if the file is used inside libintl.
1702 (local_wcslen): New function, for Solaris 2.5.1.
1703 (VASNPRINTF): Use it instead of wcslen.
1705 2003-11-16 Bruno Haible <bruno@clisp.org>
1707 * xsize.h (xmax): New function.
1708 (xsum, xsum3, xsum4): Declare as "pure" functions.
1710 2003-11-12 Paul Eggert <eggert@twinsun.com>
1712 * xalloc.h: Do not include <limits.h> or <stdint.h>.
1713 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
1714 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
1715 heuristic is just as accurate as far as we know, and it removes a
1716 dependency on size_max.m4 and ptrdiff_max.m4.
1718 2003-11-12 Paul Eggert <eggert@twinsun.com>
1720 * xstrtol.c (__xstrtol): Remove "break" immediately after
1721 "return", to pacify some unknown compiler. Problem reported
1724 2003-11-11 Bruno Haible <bruno@clisp.org>
1726 * xsize.h (SIZE_MAX): Remove fallback definition.
1727 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
1730 2003-11-10 Paul Eggert <eggert@twinsun.com>
1732 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
1733 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
1734 rejected some allocations of exactly SIZE_MAX - 2 bytes.
1736 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
1737 not (size_t) -1, since it's defined here.
1739 2003-11-06 Paul Eggert <eggert@twinsun.com>
1741 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
1742 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
1743 Reject sizes of exactly SIZE_MAX bytes.
1744 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
1745 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
1747 2003-11-05 Bruno Haible <bruno@clisp.org>
1749 * xsize.h: Include limits.h, to avoid a possible collision with
1750 SIZE_MAX defined in <limits.h> on Solaris.
1752 2003-11-04 Bruno Haible <bruno@clisp.org>
1754 * xsize.h: New file.
1755 * linebreak.c: Include xsize.h.
1756 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
1757 argument for overflow.
1758 Suggested by Paul Eggert.
1760 2003-10-31 Bruno Haible <bruno@clisp.org>
1762 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
1763 to avoid (extremely rare) race condition.
1764 Suggested by Paul Eggert.
1766 2003-11-03 Jim Meyering <jim@meyering.net>
1768 * userspec.c: Include "userspec.h".
1769 * userspec.h: New file.
1771 2003-10-31 Paul Eggert <eggert@twinsun.com>
1773 * mountlist.h (struct mount_entry.me_type_malloced): New member.
1774 * mountlist.c (SIZE_MAX): Define if not defined already.
1775 (read_filesystem_list): Set and use me_type_malloced.
1776 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
1777 whatever the type happens to be), for brevity and consistency.
1778 Check for size calculation overflow on Alphas running OSF/1.
1780 2003-10-31 Jim Meyering <jim@meyering.net>
1782 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
1784 * linebuffer.c: Include <string.h> for declaration of memset.
1786 2003-10-30 Paul Eggert <eggert@twinsun.com>
1787 Bruno Haible <bruno@clisp.org>
1789 * vasprintf.c: Include <limits.h>, <stdlib.h>.
1790 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
1792 2003-10-29 Paul Eggert <eggert@twinsun.com>
1794 * xalloc.h (xalloc_oversized): Now a macro, not a function,
1795 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
1797 * quotearg.c (quotearg_n_options): Use it.
1798 * group-member.c: Include <stdbool.h>.
1799 (free_group_info): Arg is now const *; don't free arg.
1800 (get_group_info): Now returns bool and accepts struct group_info *,
1801 rather than returning a malloc'ed struct group_info *.
1802 All uses changed. Check for overflow in internal size calculation.
1804 * getusershell.c (readname): Simplify the code by using x2nrealloc
1805 rather than xmalloc/xrealloc.
1806 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
1807 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
1808 conformance bug: the old code used a pointer after freeing the
1809 storage that it addressed.
1810 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
1811 rather than doing it by hand.
1812 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
1813 the buffer preserved. Use free and xmalloc instead.
1814 * quotearg.c (quotearg_n_options): Likewise.
1815 Use a simpler test for size overflow. Don't use xalloc_oversized
1816 because unsigned int might be wider than size_t (!); this suggests
1817 that we should switch from unsigned int to size_t for slot numbers.
1819 2003-10-27 Bruno Haible <bruno@clisp.org>
1821 * stdbool_.h: Better support for BeOS.
1823 2003-10-27 Paul Eggert <eggert@twinsun.com>
1825 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
1826 to allocate the returned structure. Do not allocate a subarray,
1827 as x2nrealloc will do that.
1828 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
1829 instead of xnrealloc.
1830 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
1832 2003-10-26 Paul Eggert <eggert@twinsun.com>
1834 * xalloc.h (xalloc_oversized): New static inline function, for
1835 callers that want to do their own size-overflow checking. Include
1836 <stdbool.h>, since xalloc_oversized returns bool.
1837 * xalloc.c (array_size_overflow): Remove. All callers changed
1838 to use xalloc_oversized.
1840 Add two functions x2realloc, x2nrealloc, for programs that grow
1841 arrays dynamically by doubling their sizes.
1842 * xalloc.h (x2realloc, x2nrealloc): New decls.
1843 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
1846 Port to C99 semantics for 'inline' of external functions.
1847 Bug reported by Bruno Haible.
1848 * xmalloc.c (xnmalloc_inline): New static inline function,
1849 with the old contents of xnmalloc.
1850 (xnmalloc, xmalloc): Use it.
1851 (xnrealloc_inline): New static inline function,
1852 with the old contents of xnrealloc.
1853 (xnrealloc, xrealloc): Use it.
1855 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
1857 2003-10-25 Paul Eggert <eggert@twinsun.com>
1859 Fix several address-calculation bugs in the hash modules,
1860 plus some minor code cleanup.
1862 * hash.h: Include <stdbool.h>, for bool.
1863 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
1864 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
1865 hash_get_n_entries, hash_get_max_bucket_length,
1866 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
1867 hash_rehash): Use size_t rather than unsigned.
1868 * hash.c (struct hash_table, hash_get_n_buckets,
1869 hash_get_n_buckets_used, hash_get_n_entries,
1870 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
1871 hash_get_entries, hash_do_for_each, hash_string, is_prime,
1872 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
1874 (SIZE_MAX): Define if not defined.
1875 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
1876 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
1878 Use const * when possible.
1879 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
1880 (check_tuning): Fix bug: if tuning parameters were very close to
1881 0 or 1, rounding errors could have caused subscript violations.
1882 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
1883 (hash_initialize): Add 'fail:' label
1884 to free table and return NULL, and use it to simplify code.
1885 Use calloc rather than clearing the storage ourself.
1886 (hash_initialize, hash_rehash): Check for arithmetic overflow in
1887 buffer size calculations.
1888 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
1889 Include <stddef.h>, for size_t.
1890 * hash-pjw.c (hash_pjw): Likewise.
1891 Switch to method described by Bruno Haible.
1892 Include <limits.h>, for CHAR_BIT.
1893 (SIZE_BITS): New macro.
1895 2003-10-21 Paul Eggert <eggert@twinsun.com>
1897 * getndelim2.c (getndelim2): When size calculation overflows,
1898 ceiling the allocation at NMAX bytes rather than silently
1899 discarding input bytes before NMAX is reached. This makes
1900 a difference only if NMAX exceeds SIZE_MAX / 2.
1902 * obstack.c: Merge from glibc.
1903 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
1904 Add libc_hidden_def (_obstack_newchunk).
1905 (_obstack_free) [! defined _LIBC]: Remove.
1906 [defined _LIBC]: Make a strong alias from obstack_free, rather than
1907 a clone of the function body.
1908 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
1909 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
1911 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
1912 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
1915 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
1916 (obstack_ptr_grow_fast, obstack_int_grow_fast):
1917 Don't use lvalue casts, as GCC plans to remove support for them
1918 in GCC 3.5. Reported by Joseph S. Myers. This bug
1919 was also present in the non-GCC version, indicating that this
1920 code had always been buggy and had never been widely used.
1921 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
1922 Use the fast variant of each macro, rather than copying the
1923 definiens of the fast variant; that way, we'll be more likely to
1924 catch future bugs in the fast variants.
1926 2003-10-20 Bruno Haible <bruno@clisp.org>
1928 * wait-process.h: New file, from GNU gettext.
1929 * wait-process.c: New file, from GNU gettext.
1931 2003-10-19 Jim Meyering <jim@meyering.net>
1933 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
1935 2003-10-16 Paul Eggert <eggert@twinsun.com>
1937 * getgroups.c: Include <errno.h>, <stdlib.h>.
1938 (getgroups): First arg is int, not size_t.
1939 Don't let 'free' mangle errno.
1941 2003-10-16 Jim Meyering <jim@meyering.net>
1943 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
1945 2003-10-15 Paul Eggert <eggert@twinsun.com>
1947 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
1949 (new_exclude, add_exclude_file): Initial size no longer needs to
1951 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
1952 our own address arithmetic overflow checking.
1954 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
1955 (fnmatch): Do not alloca more than 2000 wide characters;
1956 instead, use malloc for large buffers.
1957 Check for address arithmetic overflow, and return -1
1958 with errno set to ENOMEM in that case.
1959 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
1960 (NEW_PATTERN): Do not alloca more than 8000 bytes;
1961 instead, return -1. Check for address arithmetic overflow.
1963 2003-10-14 Paul Eggert <eggert@twinsun.com>
1965 Handle invalid suffixes and overflow independently, so that
1966 callers can treat them independently as needed. Fix some bugs in
1967 suffix handling, e.g., "100k@" was not diagnosed as an invalid
1968 suffix for a human-readable blocksize. The major caller-visible
1969 change is the addition of a new
1970 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
1971 that both overflow and suffix chars were found.
1973 * human.c (humblock): Don't check separately for invalid suffix
1974 char; that is xstrtoumax's job (now that its bug is fixed).
1975 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
1976 INTMAX_MAX]: New macros.
1977 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
1978 TYPE_MAXIMUM): New macros.
1979 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
1980 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
1981 if overflow occurs, as it's what __strtol does and it's more useful
1983 (__xstrtol): If __strtol reports some error other than ERANGE,
1984 reflect it to the caller as LONGINT_INVALID. If it reports
1985 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
1986 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
1987 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
1989 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
1990 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
1991 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
1992 [defined UINTMAX_MAX]: New macros.
1994 2003-10-14 Bruno Haible <bruno@clisp.org>
1996 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
1997 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
1998 Also use volatile where needed.
2000 2003-10-12 Paul Eggert <eggert@twinsun.com>
2002 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2003 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2004 and define in terms of the other primitives.
2005 * xmalloc.c: Include stdbool.h; do not include exit.h.
2006 (SIZE_MAX): Define if not already defined.
2007 (array_size_overflow): New function.
2008 (xalloc_die): Abort instead of exiting if 'error' returns.
2009 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2010 (xmalloc, xrealloc): Use them.
2011 (xcalloc): Check for address arithmetic overflow.
2012 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2013 a bit faster than strcpy.
2015 2003-10-08 Paul Eggert <eggert@twinsun.com>
2017 Merge getpass from libc, plus a few fixes.
2019 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2020 Include <stdbool.h>.
2021 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2022 __fsetlocking to empty.
2023 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2024 do include <bits/libc-lock.h>.
2025 Do not include <fcntl.h>; not needed.
2026 [_LIBC]: Include <wchar.h>.
2027 (NOTCANCEL_MODE): New macro.
2028 (flockfile, funlockfile) [_LIBC]: New macros.
2029 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2030 [!_LIBC]: New macros.
2031 (call_fclose): New function.
2032 (getpass): Use it. Save tty stream separately; this simplifies the
2033 code and makes it more reliable if stdin happens to equal stdout.
2034 Invoke __fsetlocking on tty.
2035 Handle thread cancellation if needed.
2036 Namespace cleanup (use __tcgetattr, __getline).
2037 Use bool for Booleans.
2038 [USE_IN_LIBIO]: Handle wide streams.
2039 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2040 stream might go where.
2042 * unlocked-io.h: Include <stdio.h>, so that the caller
2043 doesn't have to include <stdio.h> before us.
2044 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2045 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2046 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2047 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2048 if not declared, so that we can use getpass.c code from libc without
2050 (flockfile, ftrylockfile, funlockfile): New macros.
2052 2003-10-06 Bruno Haible <bruno@clisp.org>
2054 * version-etc-2.h: Remove file.
2055 * version-etc-2.c: Remove file.
2057 2003-09-25 Jim Meyering <jim@meyering.net>
2058 Bruno Haible <bruno@clisp.org>
2060 This lets translators provide better translations for the
2061 "Written by ..." part of --version output.
2062 * version-etc.h: Include stdarg.h.
2063 (version_etc_copyright): Declare as readonly.
2064 (version_etc): Make this function variadic with a NULL-terminated list
2065 of author name strings.
2066 (version_etc_va): New declaration.
2067 * version-etc.c: Include stdarg.h, stdlib.h.
2068 (version_etc_copyright): Declare as readonly.
2069 (version_etc_va): New function. Provide a different translatable string
2070 for each possible number of authors < 10. Abbreviate when there are 10
2072 (version_etc): Make this function variadic. Call version_etc_va.
2073 Suggestion from Gary V. Vaughan.
2075 * long-options.h (parse_long_options): Change prototype: the authors
2076 string is moved to the end and becomes variadic.
2077 * long-options.c: Include stdarg.h.
2078 (parse_long_options): Make this function variadic, too.
2079 Call version_etc_va, not version_etc.
2081 2003-10-06 Bruno Haible <bruno@clisp.org>
2083 * fatal-signal.h: New file, from GNU gettext.
2084 * fatal-signal.c: New file, from GNU gettext.
2086 2003-10-04 Karl Berry <karl@gnu.org>
2088 * argp*: update from libc.
2090 2003-10-01 Larry Jones <lawrence.jones@eds.com>
2092 * getpass.c (getpass): Use a no-op fseek when switching from input to
2093 output mode on the same stream.
2095 2003-09-29 Paul Eggert <eggert@twinsun.com>
2097 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2098 Fix arg typo in previous patch.
2100 2003-09-28 Jim Meyering <jim@meyering.net>
2102 * error.c: Correct cpp indentation.
2104 2003-09-27 Paul Eggert <eggert@twinsun.com>
2106 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
2107 Omit the special code that used __typeof__, since we worry that
2108 it could be more trouble than it's worth. See:
2109 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
2110 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
2114 2003-09-26 Jim Meyering <jim@meyering.net>
2116 * error.c (error_tail): Move some declarations
2117 into inner scope where the local variables are used.
2119 2003-09-26 Bruno Haible <bruno@clisp.org>
2121 * stpncpy.h (gnu_stpncpy): New declaration.
2122 (stpncpy): Define as alias for gnu_stpncpy.
2123 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
2125 2003-09-26 Paul Eggert <eggert@twinsun.com>
2127 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
2128 (error_tail): Do not loop, reallocating temporary buffer, since
2129 the output cannot contain more wide characters than the input
2130 contains bytes, the size must be big enough already. This avoids
2131 one potential size overflow calculation. Check for size overflow
2132 when calculating temporary buffer size. Free temporary buffer
2133 when done, if it was allocated with malloc; this plugs a memory
2134 leak. Remove casts from void * to pointers, that are no longer
2135 needed now that we're assuming C89 or better.
2137 Merge error changes from glibc.
2139 * error.c, error.h: Update copyright notice header to match glibc.
2140 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
2141 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
2142 Disable cancellation while printing error.
2143 * error.h: Prepend __ to parameter names.
2145 2003-09-25 Karl Berry <karl@gnu.org>
2147 * argp-fmtstream.c, argp-help.c: update from libc.
2149 2003-09-25 Bruno Haible <bruno@clisp.org>
2151 * version-etc-2.h: New file, from version-etc.h with modifications.
2152 * version-etc-2.c: New file, from version-etc.c with modifications.
2154 2003-09-25 Simon Josefsson <jas@extundo.com>
2156 * xgetdomainname.h: New file.
2157 * xgetdomainname.c: New file.
2159 2003-09-25 Simon Josefsson <jas@extundo.com>
2160 Bruno Haible <bruno@clisp.org>
2162 * getdomainname.h: New file.
2163 * getdomainname.c: New file.
2165 2003-09-24 Paul Eggert <eggert@twinsun.com>
2167 * linebuffer.c (freebuffer): Don't free the argument, just
2168 the buffer associated with the argument. Bug reported by
2171 2003-09-19 Karl Berry <karl@gnu.org>
2173 * argp.h: update from libc.
2175 2003-09-16 Paul Eggert <eggert@twinsun.com>
2177 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2178 input error, instead of returning NULL the next time we are called
2179 (and therefore losing track of errno).
2181 2003-09-15 Paul Eggert <eggert@twinsun.com>
2183 * getndelim2.c (getndelim2): Don't trash errno when a read
2184 fails, so that the caller gets the proper errno.
2186 * readutmp.c (read_utmp): Likewise.
2187 Check for fstat error. Close stream and free storage
2190 2003-09-14 Bruno Haible <bruno@clisp.org>
2192 * fwriteerror.h: New file.
2193 * fwriteerror.c: New file.
2195 2003-09-14 Jim Meyering <jim@meyering.net>
2197 * getloadavg.c: Correct cpp indentation.
2198 * strdup.c: Likewise.
2199 * vasnprintf.c: Likewise.
2201 2003-09-12 Paul Eggert <eggert@twinsun.com>
2203 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
2204 * obstack.c [!defined _LIBC]: Likewise.
2205 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2206 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2207 * exitfail.c: Don't include stdlib.h; no longer needed.
2209 More changes to assume C89 or better.
2211 * error.c (error_tail): Assume vprintf.
2213 * argmatch.c (getenv): Remove decl.
2214 * progreloc.c (get_full_program_name): Define via prototype.
2215 * setenv.c (clearenv): Likewise.
2216 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
2218 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
2219 (malloc, memcpy): Remove decls.
2220 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2221 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2222 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2223 (memcpy): Remove macro.
2224 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2225 (__P): Remove. All uses removed.
2226 (PTR): Remove. All uses changed to void *.
2227 (CHAR_BIT, NULL): Remove.
2228 (spaces, zeros, memset_space, memset_zero)
2229 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2231 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2232 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2233 Define with prototype.
2234 Remove now-unnecessary prototype decl.
2235 (extra_args_spec): Assume ANSI C. All uses changed.
2236 (extra_args_spec_iso): Remove.
2237 (my_strftime, emacs_strftimeu): Define via prototype.
2238 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2240 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2241 * strtoimax.c: Include <stdlib.h> unconditionally.
2242 (strtoul, strtol): Remove decls.
2243 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2245 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2246 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2247 (LOCALE_PARAM_PROTO): New macro.
2248 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2249 (INTERNAL (strtol), strtol): Define with a prototype.
2250 (PARAMS): Remove. All uses removed.
2251 * tempname.c: Include <string.h> unconditionally.
2252 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
2253 * xgethostname.c (main): Define with a prototype.
2254 * xmalloc.c: Include "xalloc.h" first, to check interface.
2255 Include <stdlib.h> unconditionally.
2256 (calloc, malloc, realloc, free): Remove decls.
2257 * xstrtod.c: Include "xstrtod.h" first, to check interface.
2258 Include <stdlib.h> unconditionally. Sort include file names.
2260 (xstrtod): Define with a prototype.
2261 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
2262 (strtol, strtoul): Remove decls.
2264 2003-09-11 Paul Eggert <eggert@twinsun.com>
2266 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
2267 Include <stdlib.h>, <string.h> unconditionally.
2268 Remove now-unnecessary cast to char *.
2269 * strnlen.c: Include <string.h> unconditionally.
2270 * yesno.c (yesno): Define with a prototype.
2272 2003-09-10 Bruno Haible <bruno@clisp.org>
2274 * strcspn.c: Include <string.h> unconditionally.
2275 * strpbrk.c: Include <string.h> unconditionally.
2276 * strstr.c: Include <string.h> unconditionally.
2277 * unicodeio.c: Include <string.h> unconditionally.
2278 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
2279 * unsetenv.c: Likewise.
2280 * xreadlink.c: Include <stdlib.h> unconditionally.
2281 * yesno.c: Include <stdlib.h> unconditionally.
2282 (rpmatch): Add prototype.
2284 2003-09-10 Jim Meyering <jim@meyering.net>
2286 * error.c: Correct indentation of cpp directives.
2288 2003-09-09 Paul Eggert <eggert@twinsun.com>
2292 * acosl.c (main): Use a prototype.
2293 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
2296 * getloadavg.c (getloadavg, main): Define via prototypes.
2298 * getopt.h (struct option.name): Assume C89, and use 'const'.
2299 (getopt, etopt_long, getopt_long_only, _getopt_internal)
2300 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
2302 * getopt.c (const): Remove macro.
2303 Include <string.h> unconditionally.
2304 (my_index): Remove; all uses changed to strchr.
2305 (strlen): Remove decl.
2306 (exchange): Remove forward decl; no longer needed.
2307 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
2308 Define with prototype.
2309 * getopt1.c (const): Remove macro.
2310 (getopt_long, getopt_long_only, main): Define with prototype.
2312 * getugroups.c: Include <string.h> unconditionally.
2314 * getusershell.c: Include <stdlib.h> unconditionally.
2315 (getusershell, setusershell, endusershell, readname, main):
2316 Define with prototypes.
2318 * group-member.c: Include group-member.h first.
2319 Include <stdlib.h> unconditionally.
2321 * hard-locale.c: Include hard-locale.h first.
2322 Include <stdlib.h>, <string.h> unconditionally.
2324 * hash.c (free, malloc): Remove decls.
2325 Include <stdlib.h> unconditionally.
2327 * human.c: Include <stdlib.h>, <string.h> unconditionally.
2328 (getenv): Do not declare.
2330 * idcache.c: Include <string.h> unconditionally.
2332 * long-options.c: Include long-options.h first, to test interface.
2333 Include <stdlib.h> unconditionally.
2335 * makepath.c: Include makepath.h first, to test interface.
2336 Include <stdlib.h> and <string.h> unconditionally.
2338 * linebuffer.c: Include <stdlib.h>.
2339 (free): Remove decl.
2341 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
2342 rpl_malloc returns void *, not char *.
2343 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
2345 * md5.h: Include <limits.h> unconditionally.
2346 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
2347 (__P): Remove; all uses removed.
2348 * md5.c: Include "md5.h" first.
2349 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
2350 md5_buffer, md5_process_bytes, md5_process_block):
2351 Define with prototypes.
2352 * sha.h (__P): Remove all uses. (It wasn't defined??)
2353 * sha.c: Include "sha.h" first.
2354 Include <stdlib.h>, <string.h> unconditionally.
2356 * memchr.c (__ptr_t): Remove; all uses changed to void *.
2357 * memcmp.c (__ptr_t): Likewise.
2358 * memrchr.c (__ptr_t): Likewise.
2359 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
2360 Include <string.h> unconditionally.
2361 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
2362 * memchr.c: Include <stdlib.h> unconditionally.
2363 * memchr.c (LONG_MAX): Remove.
2364 * memrchr.c (LONG_MAX): Likewise.
2365 * memchr.c (__memchr): Define via a prototype.
2366 * memrchr.c (__memrchr): Likewise.
2367 * memcmp.c (__P): Remove, and remove all uses.
2368 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
2369 Remove forward decls; no longer needed.
2370 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
2371 Use types required by C89 in prototype.
2373 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
2374 * savedir.c: Likewise.
2375 * mkdir.c (free): Remove decl.
2376 * rmdir.c (rmdir): Define with a prototype.
2377 * savedir.c: Include savedir.h first, to test interface.
2379 * mktime.c (STDC_HEADERS): Remove.
2380 Include <stdlib.h>, <string.h> unconditionally.
2382 * modechange.c: Include <stdlib.h> unconditionally.
2383 (malloc): Remove decl.
2385 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
2386 (free): Remove decl.
2388 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
2389 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
2390 (This type really should be intptr_t, but that's a C99ism.)
2391 (_obstack_memcpy): Remove: all uses changed to memcpy.
2392 Include <string.h> unconditionally.
2393 (struct obstack): Assume __STDC__ for types of members
2394 chunkfun, freefun, extra_arg.
2395 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
2396 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
2397 obstack_begin, obstack_specify_allocation,
2398 obstack_specify_allocation_with_arg, obstack_chunkfun,
2399 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
2400 Remove unprototyped decls and the macros that use them.
2401 * obstack.c (POINTER): Remove. All uses changed to void *.
2402 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
2403 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
2404 (defined __STDC__ && __STDC__)]:
2405 Remove nonprototyped code.
2406 Include <stdlib.h> unconditionally.
2407 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
2408 _obstack_allocated_p, _obstack_free, obstack_free,
2409 _obstack_memory_used, print_and_abort):
2410 Define using prototypes.
2411 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
2412 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
2413 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
2414 obstack_next_free, obstack_object_size, obstack_room) [0]:
2415 Remove unused, unprototyped code.
2417 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
2419 * physmem.c (physmem_total, physmem_available, main): Define
2422 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
2423 (main): Define with a prototype.
2425 * posixver.c (getenv): Remove decl.
2427 * putenv.c (malloc): Returns void *, not char *.
2428 Include <string.h> unconditionally.
2429 (strchr, memcpy, NULL): Do not define.
2431 * readtokens.c: Include readtokens.h first, to test interface.
2432 Include <stdlib.h>, <string.h> unconditionally.
2433 (init_tokenbuffer): Define with a prototype.
2435 * regex.c (PARAMS): Remove. All uses removed.
2436 All uses of _RE_ARGS removed, too.
2437 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2439 (bzero): Assume memset exists.
2440 (memcmp, memcpy, NULL): Remove.
2441 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
2442 char, or assignments to local vars of type signed char.
2443 (init_syntax_once, PREFIX(extract_number_and_incr),
2444 PREFIX(print_partial_compiled_pattern),
2445 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
2446 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
2447 PREFIX(regex_grow_registers), PREFIX(regex_compile),
2448 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
2449 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
2450 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
2451 wcs_compile_range, byte_compile_range, truncate_wchar,
2452 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
2453 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
2454 count_mbs_length, wcs_re_match_2_internal,
2455 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
2456 PREFIX(alt_match_null_string_p),
2457 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
2458 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
2459 regfree, PREFIX(extract_number)): Define with prototype. Remove
2460 now-unnecessary declaration, if any.
2461 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
2463 Remove now-unnecessary casts among pointer types.
2464 * regex.h (_RE_ARGS): Remove. All uses removed.
2466 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
2467 (free): Remove decl.
2469 * rpmatch.c: Include <stdlib.h> unconditionally.
2471 * same.c: Include <stdlib.h>, <string.h> unconditionally.
2472 (free): Remove decl.
2474 * save-cwd.c: Include <stdlib.h> unconditionally.
2475 * xgetcwd.c: Likewise.
2477 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
2478 (free): Remove decl.
2480 * strchrnul.c (strchrnul): Define with a prototype.
2481 Fix bug: c_in was not converted to char before searching.
2483 The following changes are not K&R related:
2485 * group-member.h: Include <sys/types.h>, so that this file is
2487 * makepath.h: Likewise.
2489 * getusershell.c (readname, default_index, line_size, readname):
2490 Use size_t, not int, for sizes.
2491 (readname): If the size overflows, report an error instead of
2494 2003-09-09 Derek Robert Price <derek@ximbiot.com>
2496 * getndelim2.c: Assume stdlib.h per the C89 spec.
2498 2003-09-08 Paul Eggert <eggert@twinsun.com>
2500 Assume C89 or better; remove K&R cruft.
2501 A few of these changes were first proposed by Derek Robert Price
2502 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
2504 * addext.c: Include <string.h> unconditionally.
2505 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
2506 Don't declare getenv or malloc.
2508 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
2509 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
2511 (find_stack_direction, alloca): Use prototypes.
2513 * atexit.c (atexit): Define using a prototype.
2515 * basename.c, dirname.c, stripslash.c:
2516 Include <string.h> unconditionally.
2518 * bcopy.c: Include <stddef.h>.
2519 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
2521 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
2523 * error.h (error, error_at_line, error_print_progname)
2524 [! (defined (__STDC__) && __STDC__)]: Remove decls.
2525 * error.c: Include error.h first, to check interface.
2526 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2527 (VA_START): Remove; all uses changeed to va_start.
2528 (exit, strerror): Remove decls.
2529 (error_print_progname): Prototype uncondionally.
2530 Don't include <errno.h>; no longer needed.
2531 (private_strerror): Remove.
2532 (error_tail): Always define.
2533 (error, error_at_line): Assume C89 or better; always use prototypes.
2534 * fatal.c: Include "fatal.h" first, to test interface.
2535 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2536 (VA_START): Remove; all uses changed to va_start.
2537 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
2539 (exit): Remove decl.
2540 (fatal): Prototype unconditionally. Assume va_start works.
2541 Abort at end, to pacify gcc.
2543 * euidaccess.c (main): Define with a prototype.
2545 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
2547 * exitfail.c: Include <stdlib.h> unconditionally.
2549 * fnmatch_.h (__P): Remove. All uses changed to assume
2551 * fnmatch.c: Include fnmatch.h first, to test interface.
2552 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
2553 (getenv): Remove decl.
2554 (fnmatch): Define using a prototype.
2555 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
2556 (FCT): Define using a prototype.
2558 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
2560 * gethostname.c: Include <stddef.h>.
2561 (gethostname): Define with prototype. Length is size_t, not int.
2563 2003-09-08 Paul Eggert <eggert@twinsun.com>
2565 * getversion.c: Remove; was migrated to backupfile.c in 1997.
2566 getversion.c should have been removed then, but was accidentally
2569 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
2570 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
2572 2003-09-07 Paul Eggert <eggert@twinsun.com>
2574 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
2575 copy_tm_result. Bug reported by Simon Josefsson in
2576 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
2578 2003-09-06 Paul Eggert <eggert@twinsun.com>
2580 * time_r.c, time_r.h: New files.
2582 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
2584 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
2585 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
2587 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
2589 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
2590 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
2593 * timegm.c: Switch to glibc implementation, with the following changes:
2594 [defined HAVE_CONFIG_H]: Include <config.h>.
2595 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
2596 (__mktime_internal) [!defined _LIBC]: New decl.
2597 (__gmtime_r) [!defined _LIBC]: New macro and function.
2598 (timegm): Use a prototype, since gnulib assumes C89.
2599 Do not bother declaring tmp to be const, as it's not really usefu.
2600 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
2601 (timegm): Declare only if HAVE_DECL_TIMEGM.
2603 2003-09-03 Paul Eggert <eggert@twinsun.com>
2605 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
2606 Bug reported by Lute Kamstra in
2607 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
2609 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
2610 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
2611 course with correspondingly smaller numbers for tomorrow and
2612 yesterday. From Tadayoshi Funaba. Originally installed into
2613 sh-utils on 1999-08-07, but the patch got lost (I guess during the
2616 2003-08-31 Simon Josefsson <jas@extundo.com>
2618 * timegm.h: New file.
2619 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
2621 2003-08-31 Karl Berry <karl@gnu.org>
2623 * argp.h: update from libc.
2625 2003-08-28 Bruno Haible <bruno@clisp.org>
2627 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
2628 warning on QNX, which defines O_BINARY to 000000.
2630 2003-08-24 Bruno Haible <bruno@clisp.org>
2632 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
2633 MSVC7 <stdio.h> is included later.
2635 2003-08-20 Bruno Haible <bruno@clisp.org>
2637 * progname.h: New file, from GNU gettext.
2638 * progname.c: New file, from GNU gettext.
2639 * progreloc.c: New file, from GNU gettext.
2641 2003-08-19 Bruno Haible <bruno@clisp.org>
2643 * xstrdup.c: Assume <string.h> exists.
2645 2003-08-18 Jim Meyering <jim@meyering.net>
2647 * setenv.h: Indent nested cpp directive.
2648 * vasnprintf.c: Remove trailing blanks.
2650 2003-08-17 Simon Josefsson <jas@extundo.com>
2651 Bruno Haible <bruno@clisp.org>
2653 * xstrndup.h: New file.
2654 * xstrndup.c: New file.
2656 2003-08-17 Bruno Haible <bruno@clisp.org>
2658 * strndup.h: New file.
2660 2003-08-16 Paul Eggert <eggert@twinsun.com>
2662 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
2663 space, undoing this 2003-08-12 change:
2664 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
2666 2003-08-16 Jim Meyering <jim@meyering.net>
2668 Merge from coreutils.
2669 * xstrtoimax.c: #else #if -> #elif.
2670 * xstrtoumax.c: Likewise.
2672 2003-08-15 Paul Eggert <eggert@twinsun.com>
2674 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
2675 rather than tab, after '#' in shell-script copyright notices.
2676 Suggested by Bruno Haible.
2678 2003-08-15 Jim Meyering <jim@meyering.net>
2679 and Paul Eggert <eggert@twinsun.com>
2681 Merge from coreutils.
2682 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
2683 member but strut utmpx does not. Needed for AIX 4.3.3.
2684 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
2686 2003-08-15 Jim Meyering <jim@meyering.net>
2688 Merge from coreutils.
2689 * xgethostname.c: Include <stdlib.h>.
2690 (xghostname): Don't exit for anything other than memory-related
2691 failure; just return NULL.
2692 * userspec.c: Include "posixver.h".
2693 (parse_user_spec): Accept `.' as a separator only
2694 in pre-POSIX-200112 mode.
2695 * strtoimax.c: Use #elif rather than #else #if.
2696 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
2697 Remove function, now that we can rely on a working tzset function.
2698 [!_LIBC]: Ensure that the required autoconf test has been run.
2699 [!defined _NL_CURRENT && HAVE_STRFTIME]:
2700 Use underlying_strftime for %r.
2701 * sha.c: Merge in some clean-up and optimization changes from glibc.
2702 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
2703 Ensure that it is a multiple of 64.
2704 Rearrange loop exit tests so as to avoid performing an
2705 additional fread after encountering an error or EOF.
2706 * realloc.c: Update copyright date.
2708 2003-08-14 Jim Meyering <jim@meyering.net>
2710 Merge from coreutils.
2711 * obstack.h: Whitespace changes.
2712 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
2713 and xcalloc return values.
2714 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
2715 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
2716 hang on OSF/1 5.1 for DIR on both local and remote file systems.
2717 Reported by (and fix confirmed by) Nelson H. F. Beebe.
2718 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2720 Use mntctl's return value to drive the entry-processing loop, since
2721 we can't rely on the value of the vmt_length member in the last
2722 entry. On some systems doing so could result in exhausting
2723 virtual memory. Based in part on a patch from Mike Jetzer.
2725 2003-08-14 Jim Meyering <jim@meyering.net>
2726 and Paul Eggert <eggert@twinsun.com>
2728 Merges from coreutils, plus other fixes.
2729 * physmem.c: Merge in portability changes from gcc/libiberty
2730 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
2731 for credits and details. Thanks to Kaveh Ghazi for helping
2732 to keep these files in sync.
2733 (ARRAY_SIZE): Define it.
2734 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
2735 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
2736 (memcasecmp): Don't assume size_t fits in unsigned int.
2737 Remove casts and duplicate code.
2738 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
2739 (memcpy): Remove definition.
2740 Merge in some clean-up and optimization changes from glibc.
2741 [BLOCKSIZE]: Move definition to top of file.
2742 Ensure that it is a multiple of 64.
2743 Rearrange loop exit tests so as to avoid performing an
2744 additional fread after encountering an error or EOF.
2745 * md5.h (md5_uintptr): Define.
2746 * makepath.c (CLEANUP_CWD): Report an error if we failed to
2747 return to the initial working directory. Preserve errno
2749 * idcache.c: Include "xalloc.h".
2750 (xmalloc, xrealloc): Remove decls.
2751 (getuser): Remove casts no longer required in C89.
2752 * human.c: Include stdio.h, for sprintf.
2753 * group-member.c: Include "xalloc.h".
2754 (xmalloc, xrealloc): Remove decls.
2755 (get_group_info): Remove casts no longer required in C89.
2756 * getusershell.c (readname): Remove casts no longer required in C89.
2757 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
2758 * getline.c: Whitespace fix, from coreutils.
2760 2003-08-13 Paul Eggert <eggert@twinsun.com>
2762 * exclude.c: Include <ctype.h>
2763 (IN_CTYPE_DOMAIN): New macro.
2765 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
2768 * argp-help.c, argp-parse.c, config.charset, getopt.h:
2769 Undo previous (whitespace-only) change.
2771 2003-08-12 Paul Eggert <eggert@twinsun.com>
2773 * argp-help.c, argp-parse.c, config.charset, getopt.h:
2774 Normalize leading white space and remove trailing white space.
2775 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
2776 notice, as per ../config/srclist-update.
2778 Merge from coreutils.
2779 * euidaccess.h: New file.
2780 * euidaccess.c: Include it.
2781 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
2782 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
2783 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
2785 2003-08-11 Bruno Haible <bruno@clisp.org>
2787 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
2788 (vasnprintf): Use it instead of wcslen.
2790 2003-08-11 Bruno Haible <bruno@clisp.org>
2792 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
2793 value to ensure that _Bool promotes to int. Use #define for _Bool when
2794 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
2796 2003-08-10 Karl Berry <karl@gnu.org>
2798 * regex.h: update from libc (whitespace fix).
2800 2003-08-09 Paul Eggert <eggert@twinsun.com>
2802 Merge some files from coreutils. These changes were
2803 originally made by Jim Meyering.
2804 * acl.c: Include <sys/types.h> before <sys/stat.h>;
2805 many older Unixes require this.
2806 * alloca.c (alloca): Remove cast to argument of free;
2807 no longer needed in C89.
2808 * alloca_.h, regex.h: Fix white space to match
2809 what GNU indent does.
2811 2003-08-05 Paul Eggert <eggert@twinsun.com>
2813 * bumpalloc.h: Remove.
2815 2003-08-04 Paul Eggert <eggert@twinsun.com>
2817 * getloadavg.c: Change copyright notice and spacing to conform to
2820 Merge from coreutils.
2821 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
2823 * getdate.y (date): Also accept dates like May-23-2003; suggestion
2824 from Karl Berry, implemented by Jim Meyering.
2825 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
2826 from Dmitry V. Levin.
2827 Remove anachronistic cast of xrealloc.
2828 * fnmatch_.h (__const): Remove. Use 'const'.
2829 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
2830 type. Otherwise, it wouldn't compile with at least /bin/cc on
2831 ymp-cray-unicos9.0.2.X.
2832 Combine two mostly-identical uses of alloca into one.
2833 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
2835 2003-08-04 Dave Love <d.love@dl.ac.uk>
2839 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
2840 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
2841 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
2842 obsolete NLIST_NAME_UNION.
2843 [__GNU__]: Undef BSD and FSCALE.
2844 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
2846 2003-08-03 Paul Eggert <eggert@twinsun.com>
2848 * stdbool_.h (_Bool): Make it signed char, instead of
2849 an enum type, so that it's guaranteed to promote to int. See:
2850 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
2852 2003-07-31 Paul Eggert <eggert@twinsun.com>
2854 * strerror.c: Include config.h, limits.h. Declare sprintf.
2855 (strerror): Don't assume that a printable int fits in 14 bytes.
2857 2003-07-24 Derek Robert Price <derek@ximbiot.com>
2858 Bruno Haible <bruno@clisp.org>
2860 * getline.h (getline, getdelim): Change return type to ssize_t.
2861 * getline.c (getline, getdelim): Likewise.
2862 Remove _GNU_SOURCE define; now it's defined in config.h through
2865 2003-07-22 Paul Eggert <eggert@twinsun.com>
2867 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
2868 over-parenthesization in macros.
2870 Sync with coreutils.
2872 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
2875 Use `exit_failure' for xalloc and xmemcoll instead of their own
2876 private exit-failure variables.
2877 * xalloc.h (xalloc_exit_failure): Remove.
2878 * xmalloc.c: Likewise. Include exitfail.h.
2879 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
2880 * xmemcoll.h (xmemcoll_exit_failure): Remove.
2881 * xmemcoll.c: Likewise. Include exitfail.h.
2882 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
2884 2003-07-18 Paul Eggert <eggert@twinsun.com>
2886 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
2887 * closeout.c: Likewise. Include "closeout.h" right after config.h,
2888 to test that it can stand by itself. Include "exitfail.h".
2889 Clients should set exit_failure instead.
2890 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
2892 2003-07-18 Andreas Schwab <schwab@suse.de>
2894 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
2896 2003-07-18 Bruno Haible <bruno@clisp.org>
2898 * getndelim2.h: New file.
2899 * getndelim2.c: Make into a module of its own. Include config.h,
2901 (getndelim2): Make non-static. Change return type to ssize_t.
2902 * getline.h: Change argument names.
2903 * getline.c: Include getndelim2.h instead of getndelim2.c.
2904 * getnline.c: Include getndelim2.h.
2906 2003-07-17 Bruno Haible <bruno@clisp.org>
2908 * Makefile.am: Remove file.
2909 * Makefile.in: Remove file.
2911 2003-07-17 Bruno Haible <bruno@clisp.org>
2913 * getnline.h: New file.
2914 * getnline.c: New file.
2915 * getndelim2.c: New file, extracted from getline.c.
2916 (getndelim2): Renamed from getdelim2, with added nmax argument.
2917 * getline.c: Include getndelim2.c.
2918 (getdelim2): Moved out to getndelim2.c.
2919 (getline, getdelim): Update.
2921 2003-07-15 <karl@gnu.org>
2923 * vasnprintf.c: update from gettext.
2925 2003-07-15 Jim Meyering <jim@meyering.net>
2927 * makepath.c (make_path): Enclose diagnostic in _(...).
2929 2003-07-14 Paul Eggert <eggert@twinsun.com>
2931 * asnprintf.c, asprintf.c, config.charset, gettext.h,
2932 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
2933 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
2934 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
2935 vasprintf.c, vasprintf.h: Regenerate. These files are now being
2936 updated automatically by ../config/srclist-update. This changes
2937 their license from LPGL to GPL.
2939 2003-07-14 Jim Meyering <jim@meyering.net>
2941 Don't emit diagnostics. Let callers do that.
2942 * save-cwd.c: Don't include "error.h".
2943 (save_cwd): Don't call error. Ensure that errno is valid
2944 when returning nonzero.
2946 * save-cwd.h (restore_cwd): Update prototype.
2947 * save-cwd.c (restore_cwd): Remove two parameters.
2948 Simplify. Don't call error upon failure. Let callers do that.
2949 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
2950 when auditing is enabled. But don't bother updating the #if.
2952 2003-07-14 Simon Josefsson <jas@extundo.com>
2954 * mempcpy.h: New file.
2955 * mempcpy.c: New file.
2957 2003-07-14 Paul Eggert <eggert@twinsun.com>
2959 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
2960 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
2961 unicodeio.c, unicodeio.h, unlocked-io.h:
2962 Switch from LGPL to GPL.
2964 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
2966 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
2967 it breaks C++ compilation.
2968 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
2970 2003-07-10 Jim Meyering <jim@meyering.net>
2972 * vasnprintf.c: Remove trailing blanks.
2973 Make cpp indentation consistent.
2975 2003-07-09 Paul Eggert <eggert@twinsun.com>
2977 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
2978 posixver.c, strftime.c, strnlen.c, strverscmp.c:
2979 Switch from LGPL to GPL.
2981 2003-07-07 Paul Eggert <eggert@twinsun.com>
2983 * mktime.c: Fix some boundary cases and remove need for floating point.
2985 Issue a compile-time diagnostic if time_t is floating point, or if
2986 two's complement arithmetic is not in effect, or if arithmetic
2987 right shift does not propagate the sign. These assumptions were
2988 all in the original code but they weren't checked.
2990 (TIME_T_MIDPOINT, verify): New macros.
2991 (__isleap): Remove; it has integer overflow problems.
2992 (leapyear): New function, without those problems.
2993 (ydhms_tm_diff): Remove; splitting into two parts.
2994 (ydhms_diff): New function, containing the arithmetic part of
2995 the old ydhms_tm_diff function. Issue a compile-time
2996 diagnostic if we are not using C99 integer division.
2997 Avoid casts when possible.
2998 (guess_time_tm): New function, containing the checking part of
2999 the old ydhms_tm_diff function. Return the new value, rather than
3000 the difference between it and the old. Accept a new argument T
3001 so that *T specifies the old value. Check for overflow in the result.
3003 (__mktime_internal): Use a time_t offset, not a long int offset.
3004 This undoes the 2003-06-04 change, which is no longer needed now
3005 that we have better overflow checking.
3006 (localtime_offset): Likewise.
3008 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3009 and long are 64-bit but int is only 32-bit.
3010 (ydhms_diff): Use long int to store year1 and yday1.
3011 Issue a compile-time diagnostic if long int is not wide enough.
3013 (__mktime_internal): Use long int to store adjusted year and yday.
3014 Use plain C rather than preprocessor commands, if that doesn't
3016 Check for overflow (and try to repair) after each probe
3017 rather than checking only at the very end. This avoids some bugs
3018 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3019 does not equal GMT offset at maximum time).
3020 Use integer to check for overflow rather than floating point; this
3021 is more portable to non-IEEE hosts, and is a tad faster.
3022 When we detect that we are oscillating between two values,
3023 don't check whether tm_isdst has the requested value, since
3024 we already know the answer. When tm_isdst has the wrong value,
3025 use a different heuristic to find the right one, based on the
3026 extreme values actually observed in practice in tz2003a,
3027 rather than the (overly optimistic) "previous 3 calendar quarters".
3029 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3030 "T const" to accommodate glibc style.
3031 (check_result): Use less-confusing report format. "long" -> "long int.
3033 Don't loop if the iteration overflows time_t.
3034 Allow a negative step in the iteration.
3036 2003-07-01 Paul Eggert <eggert@twinsun.com>
3038 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3039 having it depend on HAVE_SYS_TYPES_H.
3041 2003-06-25 Bruno Haible <bruno@clisp.org>
3043 * readlink.c: New file.
3045 2003-06-20 Bruno Haible <bruno@clisp.org>
3047 Assume C89, so PARAMS isn't needed.
3048 * unicodeio.h (PARAMS): Remove.
3049 * unicodeio.c: Don't use PARAMS.
3051 2003-06-18 Jim Meyering <jim@meyering.net>
3053 Merge changes from coreutils.
3054 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3055 Remove explicit declarations of xmalloc and realloc.
3057 (read_utmp): Remove anachronistic cast of xmalloc.
3059 2003-06-17 Paul Eggert <eggert@twinsun.com>
3061 Assume C89, so PARAMS isn't needed.
3062 * backupfile.h (PARAMS): Remove. All uses removed.
3063 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3064 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3065 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3066 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3067 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3068 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3069 xstrtol.h: Likewise.
3070 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3071 same.h, strverscmp.h: Do not include config.h; no longer needed.
3072 Anyway, config.h should always be included before any other file.
3074 2003-06-11 Simon Josefsson <jas@extundo.com>
3076 * sysexit_.h: New file.
3078 2003-05-20 Derek Price <derek@ximbiot.com>
3080 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3082 2003-06-10 Simon Josefsson <jas@extundo.com>
3084 * strchrnul.h: New file.
3085 * strchrnul.c: New file.
3087 2003-06-10 Simon Josefsson <jas@extundo.com>
3089 * argp.h: New file, from glibc.
3090 * argp-ba.c: New file, from glibc.
3091 * argp-eexst.c: New file, from glibc.
3092 * argp-fmtstream.c: New file, from glibc.
3093 * argp-fmtstream.h: New file, from glibc.
3094 * argp-fs-xinl.c: New file, from glibc.
3095 * argp-help.c: New file, from glibc.
3096 * argp-namefrob.h: New file, from glibc.
3097 * argp-parse.c: New file, from glibc.
3098 * argp-pv.c: New file, from glibc.
3099 * argp-pvh.c: New file, from glibc.
3100 * argp-xinl.c: New file, from glibc.
3102 2003-06-07 Jim Meyering <jim@meyering.net>
3104 * readtokens.h: Put `Free Software Foundation, Inc.'
3105 in place of my name in the copyright comment.
3106 Remove definition and uses of __P.
3109 * stat.c: Don't declare xmalloc explicitly.
3110 Instead, include "xalloc.h".
3111 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
3112 xrealloc, and xcalloc return values.
3113 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
3115 * xgetcwd.h: Remove definition/uses of PARAMS.
3117 2003-06-06 Jim Meyering <jim@meyering.net>
3119 * stdbool_.h: Renamed from stdbool.h.in.
3121 2003-06-06 Jim Meyering <jim@meyering.net>
3123 Merge from coreutils.
3124 * same.c: (same_name): Declare *_basename locals to be `const'.
3125 Consolidate declarations and initializations of *_base* locals.
3127 Merge from coreutils.
3128 This avoids a core dump on systems without GNU putenv,
3129 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3130 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3131 (unsetenv): New static function, from GNU libc.
3132 (rpl_putenv): Use it.
3134 * modechange.c: Remove trailing blanks.
3136 Merge from coreutils.
3137 * fsusage.c: Remove declaration of statfs.
3138 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3140 * posixtm.c: Include <stdbool.h> unconditionally.
3142 2003-06-05 Paul Eggert <eggert@twinsun.com>
3144 * mktime.c (__mktime_internal): When resolving a tm_isdst
3145 mismatch, look in future quarters as well as past. This fixes a
3146 bug when processing fall-backwards gaps immediately after a long
3147 period of daylight-saving time.
3149 * mktime.c: Assume freestanding C89 or better.
3150 (HAVE_LIMITS_H): Remove. Assume it's 1.
3151 (__P): Remove; not used.
3152 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3153 (mktime, not_equal_tm, print_tm, check_result,
3154 main): Use prototypes. Use const * where appropriate.
3155 (main): Fix typo in testing code that uncovered by above changes.
3156 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3158 2003-06-04 Paul Eggert <eggert@twinsun.com>
3160 * mktime.c: Fix Debian bug 177940
3161 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
3162 (localtime_offset): Now long int, not time_t, because we want it
3163 to be guaranteed to be signed. All uses changed.
3164 (__mktime_internal): If overflow would occur when adding offset,
3167 Merge 'human' changes from coreutils. Rewrite to support
3168 locale-specific notations like thousands separators.
3169 * human.c: Simplify authorship notice.
3170 Include human.h immediately after config.h.
3171 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
3172 <limits.h>: Do not include, since human.h does.
3173 (SIZE_MAX, UINTMAX_MAX): New macros.
3174 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
3175 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
3176 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
3177 (power_letter): Renamed from suffixes.
3178 (generate_suffix_backwards): Remove.
3179 (adjust_value): Now takes int style (because of human.h changes)
3180 and long double value (for greater precision on some platforms).
3181 (group_number): New function.
3182 (human_readable): Use it. Use integer options, not enum.
3183 Put the options before the sizes in the arg list.
3184 Support all the new options.
3185 The old human_readable function has been removed;
3186 use inttostr.h instead.
3187 (human_readable, default_block_size, humblock):
3188 Use uintmax_t, not int, for block sizes.
3189 (human_readable_inexact, block_size_types): Remove.
3190 (block_size_opts): New constant.
3191 (human_options): Renamed from human_block_size, with new signature
3192 that allows block sizes up to UINTMAX_MAX. All callers changed.
3193 * human.h: Add copyright and authorship notice.
3194 Include <limits.h> and <stdbool.h> unconditionally.
3195 (PARAMS): Remove. All uses removed.
3196 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
3197 (enum human_inexact_style): Remove tag; now a nameless enum.
3198 (human_floor, human_ceiling, human_round_to_even): Now have
3199 values 2, 0, 1 rather than -1, 1, 0.
3200 (human_group_digits, human_suppress_point_zero, human_autoscale,
3201 human_base_1024, human_SI, human_B): New constants.
3202 (human_readable_inexact, human_block_size): Remove.
3203 (human_readable): Size args are now uintmax_t, not int.
3204 (human_options): New decl.
3206 * exclude.c: (new_exclude, add_exclude): Remove casts that are
3207 unnecessary now that we assume C89 or better. This change
3208 imported from coreutils.
3210 * mktime.c (__mktime_internal): Do not reject negative timestamps
3211 arbitrarily. This is the same patch as 2003-05-28, but it got lost
3212 in the 2003-05-30 sync from glibc.
3214 .h files should stand alone, but we shouldn't include <sys/types.h>
3215 if we can get away with just <stddef.h>.
3217 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
3218 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
3219 rather than <sys/types.h>, as we merely need size_t.
3220 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3222 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3223 Include <stdio.h>, to get FILE.
3224 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3225 memcasecmp.h has included <stddef.h> and all we need is size_t.
3226 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3227 our interface, instead of including <sys/types.h>
3229 2003-06-02 Paul Eggert <eggert@twinsun.com>
3232 Fix some minor time-related bugs with POSIX time arguments.
3233 Some valid time stamps were being rejected (notably -1, and
3234 time stamps before 1900 on 64-bit hosts). And some invalid
3235 time stamps were being accepted, e.g. September 31.
3237 * posixtm.h (posixtime): Return bool instead of time_t, so
3238 that we can return (time_t) -1 successfully.
3239 * posixtm.c: Likewise.
3240 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3241 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3242 (t): Remove static var.
3243 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3244 of static var. All uses changed.
3245 (year): Do not reject years before 1900; they can occur with
3247 (posix_time_parse): Do not check for out-of-range components;
3248 that is now the caller's responsibility, since our checks were
3249 only approximations.
3250 (posixtime): Use mktime to check for out-of-range components,
3251 since it knows them exactly.
3252 If mktime returns (time_t) -1, check whether an error actually occurred
3253 by invoking localtime on -1.
3254 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3255 posixtime failures better.
3256 Improve the test data (in comments only).
3258 2003-05-30 <karl@gnu.org>
3260 * mktime.c: update from libc.
3262 2003-05-30 Bruno Haible <bruno@clisp.org>
3264 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
3265 * localcharset.h: Likewise.
3266 * localcharset.c: Likewise.
3268 2003-05-28 Paul Eggert <eggert@twinsun.com>
3270 Assume the headers required for C89 freestanding compilers.
3271 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
3272 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
3273 without checking for HAVE_LIMITS_H.
3274 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
3275 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
3277 * fatal.c: Include <stdarg.h> without checking for __STDC__.
3278 * exclude.c: Include <stdbool.h> unconditionally.
3279 * tempname.c: Include <stddef.h> unconditionally.
3280 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
3281 * modechange.c, rpmatch.c (NULL): Don't define, since
3282 <stddef.h> does that.
3283 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
3284 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
3285 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
3286 * xstrtol.c: Likewise.
3287 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
3288 * savedir.c: Include <stddef.h> instead of defining NULL.
3290 * addext.c (addext): Use assignment rather than cast, to avoid
3291 warnings on some platforms.
3293 * mktime.c (__mktime_internal): Do not reject negative timestamps
3296 2003-05-10 Bruno Haible <bruno@clisp.org>
3298 * linebreak.c (iconv_string_length): Don't return -1 just because the
3299 string is longer than 4 KB.
3301 2003-05-12 Jim Meyering <jim@meyering.net>
3303 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
3304 the space-padded-by-default conversion specifiers, %e, %k, %l.
3306 2003-05-03 Bruno Haible <bruno@clisp.org>
3308 Upgrade to Unicode-4.0.
3309 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
3310 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
3311 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
3312 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
3313 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
3314 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
3315 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
3316 Change width of U+E0100..U+E01EF from 1 to 0.
3318 2003-04-25 Bruno Haible <bruno@clisp.org>
3320 * copy-file.c: Include <stddef.h>, for size_t.
3322 2003-04-25 Jim Meyering <jim@meyering.net>
3324 * copy-file.c (copy_file_preserving): Declare buf_size to be
3325 of type size_t, not int.
3327 2003-04-11 Jim Meyering <jim@meyering.net>
3329 Merge changes from Coreutils.
3331 2003-03-22 Jim Meyering <jim@meyering.net>
3333 * strftime.c (widen): Cast alloca return value to proper type.
3335 2003-01-19 Ulrich Drepper <drepper@redhat.com>
3338 * strftime.c (my_strftime): Handle very large width
3339 specifications for numeric values correctly. Improve checks for
3342 2003-01-19 Jim Meyering <jim@meyering.net>
3344 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
3345 (nl_get_alt_digit) [! defined my_strftime]: Define.
3346 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
3347 _nl_get_alt_digit and _nl_get_walt_digit.
3349 * strftime.c (my_strftime): Merge in locale-related changes from libc.
3350 These changes have no effect outside of _LIBC.
3352 2003-04-10 Bruno Haible <bruno@clisp.org>
3354 * findprog.h: New file, from GNU gettext.
3355 * findprog.c: New file, from GNU gettext.
3357 2003-04-05 Jim Meyering <jim@meyering.net>
3359 Merge changes from Coreutils.
3361 * exclude.h (PARAMS): Remove definition and uses.
3362 * exclude.c: Remove uses of `PARAMS'.
3364 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
3365 Add test-cases for DOS filenames. Declare program_name.
3366 (main): Set up program_name. Patch by Rich Dawe.
3368 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3370 Use mntctl's return value to drive the entry-processing loop, since
3371 we can't rely on the value of the vmt_length member in the last
3372 entry. On some systems doing so could result in exhausting
3373 virtual memory. Based in part on a patch from Mike Jetzer.
3375 2003-04-04 Bruno Haible <bruno@clisp.org>
3377 * linebreak.h: New file, from GNU gettext.
3378 * linebreak.c: New file, from GNU gettext with slight modifications.
3379 * lbrkprop.h: New file, from GNU gettext.
3381 2003-04-03 Bruno Haible <bruno@clisp.org>
3383 * utf8-ucs4.h: New file, from GNU gettext.
3384 * utf16-ucs4.h: New file, from GNU gettext.
3385 * ucs4-utf8.h: New file, from GNU gettext.
3386 * ucs4-utf16.h: New file, from GNU gettext.
3388 2003-04-02 Bruno Haible <bruno@clisp.org>
3390 * binary-io.h: New file, from GNU gettext.
3392 2003-04-01 Bruno Haible <bruno@clisp.org>
3394 * pathname.h: New file, from GNU gettext.
3395 * concatpath.c: New file, from GNU gettext.
3397 2003-03-30 Bruno Haible <bruno@clisp.org>
3399 * copy-file.c (copy_file_preserving): Don't set owner if the function
3400 chown() doesn't exist.
3402 2003-03-28 Bruno Haible <bruno@clisp.org>
3404 * copy-file.h: New file, from GNU gettext.
3405 * copy-file.c: New file, from GNU gettext.
3407 2003-03-18 Jim Meyering <jim@meyering.net>
3409 * quote.c (quote_n): Fix typo in comment.
3411 2003-03-14 Jim Meyering <jim@meyering.net>
3413 Merge changes from Coreutils.
3414 * obstack.h (obstack_object_size): Declare temporary, __o,
3415 to be const, in order to avoid warnings.
3416 (obstack_room): Likewise.
3417 (obstack_empty_p): Likewise.
3419 2003-03-13 Paul Eggert <eggert@twinsun.com>
3421 Merge changes from Bison.
3422 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
3423 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
3424 when compiling Bison 1.875's `bitset bset = obstack_alloc
3425 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
3426 * hash.c: Include <stdbool.h> unconditionally.
3428 2003-03-09 Paul Eggert <eggert@twinsun.com>
3430 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
3431 Reported by Bruce Becker; see:
3432 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
3434 2003-03-03 Paul Eggert <eggert@twinsun.com>
3435 Bruno Haible <bruno@clisp.org>
3437 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
3438 Reported by John Hughes, see
3439 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
3441 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
3443 * poll_.h: New file.
3446 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
3448 * mathl.h: New file.
3449 * acosl.c: New file.
3450 * asinl.c: New file.
3451 * atanl.c: New file.
3452 * ceill.c: New file.
3455 * floorl.c: New file.
3456 * frexpl.c: New file.
3457 * ldexpl.c: New file.
3459 * sincosl.c: New file.
3461 * sqrtl.c: New file.
3463 * trigl.c: New file.
3464 * trigl.h: New file.
3466 2003-02-17 Bruno Haible <bruno@clisp.org>
3468 * mkdtemp.h: New file, from GNU gettext.
3469 * mkdtemp.c: New file, from GNU gettext.
3471 2003-01-31 Bruno Haible <bruno@clisp.org>
3473 * rename.c: #undef rename before defining rpl_rename.
3474 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
3476 2003-01-30 Bruno Haible <bruno@clisp.org>
3478 * printf-args.h: New file, from GNU gettext.
3479 * printf-args.c: New file, from GNU gettext.
3480 * printf-parse.h: New file, from GNU gettext.
3481 * printf-parse.c: New file, from GNU gettext.
3482 * vasnprintf.h: New file, from GNU gettext.
3483 * vasnprintf.c: New file, from GNU gettext.
3484 * asnprintf.c: New file, from GNU gettext.
3485 * vasprintf.h: New file, from GNU gettext with modifications.
3486 * vasprintf.c: New file, from GNU gettext.
3487 * asprintf.c: New file, from GNU gettext.
3489 2003-01-29 Bruno Haible <bruno@clisp.org>
3491 * stpncpy.h: New file, from GNU gettext with modifications.
3492 * stpncpy.c: New file, from GNU gettext with modifications.
3494 2003-01-28 Bruno Haible <bruno@clisp.org>
3496 * c-ctype.h: New file, from GNU gettext, with changes suggested by
3498 * c-ctype.c: New file, from GNU gettext, with changes suggested by
3501 2003-01-27 Bruno Haible <bruno@clisp.org>
3503 * xsetenv.h: New file, from GNU gettext.
3504 * xsetenv.c: New file, from GNU gettext.
3506 2003-01-23 Bruno Haible <bruno@clisp.org>
3508 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
3510 2003-01-22 Bruno Haible <bruno@clisp.org>
3512 * exit.h: New file, from GNU gettext.
3514 2003-01-11 Bruno Haible <bruno@clisp.org>
3516 * stpcpy.h (stpcpy): Use ANSI C function declarations.
3517 * strcase.h (strcasecmp, strncasecmp): Likewise.
3519 2003-01-14 Jim Meyering <jim@meyering.net>
3521 * same.c (same_name): Tweak a comment.
3523 2003-01-11 Bruno Haible <bruno@clisp.org>
3525 * same.c (same_name): Reorder tests so as to avoid calling stat()
3526 when a string comparison is sufficient.
3528 2003-01-11 Bruno Haible <bruno@clisp.org>
3530 * readtokens.c (readtoken): Cast character to 'unsigned char', not
3533 2003-01-11 Bruno Haible <bruno@clisp.org>
3535 * hash-pjw.c: Add comment about low quality of this function.
3537 2003-01-12 Paul Eggert <eggert@twinsun.com>
3539 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
3540 to avoid collisions with libcurses and libreadline.
3542 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
3543 * getstr.h, getstr.c: Remove.
3544 * getline.c: Include "getline.h", to check interface.
3545 Move body of old getstr.c here: this defines MIN_CHUNK and
3546 declares getdelim2, which is renamed from getstr.
3547 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
3549 * linebuffer.c (readlinebuffer): Renamed from readline.
3551 * linebuffer.h: Likewise.
3552 (readline): Remove backward-compatibility macro.
3554 2003-01-12 Jim Meyering <jim@meyering.net>
3556 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
3558 2003-01-10 Bruno Haible <bruno@clisp.org>
3560 * alloca_.h: New file.
3561 * getdate.y: Unconditionally include alloca.h.
3562 * makepath.c: Likewise.
3563 * setenv.c: Likewise.
3564 * userspec.c: Likewise.
3566 2003-01-09 Bruno Haible <bruno@clisp.org>
3568 * stdbool.h.in: New file.
3570 2003-01-08 Bruno Haible <bruno@clisp.org>
3572 * safe-read.c: Include specification header first, to ensure its
3574 * full-write.c: Likewise.
3576 2003-01-08 Jim Meyering <jim@meyering.net>
3578 * full-write.c: Undefine and define-away `const' after inclusion
3579 of errno.h, not before. Suggestion from Bruno Haible.
3581 2003-01-07 Jim Meyering <jim@meyering.net>
3583 * full-write.c: Rework so that it may serve to define full_read, too.
3584 * full-read.c: Simply #define FULL_READ and include full-write.c.
3586 2003-01-06 Jim Meyering <jim@meyering.net>
3588 * version-etc.c: Update year in translatable copyright string.
3590 2002-12-25 Bruno Haible <bruno@clisp.org>
3592 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
3593 * xstrtol.h: Likewise.
3594 * xstrtoimax.c: Likewise.
3595 * xstrtoumax.c: Likewise.
3596 * human.h: Likewise.
3598 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
3599 on systems that have <inttypes.h> but not <stdint.h>.
3601 2002-12-31 Paul Eggert <eggert@twinsun.com>
3603 * memcoll.c (memcoll): Fall back on a simple algorithm using
3604 memcmp if strcoll doesn't work.
3606 2002-12-23 Bruno Haible <bruno@clisp.org>
3608 * localcharset.h: New file.
3609 * localcharset.c: Include it.
3610 * unicodeio.c: Likewise.
3612 2002-12-22 Bruno Haible <bruno@clisp.org>
3614 * utime.c (utime_null): No need to call ftruncate if the file was
3617 2002-12-23 Bruno Haible <bruno@clisp.org>
3619 * memcoll.c (STRCOLL): New macro.
3622 2002-12-22 Bruno Haible <bruno@clisp.org>
3624 * getstr.h (getstr): Define, to avoid clash with libcurses.
3625 * linebuffer.h (readline): Define, to avoid clash with libreadline.
3627 2002-12-22 Bruno Haible <bruno@clisp.org>
3629 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
3631 2002-12-23 Bruno Haible <bruno@clisp.org>
3633 * getline.h: Include <stddef.h>, for size_t.
3635 * unicodeio.h: Include <stddef.h>, for size_t.
3636 * unicodeio.c: Don't include <stddef.h>.
3638 2002-12-17 Bruno Haible <bruno@clisp.org>
3640 * canon-host.c (strdup): Remove unused declaration.
3642 * fsusage.c: Include full_read.h.
3643 (get_fs_usage): Use full_read instead of safe_read.
3645 * utime.c (utime_null): Use SAFE_READ_ERROR.
3647 2002-12-11 Bruno Haible <bruno@clisp.org>
3649 * setenv.h: Rewritten to cope with systems that have setenv() but not
3651 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
3654 2002-12-11 Bruno Haible <bruno@clisp.org>
3656 * setenv.c (alloca): Fall back to malloc.
3658 (setenv): Use freea() to free memory allocated with alloca().
3660 2002-11-13 Bruno Haible <bruno@clisp.org>
3662 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
3663 function declarations.
3664 * unsetenv.c (unsetenv): Likewise.
3666 2002-03-04 Bruno Haible <bruno@clisp.org>
3668 Portability to AIX 4.3.3.
3669 * unsetenv.c: New file, extracted from setenv.c.
3670 * setenv.c: Move the unsetenv() function to unsetenv.c.
3672 2001-12-20 Bruno Haible <bruno@clisp.org>
3674 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
3675 use malloc instead. For SunOS 4.
3677 2001-12-11 Bruno Haible <bruno@clisp.org>
3679 * setenv.c: Declare alloca.
3680 (compar_fn_t): New typedef.
3681 (KNOWN_VALUE, STORE_VALUE): Use it.
3683 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
3686 2002-12-10 Paul Eggert <eggert@twinsun.com>
3688 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
3689 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
3690 Choose values that are less likely to collide with system fnmatch
3692 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
3693 defined (e.g., a pure POSIX system).
3694 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
3695 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
3697 2002-12-06 Jim Meyering <jim@meyering.net>
3699 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
3701 Merge in changes from libc's misc/error.c, in preparation
3702 for the merge of gnulib's changes back into libc.
3704 * error.c (_): Define only if not already defined.
3705 Move definition to follow all #include directives.
3706 Include unlocked-io.h only if !_LIBC.
3707 [_LIBC]: Include <libio/libioP.h>.
3708 [USE_IN_LIBIO]: Include <libio/iolibio.h>
3709 (fflush): Tweak definition to use INTUSE.
3712 2002-12-05 Paul Eggert <eggert@twinsun.com>
3714 * alloca.c [defined emacs]: Include "lisp.h".
3715 (xalloc_die) [defined emacs]: New macro.
3716 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
3717 [! defined emacs]: Include <xalloc.h>.
3718 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
3719 (pointer): Typedef to POINTER_TYPE *.
3720 (malloc): Remove decl; we now always use xmalloc.
3721 (alloca): Use old-style definition, since Emacs needs this.
3722 Check for arithmetic overflow when computing combined size.
3724 2002-12-04 Paul Eggert <eggert@twinsun.com>
3726 Do not generate unlocked-io.h automatically, since it's easier to
3727 maintain it by hand.
3729 * unlocked-io.h: New file, from GNU diffutils,
3730 but with proper copyright notice and attribution.
3732 * Makefile.am: Add copyright notice.
3733 (libfetish_a_SOURCES): Add unlocked-io.h.
3734 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
3735 (DISTCLEANFILES, io_functions): Remove macros.
3736 (EXTRA_DIST): Remove gen_uio.
3737 (unlocked-io.h): Remove rule.
3739 2002-12-04 Jim Meyering <jim@meyering.net>
3741 Reflect the fact that stat.c and lstat.c are no longer generated.
3742 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
3743 (DISTCLEANFILES): Likewise.
3744 (EXTRA_DIST): Likewise.
3745 (all_local): Don't depend on stat.c or lstat.c.
3746 (stat.c, lstat.c): Remove rules.
3747 (EXTRA_DIST): Remove xstat.in.
3749 * xstat.in: Remove file. Contents moved into stat.c.
3750 * stat.c: New file. Contents mostly from xstat.in.
3751 * stat.c: Rework so that it may serve to define rpl_lstat, too.
3752 * lstat.c: New file. Simply #define LSTAT and include stat.c.
3754 * safe-read.c: Rework so that it may serve to define safe_write, too.
3755 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
3757 2002-12-03 Jim Meyering <jim@meyering.net>
3759 * safe-read.c, safe-write.c: Change variable names and comments, but
3760 not semantics, to minimize the differences between these two files.
3761 (safe_read): Change comment to mention SAFE_READ_ERROR.
3763 * safe-read.c (IS_EINTR): Define.
3764 (safe_read): Use IS_EINTR in place of in-function cpp directives.
3766 2002-12-02 Bruno Haible <bruno@clisp.org>
3768 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
3769 Define, taken from safe-read.c.
3770 (INT_MAX): Provide fallback.
3771 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
3772 * safe-write.h (SAFE_WRITE_ERROR): Define.
3774 * safe-read.c (EINTR): Remove definition.
3775 (safe_read): Don't use EINTR if it is absent.
3777 2002-12-02 Jim Meyering <jim@meyering.net>
3779 * safe-read.c (EINTR): Define.
3780 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
3781 (INT_MAX): Provide fallback.
3782 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
3784 * safe-read.h (SAFE_READ_ERROR): Define.
3786 2002-12-01 Jim Meyering <jim@meyering.net>
3788 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
3789 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
3791 2002-11-27 Paul Eggert <eggert@twinsun.com>
3793 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3794 hash_rehash): Replace `if (limit <= value) abort ();' with
3795 `if (! (value < limit)) abort ();', for readability.
3797 2002-11-26 <karl@gnu.org>
3799 * strdup.c: copy from libc again, with jim's ok.
3800 * .cppi-disable: re-add strdup.c
3802 2002-11-25 <karl@gnu.org>
3804 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
3805 instead of "strtol.c".
3807 2002-11-25 Jim Meyering <jim@meyering.net>
3809 * mktime.c: Sync from libc, now that it has the latest fix.
3811 2002-11-24 <karl@gnu.org>
3813 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
3814 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
3816 2002-11-24 Jim Meyering <jim@meyering.net>
3818 Update from coreutils:
3820 * mktime.c: Merge in changes from libc.
3822 Avoid a link-time failure on some Linux systems.
3823 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
3824 (__mon_yday): Declare with the STATIC attribute.
3825 (__mktime_internal): Likewise.
3826 Based on a report from Greg Schafer.
3828 2002-11-23 Jim Meyering <jim@meyering.net>
3830 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
3831 Use `unsigned', not `int', as type of index.
3833 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
3835 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
3837 2002-11-22 Paul Eggert <eggert@twinsun.com>
3839 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
3840 hint that one should use `if (! x) abort ();' rather than `assert
3841 (x);', and anyway it's one less thing to worry about configuring.
3842 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3843 hash_rehash, hash_insert): Use abort rather than assert.
3845 2002-11-22 Paul Eggert <eggert@twinsun.com>
3847 * quotearg.h: Allow multiple inclusion by surrounding with
3848 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
3849 so that we can be included first.
3850 (PARAMS): Remove; we now assume C89 or later. All uses removed.
3851 * quotearg.c: Include quotearg.h immediately after config.h.
3852 No need to include stddef.h or sys/types.h any more.
3853 Surround local include files with "", not "<>".
3854 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
3855 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
3856 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
3857 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
3858 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
3859 (ISPRINT): Remove; no longer needed now that we assume C89.
3861 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
3864 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
3865 quotearg_char): Use SIZE_MAX rather than
3866 (size_t) -1 when we are talking about "infinity".
3868 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
3870 2002-11-22 Bruno Haible <bruno@clisp.org>
3872 * safe-read.h: Assume C89. Add comments.
3873 (safe_read): Change return type to size_t.
3874 * safe-read.c (safe_read): Change return type to size_t. Handle byte
3875 counts > SSIZE_MAX correctly.
3876 * safe-write.h: New file.
3877 * safe-write.c: New file.
3878 * full-read.h: New file.
3879 * full-read.c: New file.
3880 * full-write.h: Assume C89. Add comments.
3881 * full-write.c: Include safe-write.h.
3882 (full_write): Rewritten to use safe_write.
3883 Suggested by Jim Meyering and Paul Eggert.
3885 2002-11-21 Bruno Haible <bruno@clisp.org>
3887 Remove case insensitive option matching.
3888 * argmatch.h (argcasematch): Remove declaration.
3889 (ARGCASEMATCH): Remove macro.
3890 (__xargmatch_internal): Remove case_sensitive argument.
3891 (XARGMATCH): Update.
3892 (XARGCASEMATCH): Remove macro.
3893 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
3894 case_sensitive argument.
3895 (argcasematch): Remove function.
3896 (__xargmatch_internal): Remove case_sensitive argument.
3897 (main): Use XARGMATCH instead of XARGCASEMATCH.
3899 * xmalloc.c: Change compile-time error message. Add comment about
3900 required autoconf version.
3902 2002-11-21 Jim Meyering <jim@meyering.net>
3904 * strdup.c (strdup): Tweak comment and initial #if/#include.
3906 Merge in changes from the coreutils.
3908 2002-09-25 Paul Eggert <eggert@twinsun.com>
3909 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
3910 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
3911 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
3912 int. Work more efficiently if X is the same width as uintmax_t.
3913 Do not compare X to -1, to avoid bogus compiler warning.
3914 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
3915 Don't assume that f_frsize and f_bsize are the same type.
3917 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
3920 * makepath.c (make_path): Restore umask *before* creating the final
3922 (make_path): Minor reformatting.
3924 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
3925 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
3927 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
3928 ones. At least on GNU/Linux systems, `auto' means something else.
3931 2002-11-20 Paul Eggert <eggert@twinsun.com>
3933 Merge argmatch cleanups from Bison. Assume C89.
3935 * argmatch.c: Include config.h here, not in argmatch.h.
3936 Include stdlib.h, for EXIT_FAILURE.
3937 Always include <string.h>, since we assume C89.
3938 (EXIT_FAILURE): Remove pre-C89 bug workaround.
3939 * argmatch.h: Do not include <config.h> or <sys/types.h>.
3940 Include <stddef.h> instead, since it's all we need for size_t.
3941 (PARAMS): Remove. All uses removed.
3942 (ARRAY_CARDINALITY): Do not bother to #undef.
3943 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
3944 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3945 Remove unnecessary parentheses.
3946 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3947 Insert necessary parentheses.
3948 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
3949 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
3951 2002-11-19 Bruno Haible <bruno@clisp.org>
3953 * mbswidth.c: Include mbswidth.h right at the beginning.
3954 * mbswidth.h: Include <stddef.h>, for size_t.
3956 * mbswidth.h (PARAMS): Remove macro.
3957 (mbswidth, mbsnwidth): Use ANSI C function declarations.
3958 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
3960 * gcd.h (PARAMS): Remove macro.
3961 (gcd): Use ANSI C function declarations.
3962 * gcd.c (gcd): Likewise.
3964 2002-11-15 Bruno Haible <bruno@clisp.org>
3966 * strcspn.c: Include <stddef.h>.
3967 (strcspn): Use ANSI C function declaration. Change return type to
3969 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
3970 (strpbrk): Use NULL.
3971 * strpbrk.h (PARAMS): Remove macro.
3972 (strpbrk): Use ANSI C function declaration.
3973 * strstr.c: Don't include <sys/types.h>.
3974 * strstr.h (PARAMS): Remove macro.
3975 (strstr): Use ANSI C function declarations.
3977 2002-11-06 Bruno Haible <bruno@clisp.org>
3979 * gcd.h (gcd): Change argument type to 'unsigned long'.
3980 * gcd.c (gcd): Likewise.
3982 2002-11-05 Bruno Haible <bruno@clisp.org>
3984 * gcd.h: New file, from gettext-0.11.5.
3985 * gcd.c: New file, from gettext-0.11.5.
3987 2002-11-05 Bruno Haible <bruno@clisp.org>
3989 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3990 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3991 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3992 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3994 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3995 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3997 * closeout.c: Include gettext.h instead of <libintl.h>.
3998 * human.c: Include gettext.h instead of <libintl.h>.
3999 * quotearg.c: Include gettext.h instead of <libintl.h>.
4000 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4001 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4002 * userspec.c: Include gettext.h instead of <libintl.h>.
4003 * version-etc.c: Include gettext.h instead of <libintl.h>.
4004 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4005 (textdomain): Remove definition.
4006 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4008 * long-options.c: Remove include of <libintl.h> and definition of _.
4009 * same.c: Remove include of <libintl.h> and definition of _.
4011 2002-11-04 Bruno Haible <bruno@clisp.org>
4013 * stpcpy.h: New file, from GNU gettext-0.11.5.
4014 * strcase.h: New file, from GNU gettext-0.11.5.
4015 * strpbrk.h: New file, from GNU gettext-0.11.5.
4016 * strstr.h: New file, from GNU gettext-0.11.5.
4017 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4019 2002-05-09 Bruno Haible <bruno@clisp.org>
4021 * config.charset: Update for newest glibc. Add canonical names
4022 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4024 2002-05-09 Bruno Haible <bruno@clisp.org>
4026 * localcharset.c (get_charset_aliases): Add more Windows specific
4029 2002-05-08 Owen Taylor <otaylor@redhat.com>
4031 * config.charset: A few additions for Solaris.
4033 2001-12-05 Bruno Haible <bruno@clisp.org>
4035 * localcharset.c (locale_charset): Don't return an empty string.
4037 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4039 * config.charset: msdos in uk_UA uses CP1125.
4041 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4043 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4044 * localcharset.c (locale_charset): Declare as extern "C".
4046 2002-02-15 Bruno Haible <bruno@clisp.org>
4048 * config.charset [msdosdjgpp]: For Russian, use CP866.
4050 2002-02-11 Bruno Haible <bruno@clisp.org>
4052 * config.charset: Add support for NetBSD.
4054 2002-09-25 <karl@gnu.org>
4056 * strdup.c: copy from libc/string (via ../config/srclist*).
4057 * getopt*: copy from libc/posix.
4058 * gettext.h: copy from gettext.
4059 * .cppi-disable: add strdup.c, gettext.h.
4061 2002-07-01 Jim Meyering <meyering@lucent.com>
4063 * c-stack.c: Include sys/time.h.
4064 From Volker Borchert.
4066 2002-06-11 Paul Eggert <eggert@twinsun.com>
4068 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4069 New macro. Use it uniformly instead of
4070 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4071 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4072 reported by Vin Shelton.
4074 2002-06-22 Jim Meyering <meyering@lucent.com>
4076 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4077 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4079 2002-06-22 Paul Eggert <eggert@twinsun.com>
4081 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4082 Do not assume SA_SIGINFO behavior.
4083 Bug reported by Jim Meyering on NetBSD 1.5.2.
4085 2002-06-22 Jim Meyering <meyering@lucent.com>
4087 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4089 * exitfail.c, exitfail.h: Likewise.
4090 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4092 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4094 (EXTRA_DIST): Add fnmatch_loop.c.
4095 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4097 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4098 * fnmatch.c: Update from diffutils-2.8.2.
4099 * fnmatch_.h: New file. From diffutils-2.8.2.
4100 * fnmatch.h: Remove file.
4102 2002-06-18 Paul Eggert <eggert@twinsun.com>
4104 * file-type.h: Report an error if neither S_ISREG nor
4105 S_IFREG is defined, instead of using a test specific to glibc
4106 2.2. This should be safe, since POSIX requires S_ISREG and
4107 Unix Version 7 had S_IFREG. We don't need to check for
4108 <sys/types.h> since we don't use any symbols that it defines.
4110 2002-06-15 Jim Meyering <meyering@lucent.com>
4112 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4113 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4114 have been included before this file.
4116 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4118 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4119 so that each temporary file name is unique and valid in the first
4120 8 characters, for operation under DOS.
4122 2002-06-15 Jim Meyering <meyering@lucent.com>
4124 Work even with DJGPP 2.03, which lacks support for symlinks.
4126 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4128 * lchown.c (S_ISLNK): Likewise.
4130 2002-06-14 Jim Meyering <meyering@lucent.com>
4132 * file-type.h: Use the version from diffutils-2.8.2.
4133 * file-type.c: Likewise.
4135 2002-05-27 Jim Meyering <meyering@lucent.com>
4137 Fix a problem seen only on nonconforming systems whereby ls.c's
4138 use of localtime, and then of gettimeofday would cause trouble:
4139 the localtime call used to initialize rpl_gettimeofday's save
4140 mechanism would clobber ls's current local time information so
4141 that in any long listing the first file would always be listed
4142 with date 1970-01-01. Analysis by Volker Borchert.
4144 * gettimeofday.c (localtime): Undefine.
4145 (rpl_localtime): New function.
4147 2002-05-22 Jim Meyering <meyering@lucent.com>
4149 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4150 * file-type.h: New file.
4151 * file-type.c (file_type): New file/function. Extracted from diffutils.
4153 2002-04-29 Paul Eggert <eggert@twinsun.com>
4155 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4157 2002-04-28 Paul Eggert <eggert@twinsun.com>
4159 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4160 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4161 of 127, since 64 is the largest conceivable number for ancient
4163 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4165 2002-04-28 Jim Meyering <meyering@lucent.com>
4167 * sig2str.c (WTERMSIG): Remove definition (unused).
4169 2002-04-28 Paul Eggert <eggert@twinsun.com>
4171 * sig2str.h, sig2str.c: New files.
4172 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4174 2002-04-24 Jim Meyering <meyering@lucent.com>
4176 * gettext.h: New file, from Gettext.
4177 * Makefile.am (INCLUDES): Remove -I../intl.
4178 (libfetish_a_SOURCES): Add gettext.h.
4180 2002-04-16 Jim Meyering <meyering@lucent.com>
4182 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4183 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4184 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4186 2002-04-12 Jim Meyering <meyering@lucent.com>
4188 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4190 2002-03-10 Jim Meyering <meyering@lucent.com>
4192 * makepath.c (make_path): Remove a comma from a diagnostic.
4193 Suggestion from Santiago Vila.
4195 2002-03-08 Jim Meyering <meyering@lucent.com>
4197 * rename.c: Mention that this wrapper is needed also on
4198 mips-dec-ultrix4.4 systems.
4200 2002-03-02 Jim Meyering <meyering@lucent.com>
4202 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4203 not HAVE_CLOCK_SETTIME.
4205 2002-02-27 Paul Eggert <eggert@twinsun.com>
4207 * nanosleep.h: Rename to....
4208 * timespec.h: New name for nanosleep.h. All uses changed.
4210 * gettime.c: New file.
4211 * settime.c: New file.
4214 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4215 timespec.h. Remove nanosleep.h.
4217 2002-02-25 Paul Eggert <eggert@twinsun.com>
4219 * acl.c, acl.h: New files.
4220 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4222 2002-02-24 Jim Meyering <meyering@lucent.com>
4224 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4225 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4226 cause trouble. Reported by Nelson Beebe.
4228 2002-02-23 Paul Eggert <eggert@twinsun.com>
4230 * path-concat.c (xpath_concat): Reorder code to pacify
4231 compilers that don't know that xalloc_die never returns.
4233 2002-02-20 Jim Meyering <meyering@lucent.com>
4235 * getdate.c: Regenerate using bison-1.33.
4237 2002-02-15 Paul Eggert <eggert@twinsun.com>
4239 * posixver.c, posixver.h: New files.
4240 * Makefile.am (libfetish_a_SOURCES): Add them.
4242 2002-02-02 Paul Eggert <eggert@twinsun.com>
4243 Bruno Haible <bruno@clisp.org>
4245 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4246 (fwrite_success_callback): New declaration.
4247 * unicodeio.c (unicode_to_mb): New function, extracted from
4248 print_unicode_char. Call failure callback instead of error.
4249 (fwrite_success_callback): New function.
4250 (exit_failure_callback): New function.
4251 (fallback_failure_callback): New function.
4252 (print_unicode_char): Call unicode_to_mb.
4254 2002-01-26 Jim Meyering <meyering@lucent.com>
4256 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4258 2002-01-22 Jim Meyering <meyering@lucent.com>
4260 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4261 Otherwise, some versions of automake would omit the rule that makes
4262 Makefile from Makefile.in.
4264 2001-01-21 Paul Eggert <eggert@twinsun.com>
4266 * xmemcoll.h, xmemcoll.c: New files.
4267 * Makefile.am (libfetish_a_SOURCES): Add them.
4268 * memcoll.c: Include errno.h, and declare errno if not defined.
4269 (memcoll): Set errno to zero if there is no error.
4271 * quotearg.c (quotearg_buffer_restyled):
4272 Fix bug with quoting buffers containing NUL when backslashing escapes.
4273 This bug was exposed by the other changes in this patch.
4274 (quotearg_n_options): New arg ARGSIZE.
4275 All callers changed.
4276 (quoting_options_from_style): New function.
4277 (quotearg_n_style): Use it.
4278 (quotearg_n_style_mem): New function.
4280 * quotearg.h (quotearg_n_style_mem): New function.
4282 2002-01-16 Jim Meyering <meyering@lucent.com>
4284 * getdate.y: Add three semicolons, each just before a closing brace.
4285 Bison (as of version 1.31) no longer papers over that mistake.
4287 2002-02-14 Paul Eggert <eggert@twinsun.com>
4289 * backupfile.c (ISDIGIT): Comment fix.
4290 * getdate.y (ISDIGIT): Likewise.
4291 * posixtm.c (ISDIGIT, year): Likewise.
4292 * strverscmp.c (ISDIGIT): Likewise.
4293 * userspec.c (ISDIGIT): Likewise.
4295 2002-01-05 Jim Meyering <meyering@lucent.com>
4297 * version-etc.c (version_etc_copyright): Update copyright year.
4299 2001-01-19 Paul Eggert <eggert@twinsun.com>
4301 * closeout.c (close_stdout_status): If ferror (stdout), do
4302 not silently exit merely because the output buffer happens to
4303 have nothing pending.
4305 2001-12-18 Paul Eggert <eggert@twinsun.com>
4307 See the big note in ../ChangeLog.
4308 * human.c (suffixes): Prefer K to k for 1024.
4309 (generate_suffix_backwards): New function.
4310 (human_readable_inexact): Use it.
4311 * xstrtol.c (__xstrtol): If there is no number but there
4312 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
4313 Accept 'K' as well as 'k'.
4315 2001-12-15 Jim Meyering <meyering@lucent.com>
4317 * regex.h (__restrict_arr): Update from libc.
4319 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
4320 as `remote' if the name starts with `//'. Suggested by Michael Stone.
4323 2001-12-10 Jim Meyering <meyering@lucent.com>
4325 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
4326 Instead, include "xalloc.h".
4327 (initbuffer): Don't cast xmalloc return value to char*.
4328 (readline): Reword comment.
4329 Don't cast xrealloc return value to char*
4332 2001-12-09 Jim Meyering <meyering@lucent.com>
4334 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
4335 `signed and unsigned type in conditional expression'.
4336 * posixtm.c (posix_time_parse): Likewise.
4338 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
4340 * readtokens.c (readtoken): Declare an index to be of type unsigned
4341 to avoid a pedantic warning.
4343 * getstr.c: Don't include assert.h.
4344 (getstr): Remove warning-evoking assertions.
4345 Return -1 if offset parameter is out of bounds.
4346 Change the type of a local from int to size_t.
4348 * strftime.c (my_strftime_localtime_r): Include this function
4349 definition in the `#if ! HAVE_TM_GMTOFF' block.
4351 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
4352 Include xalloc.h instead.
4354 2001-12-02 Jim Meyering <meyering@lucent.com>
4356 * tempname.c: Don't declare getenv, thus reverting the change of
4357 2001-11-18. It's no longer necessary, now that stdlib.h is always
4360 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
4361 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
4363 2001-11-30 Akim Demaille <akim@epita.fr>
4365 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
4366 before being defined.
4368 2001-11-27 Paul Eggert <eggert@twinsun.com>
4370 * quotearg.h (quotearg_n, quotearg_n_style):
4371 First arg is int, not unsigned.
4372 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
4373 (SIZE_MAX, UINT_MAX): New macros.
4374 (quotearg_n_options): Abort if N is negative.
4375 Avoid overflow check on hosts where size_t is 64 bits and int
4376 is 32 bits, as overflow is impossible there.
4377 Fix off-by-one typo that caused unnecessary reallocation.
4379 2001-11-27 Jim Meyering <meyering@lucent.com>
4381 * tempname.c: Merge with version from libc.
4382 * regex.c: Likewise.
4384 * tempname.c: Include stdlib.h unconditionally. On some old systems
4385 for which STDC_HEADERS is 0, it was not included, resulting in a
4386 warning about an integer-to-pointer conversion problem with getenv.
4387 Reported by Volker Borchert.
4389 2001-11-26 Jim Meyering <meyering@lucent.com>
4391 * gtod.h: Remove file.
4392 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
4393 * gettimeofday.c: Don't include gtod.h.
4394 (GTOD_init): Remove function.
4395 (rpl_gettimeofday): Do its job here instead, rather than aborting.
4396 Suggestion from Volker Borchert.
4398 2001-11-23 Jim Meyering <meyering@lucent.com>
4400 * hash.h (struct hash_table): Don't define here. Merely declare it.
4401 * hash.c (struct hash_table): Define it here instead.
4403 2001-11-22 Jim Meyering <meyering@lucent.com>
4405 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
4407 2001-11-18 Paul Eggert <eggert@twinsun.com>
4409 * tempname.c (TMP_MAX): Remove; no longer needed.
4410 (TEMPORARIES): New macro.
4411 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
4412 removes an artificial limitation (e.g. HP-UX 10.20, where
4415 2001-11-18 Jim Meyering <meyering@lucent.com>
4417 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
4420 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
4421 files will be created before anything else.
4423 2001-11-17 Jim Meyering <meyering@lucent.com>
4425 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
4426 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
4427 rather than group writable. Patch by Juan F. Codagnone.
4429 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
4430 Instead, include "xalloc.h".
4432 * mountlist.c: Include unlocked-io.h after all system headers.
4433 Remove explicit declarations of xmalloc, xrealloc,
4434 and xstrdup. Instead, include "xalloc.h".
4436 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
4437 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
4438 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
4440 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
4441 Reported by Padraig Brady.
4443 * mkstemp.c: #undef mkstemp.
4445 (rpl_mkstemp): Rename from mkstemp.
4448 2001-11-16 Jim Meyering <meyering@lucent.com>
4450 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
4451 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
4452 determine the amount of total physical memory, use pstat_getstatic.
4453 HPUX-11 doesn't define _SC_PHYS_PAGES.
4454 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
4455 If sysconf couldn't be used to determine the amount of available
4456 physical memory, use both pstat_getstatic and pstat_getdynamic.
4457 Based on a patch from Bob Proulx.
4459 2001-11-05 Jim Meyering <meyering@lucent.com>
4461 * xstat.in (slash_aware_lstat): Correct a misleading comment.
4463 2001-11-03 Jim Meyering <meyering@lucent.com>
4465 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
4466 in argmatch_to_argument call.
4468 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
4471 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
4472 e.g., a fault due to an attempt to free a NULL pointer.
4474 2001-11-01 Jim Meyering <meyering@lucent.com>
4476 * dirfd.c, dirfd.h: New files.
4477 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
4479 * hash.c (hash_print) [TESTING]: Clean up.
4481 2001-10-22 Paul Eggert <eggert@twinsun.com>
4483 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
4484 to avoid a warning if -Wall.
4486 2001-10-21 Paul Eggert <eggert@twinsun.com>
4488 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
4490 2001-10-21 Jim Meyering <meyering@lucent.com>
4492 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
4493 this code would end up calling gettext even in packages built
4495 * getopt.c (_): Likewise.
4496 * regex.c (_): Likewise.
4498 2001-10-20 Paul Eggert <eggert@twinsun.com>
4500 * error.c (strerror_r): Do not declare unless !_LIBC.
4501 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
4502 Use strerror_r that is only a macro, even if it is not a function.
4503 (strerror): Check for HAVE_DECL_STRERROR before declaring.
4504 (private_strerror): Use prototypes, not old-style function definition.
4505 (print_errno_message): New function.
4506 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
4508 (error_tail, error, error_at_line): Use it.
4510 2001-10-11 Jim Meyering <meyering@lucent.com>
4512 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
4513 and quote_n (1, ... to avoid clobbering a buffer.
4515 2001-10-05 Jim Meyering <meyering@lucent.com>
4517 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
4518 * hash-pjw.c: New file (factored out of fileutils' remove.c).
4519 * hash-pjw.h: New file.
4521 2001-09-30 Jim Meyering <meyering@lucent.com>
4523 * mountlist.c [MOUNTED_GETFSSTAT]:
4524 Include <sys/ucred.h>, for Apple Darwin.
4525 Include sys/mount.h and sys/fs_types.h only if available.
4527 (read_filesystem_list): Use FS_TYPE.
4529 2001-09-29 Paul Eggert <eggert@twinsun.com>
4531 * exclude.c (excluded_filename): 0 -> false, since it's
4534 2001-09-28 Paul Eggert <eggert@twinsun.com>
4536 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
4537 #defines strtoimax. Also treat the other strto* functions
4540 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
4541 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
4542 (strtoimax, strtoumax): Do not declare if already defined as a macro.
4544 2001-09-26 Jim Meyering <meyering@lucent.com>
4546 Most macros in unlocked-io.h had the wrong number of arguments.
4547 * gen-uio: New script.
4548 (USE_UNLOCKED_IO): Define to 1 if not already defined.
4549 * unlocked-io.hin: Remove file.
4550 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
4551 rather than trying to embed it here.
4552 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
4553 Reported by Padraig Brady.
4555 2001-09-25 Volker Borchert <bt@teknon.de>
4557 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
4559 2001-09-23 Jim Meyering <meyering@lucent.com>
4561 * mountlist.c: Remove useless parentheses in #if directives.
4562 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
4563 the deprecated MOUNTED symbol is no longer defined in mntent.h.
4565 2001-09-22 Jim Meyering <meyering@lucent.com>
4567 * localcharset.c: Update from latest gettext.
4568 * config.charset: Likewise.
4570 2001-09-20 Jim Meyering <meyering@lucent.com>
4572 * xstrtol.c (strtoimax): Guard declaration with
4573 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
4574 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
4575 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
4576 (strtoumax): Likewise, for completeness (it wasn't necessary).
4578 2001-09-06 Paul Eggert <eggert@twinsun.com>
4580 * strtoimax.c (HAVE_LONG_LONG):
4581 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
4582 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
4583 to work around bug in IBM C compiler.
4585 2001-09-16 Jim Meyering <meyering@lucent.com>
4587 * mkdir.c: New file.
4589 2001-09-04 Paul Eggert <eggert@twinsun.com>
4591 * xgetcwd.c: Revert some of the previous change; intead,
4592 fix the HAVE_GETCWD_NULL code to behave more like the
4593 !HAVE_GETCWD_NULL code used to.
4596 (xgetcwd): Do not return NULL when memory is exhausted; instead,
4599 2001-09-04 Paul Eggert <eggert@twinsun.com>
4601 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
4602 Use ssize_t, not int, to store result of readlink.
4603 Check for ssize_t overflow as well as size_t overflow,
4604 as POSIX says the result of readlink is implementation-defined
4605 when ssize_t overflows.
4606 Remove unnecessary cast to char*.
4607 Use free+malloc instead of realloc, as the storage doesn't need
4608 to be preserved and it's clearer and can be more efficient that way.
4609 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
4610 * xreadlink.h (xreadlink): Update prototype.
4612 2001-09-03 Paul Eggert <eggert@twinsun.com>
4614 * exclude.c (fnmatch_no_wildcards): Fix confusion between
4615 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
4616 spotted by Jim Meyering.
4618 2001-09-03 Jim Meyering <meyering@lucent.com>
4620 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
4622 2001-09-03 Paul Eggert <eggert@twinsun.com>
4624 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
4625 like the HAVE_GETCWD_NULL code.
4626 Include pathmax.h if not HAVE_GETCWD.
4627 Do not include xalloc.h.
4628 (INITIAL_BUFFER_SIZE): New symbol.
4629 Do not use xmalloc / xrealloc, since the caller is responsible for
4630 handling errors. Preserve errno around `free' during failure.
4631 Do not overrun buffer when using getwd.
4633 2001-09-03 Paul Eggert <eggert@twinsun.com>
4635 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
4636 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
4638 2001-09-02 Jim Meyering <meyering@lucent.com>
4640 * error.c: Update from GNU libc.
4642 2001-09-01 Jim Meyering <meyering@lucent.com>
4644 * xreadlink.c: New file.
4645 * xreadlink.h: New file.
4646 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
4648 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
4649 doesn't conflict with sparc Solaris 7's definition in
4650 /usr/include/sys/int_types.h.
4652 * exclude.c: Use `""', not `<>' to #include non-system header files.
4653 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
4654 and strncasecmp as r-values. Unixware didn't have declarations.
4656 2001-08-31 Jim Meyering <meyering@lucent.com>
4658 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
4659 Use an initial, malloc'd, buffer of length 128 rather than
4660 a statically allocated one of length 1024.
4662 2001-08-30 Paul Eggert <eggert@twinsun.com>
4664 * xgetcwd.c: Don't include pathmax.h.
4665 Include stdlib.h and unistd.h if available.
4667 (xmalloc, xstrdup, free): Remove decls.
4668 (xgetcwd): Don't assume sizes fit in unsigned.
4669 Check for overflow when computing sizes.
4670 Simplify reallocation code.
4672 2001-08-28 Paul Eggert <eggert@twinsun.com>
4674 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
4676 * strtoimax.c: Renamed from strtoxmax.c, removing the
4679 Also, make the following further changes to make this file's
4680 configuration more similar to that of strtol.c:
4681 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
4682 (strtoumax, uintmax_t, strtoull, strtol): Remove.
4683 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
4684 (strtoimax): Renamed from strtoumax. All uses of unsigned values
4685 changed to signed values.
4687 And make the following changes as well:
4688 Fix copyright notice, as 1999 was missing.
4689 (verify): New macro.
4690 (strtoimax): Check sizes at compile-time, not run-time.
4691 Prefer strtol to strtoll if both work.
4692 (main): Remove; it was not that useful and was a pain to maintain.
4694 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
4696 2001-08-30 Paul Eggert <eggert@twinsun.com>
4698 * savedir.c (savedir): Remove size parameter, as POSIX says that
4699 a directory's st_size can have an arbitrary value, so the old
4700 usage could waste an arbitrary amount of memory. All uses
4702 * savedir.h: Update prototype.
4704 2001-08-30 Paul Eggert <eggert@twinsun.com>
4706 * xstrtol.c (strtoimax): New decl.
4708 2001-08-28 Paul Eggert <eggert@twinsun.com>
4710 * xstrtol.h: Add copyright notice.
4711 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
4712 LONGINT_INVALID_SUFFIX_CHAR.
4714 2001-08-30 Paul Eggert <eggert@twinsun.com>
4716 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
4719 2001-08-30 Paul Eggert <eggert@twinsun.com>
4721 * hash.c: Remove '2001' from copyright notice.
4723 2001-08-30 Paul Eggert <eggert@twinsun.com>
4725 * full-write.h: New file.
4726 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
4727 * full-write.c: Correct credits, as cccp.c no longer
4728 exists and anyway it was so heavily changed from the old cccp
4729 code as to be unrecognizable. Include full-write.h.
4730 (full_write) Return size_t, with short writes meaning failure.
4731 All callers changed. This fixes a bug with large buffers
4733 * utime.c: Include full-write.h.
4735 2001-08-30 Paul Eggert <eggert@twinsun.com>
4737 Merge 'exclude' changes from tar 1.13.22.
4738 This fixes one or two unlikely storage allocation overflow bugs,
4739 but doesn't change user-visible behavior otherwise.
4741 2001-08-30 Paul Eggert <eggert@twinsun.com>
4743 * exclude.c (bool): Declare, perhaps by including stdbool.h.
4744 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
4745 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
4746 Include if available.
4747 (<xalloc.h>): Include
4748 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
4749 (verify): New macro. Use it to verify that EXCLUDE macros do not
4750 collide with FNM macros.
4751 (struct patopts): New struct.
4752 (struct exclude): Use it, as exclude patterns now come with options.
4753 (new_exclude): Support above changes.
4754 (new_exclude, add_exclude_file):
4755 Initial size must now be a power of two to simplify overflow checking.
4756 (free_exclude, fnmatch_no_wildcards): New function.
4757 (excluded_filename): No longer requires options arg, as the options
4758 are determined by add_exclude. Now returns bool, not int.
4759 (excluded_filename, add_exclude):
4760 Add support for the fancy new exclusion options.
4761 (add_exclude, add_exclude_file): Now takes int options arg.
4762 Check for arithmetic overflow when computing sizes.
4763 (add_exclude_file): xrealloc might modify errno, so don't
4764 realloc until after errno might be used.
4766 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
4768 (free_exclude): New decl.
4769 (add_exclude, add_exclude_file): Now takes int options arg.
4770 (excluded_filename): No longer requires options arg, as the options
4771 are determined by add_exclude. Now returns bool, not int.
4773 2001-08-30 Paul Eggert <eggert@twinsun.com>
4775 * alloca.c (alloca): Arg is of type size_t, not unsigned.
4777 2001-08-27 Jim Meyering <meyering@lucent.com>
4779 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
4781 * version-etc.c (N_): Remove definition.
4782 Revert most of last change.
4783 Instead, simply don't mark the `Copyright...' string for translation.
4784 Based on advice from Paul Eggert.
4786 * strtoxmax.c: Tweak comment.
4788 2001-08-26 Jim Meyering <meyering@lucent.com>
4790 * version-etc.c (version_etc_copyright_fmt): Replace literal year
4791 of copyright with `%s' so translators don't get an untranslated
4793 (COPYRIGHT_YEAR): Define.
4794 (version_etc): Use fprintf rather than fputs.
4795 Suggestion from Ulrich Drepper.
4797 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4799 * strtoll.c: New file, from GNU libc.
4800 * xstrtoimax.c: New file.
4802 * xstrtol.h: Add xstrtoimax.
4803 * strtoumax.c: New file. Simply include "strtoumax.c".
4804 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
4806 * strtoumax.c: Factor to work both for unsigned and signed types, ...
4807 * strtoxmax.c: ... then renamed to this.
4809 2001-08-13 Paul Eggert <eggert@twinsun.com>
4811 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
4812 Port to Solaris 8, where 'sed' requires a space after the 'r'
4813 command, and where sh dislikes "$/". Clean up the spacing a bit.
4814 Redirect output to $tmp just once.
4816 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
4818 * addext.c (<errno.h>): Include.
4819 (errno): Declare if not defined.
4820 (addext): Work correctly when pathconf returns -1 and leaves
4821 errno alone because there is no limit. Also, work even if
4822 pathconf returns a value greater than SIZE_MAX.
4824 2001-08-12 Jim Meyering <meyering@lucent.com>
4826 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
4827 Simply `return getcwd (NULL, 0);'.
4828 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
4829 Use 1300 as initial value for length, not PATH_MAX.
4831 * pathmax.h: Clean up cpp syntax.
4833 2001-08-12 Jim Meyering <meyering@lucent.com>
4835 * gettimeofday.c: New file.
4837 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
4839 2001-08-04 Jim Meyering <meyering@lucent.com>
4841 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
4842 to get in sync with glibc.
4844 2001-08-03 Paul Eggert <eggert@twinsun.com>
4846 The following changes are from gettext 0.10.39 as maintained by
4849 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
4850 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
4851 with inverted sense. All uses changed.
4853 * mbswidth.c: Don't include <limits.h>.
4854 Include <stdlib.h> and <string.h> unconditionally.
4855 (iswcntrl, mbsinit, ISCNTRL): New macros.
4856 (mbsnwidth): Use K&R style function declarations.
4857 Don't bother checking for MB_LEN_MAX == 1, since the compiler
4858 can optimize it when MB_CUR_MAX == 1.
4859 The width of control characters is zero, not 1.
4861 2001-07-15 Jim Meyering <meyering@lucent.com>
4863 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
4864 (BUILT_SOURCES): Add unlocked-io.h.
4865 (io_functions): Define.
4866 (unlocked-io.h): New rule.
4867 (DISTCLEANFILES): Add unlocked-io.h.
4868 (all-local): Depend on unlocked-io.h, to ensure it is created.
4870 * unlocked-io.hin: New file
4872 * regex.c: Update from glibc.
4874 2001-07-05 Jim Meyering <meyering@lucent.com>
4876 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
4878 (libfetish_a_SOURCES): Put all .h files here instead.
4879 Remove a thus-exposed (better checks in automake) duplicate and
4880 two unnecessary .h files.
4882 2001-06-11 Jim Meyering <meyering@lucent.com>
4884 * regex.c: Update from GNU libc.
4886 2001-05-27 Jim Meyering <meyering@lucent.com>
4888 * readutmp.h (UT_TYPE): Define.
4890 2001-05-24 Jim Meyering <meyering@lucent.com>
4892 * argmatch.c: Include "quote.h".
4893 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
4894 quote function. Reported by Göran Uddeborg.
4896 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
4898 * dirname.c (dir_name): Compute append_dot using path, not newpath
4899 which is not yet declared.
4901 2001-05-11 Paul Eggert <eggert@twinsun.com>
4903 * Makefile.am (libfetish_a_SOURCES):
4904 Add strftime.c, since we now compile it on all hosts.
4906 * strftime.c (my_strftime):
4907 Define to nstrftime if emacs, but only if my_strftime is not defined.
4908 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
4909 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
4910 Add one more extra argument: a nanoseconds value.
4913 (my_strftime function): Add %N format.
4914 (emacs_strftimeu): Renamed from emacs_strftime,
4915 with extra ut argument.
4917 2001-05-11 Paul Eggert <eggert@twinsun.com>
4919 dirname code cleanup. base_name now behaves more compatibly
4920 with POSIX basename when given file names that have trailing
4921 slashes, and similarly for dir_name. Add new primitives
4922 base_len and dir_len. Put the directory-name-related decls
4925 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
4926 * backupfile.c (base_name): Likewise.
4927 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
4928 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
4929 * makepath.c (strip_trailing_slashes): Likewise.
4930 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
4932 * rename.c (strip_trailing_slashes): Likewise.
4933 * same.c (base_name): Likewise.
4934 * stripslash.c (ISSLASH): Likewise.
4936 * addext.c: Include <dirname.h> after size_t is defined.
4937 * backupfile.c: Likewise.
4939 * addext.c (addext): Use base_len to trim redundant
4940 trailing slashes instead of doing it ourselves.
4941 But do not trim the last slash if it is not redundant.
4943 * backupfile.c (find_backup_file_name,
4944 max_backup_version): Use base_len instead of rolling it ourselves.
4945 Handle the case of "" and (on DOS) "C:" correctly.
4947 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
4948 Include <string.h>, <dirname.h>.
4949 (base_name): Allow file names ending in slashes, other than names
4950 that are all slashes. In this case, return the basename followed
4951 by the slashes. This is more general, and can be used in places
4952 where the original base_name purposely had an assertion failure.
4953 (base_len): New function.
4955 * dirname.c: Include <string.h> instead of <stdlib.h>.
4956 Do not include <assert.h>; no longer needed.
4958 (memrchr): Remove decl.
4959 (dir_name_r): Remove.
4960 (dir_len): Renamed from dirlen. All callers changed.
4961 Rewrite in terms of base_name, for simplicity and consistency.
4962 (dir_name): Never return NULL. All callers changed.
4963 Do not include <stdlib.h> in test program; no longer needed.
4964 return 0; is fine for test program.
4966 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
4968 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
4970 * path-concat.c (path_concat): Use base_len to compute
4971 base length, not strlen; this means we cannot rely on memcpy
4974 * same.c (STREQ): Remove.
4975 (same_name): Handle the case where the basename ends in trailing '/'.
4977 * stripslash.c (strip_trailing_slashes): Return nonzero if
4978 a slash was stripped. Do not strip the last slash after a
4981 2001-04-08 Jim Meyering <meyering@lucent.com>
4983 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
4984 recomputed; that's necessary when the offset spans a DST transition.
4985 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
4987 2001-04-02 Jim Meyering <meyering@lucent.com>
4989 * regex.h, regex.c: Update from GNU libc.
4991 2001-03-19 Paul Eggert <eggert@twinsun.com>
4993 * version-etc.c (version_etc_copyright): Update to 2001.
4995 2001-03-16 Paul Eggert <eggert@twinsun.com>
4997 * tempname.c (uint64_t): Define to uintmax_t if
4998 not defined, and if UINT64_MAX is not defined.
4999 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5000 Reported by John David Anglin.
5002 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5004 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5005 alias if codeset is empty.
5006 * config.charset (BeOS): Use wildcard syntax.
5008 2001-03-13 Jim Meyering <meyering@lucent.com>
5010 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5011 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5014 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5016 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5018 * unicodeio.c (print_unicode_char): Simplify accordingly.
5020 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5022 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5023 support for DOS/DJGPP.
5025 2001-02-28 Paul Eggert <eggert@twinsun.com>
5027 * Makefile.am (libfetish_a_SOURCES):
5028 Add dup-safer.c, fopen-safer.c.
5029 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5031 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5033 2001-02-25 Paul Eggert <eggert@twinsun.com>
5035 The mkstemp replacement is taken from glibc 2.2.2, with some
5036 portability fixes for use outside glibc, as follows:
5038 * tempname.c (struct_stat64): New macro.
5039 (direxists, __gen_tempname): Use it.
5040 This avoids a portability problem with Solaris 8.
5042 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5043 (<stddef.h>, <stdint.h>, <string.h>):
5044 Include only if STDC_HEADERS || _LIBC.
5045 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5046 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5047 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5048 (__set_errno): Define this macro if <errno.h> doesn't.
5049 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5050 Define these macros if <stdio.h> doesn't.
5051 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5052 Define these macros if <sys/stat.h>
5053 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5054 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5055 __xstat64): Define if not _LIBC.
5056 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5057 (__gen_tempname): Invoke gettimeofday only if
5058 HAVE_GETTIMEOFDAY || _LIBC;
5059 otherwise, fall back on plain "time".
5060 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5062 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5064 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5066 2001-02-17 Jim Meyering <meyering@lucent.com>
5068 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5069 around included file name.
5071 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5073 * strftime.c: Update from GNU libc (the only changes were to comments).
5075 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5077 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5079 2001-02-17 Paul Eggert <eggert@twinsun.com>
5081 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5082 Remove workaround macros for hosts that have mbrtowc but not
5083 mbstate_t, as we now insist on proper declarations for both
5084 before using mbrtowc.
5086 2001-02-17 Jim Meyering <meyering@lucent.com>
5088 * regex.c: Update from libc.
5090 2001-02-16 Paul Eggert <eggert@twinsun.com>
5092 * alloca.c (malloc): Undef before defining, since stdlib.h
5093 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5094 Reported by Mark Hounschell via Paul Eggert.
5096 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5098 * config.charset: Update for FreeBSD 4.2.
5100 2001-01-26 Jim Meyering <meyering@lucent.com>
5102 * quotearg.c: Include stddef.h.
5103 * quote.c: Include stddef.h.
5104 Reported by Axel Kittenberger.
5106 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5107 line in double quotes so that it evokes a better diagnostic.
5108 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5109 Reported by Axel Kittenberger.
5111 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5113 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5114 to avoid a warning. Add back 'const' to inptr.
5116 2001-01-16 Jim Meyering <meyering@lucent.com>
5118 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5121 2001-01-14 Jim Meyering <meyering@lucent.com>
5123 * rename.c: New file. From Volker Borchert.
5124 Include stdlib.h, string.h or strings.h, and xalloc.h.
5125 Use strip_trailing_slashes rather than open-coding it.
5127 2001-01-03 Paul Eggert <eggert@twinsun.com>
5129 * strftime.c: Sync with glibc time/strftime.c 1.81.
5131 2001-01-03 Jim Meyering <meyering@lucent.com>
5133 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5134 local `inptr' to avoid warning with some system declarations of iconv.
5136 2000-12-29 Paul Eggert <eggert@twinsun.com>
5138 * modechange.c: Do not assume that mode_t uses the
5139 traditional octal encoding. E.g. "chmod 1 FOO" should set
5140 the other-execute bit of FOO even if S_IXOTH != 1.
5142 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5143 WOTH, XOTH, ALLM): New macros.
5144 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5145 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5147 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5148 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5150 No need to use uintmax_t; unsigned long is long enough.
5151 Don't bother to get suffix since we don't use it.
5153 2000-12-24 Jim Meyering <meyering@lucent.com>
5155 * hash.c (is_prime): Return explicit boolean values.
5156 (hash_get_first): Return NULL to appease Irix5.6's 89.
5157 Reported by Nelson Beebe.
5159 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5161 * localcharset.c (locale_charset): Add support for Win32.
5163 2000-12-18 Paul Eggert <eggert@twinsun.com>
5165 * physmem.h, physmem.c: New files.
5167 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5168 (noinst_HEADERS): Add physmem.h.
5170 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5171 't' for compatibility with Solaris 8 sort.
5173 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5175 * config.charset: Add support for BeOS.
5177 2000-12-16 Jim Meyering <meyering@lucent.com>
5179 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5180 SHELLS_FILE to a file name that's useful on djgpp systems.
5182 (ADDITIONAL_DEFAULT_SHELLS): Define.
5183 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5184 Based mostly on a patch from Prashant TR.
5186 2000-12-16 Jim Meyering <meyering@lucent.com>
5188 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5189 N and M) would have treated it like `chown N:N FILE'.
5191 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5193 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5195 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5196 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5197 to the list of canonical encodings. Rename EUC-CN to GB2312.
5199 2000-12-08 Andreas Schwab <schwab@suse.de>
5201 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5202 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5204 2000-12-07 Jim Meyering <meyering@lucent.com>
5206 * stripslash.c (ISSLASH): Define.
5207 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5210 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5211 (dir_name_r): Declare this function as static.
5212 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5213 manifest itself on a name containing a mix of slashes and
5215 Make this function work with names starting with a DOS-style
5216 drive letter and colon prefix.
5217 (dir_name): Append `.' if necessary.
5218 Based mostly on patches from Prashant TR and Eli Zaretskii.
5220 * dirname.h (dir_name_r): Remove prototype.
5222 2000-12-05 Jim Meyering <meyering@lucent.com>
5224 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5226 2000-12-04 Jim Meyering <meyering@lucent.com>
5228 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5229 Also include memory.h, stdlib.h, unistd.h if appropriate.
5230 Reported by Andreas Jaeger (conflicting declaration of malloc).
5232 2000-12-02 Jim Meyering <meyering@lucent.com>
5234 * closeout.h: Make idempotent, to avoid some obscure warnings.
5236 2000-12-01 Paul Eggert <eggert@twinsun.com>
5238 * memrchr.c: Include <config.h> before any system include file.
5240 2000-11-29 Paul Eggert <eggert@twinsun.com>
5242 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5244 2000-11-26 Jim Meyering <meyering@lucent.com>
5246 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5248 2000-11-22 Paul Eggert <eggert@twinsun.com>
5250 * strftime.c (my_strftime): Do not invoke mbrlen with a
5251 size of (size_t) -1; it's not portable.
5253 2000-11-17 Akim Demaille <akim@epita.fr>
5255 * obstack.h: Formatting changes.
5256 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5257 prevent type checking.
5258 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5259 cast the value to (void *): assigning a `foo *' to a `void *'
5261 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
5263 2000-11-17 Jim Meyering <meyering@lucent.com>
5265 * strstr.c: Update from GNU libc.
5267 2000-11-16 Jim Meyering <meyering@lucent.com>
5269 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
5271 2000-11-11 Jim Meyering <meyering@lucent.com>
5273 * error.c: Add a couple #includes, merging from GNU libc version.
5275 2000-11-10 Jim Meyering <meyering@lucent.com>
5277 * obstack.h: Update from GNU libc.
5278 * obstack.c: Likewise.
5280 2000-11-06 Paul Eggert <eggert@twinsun.com>
5282 * getusershell.c (setusershell): Use rewind rather than
5283 fseek/fseeko, to avoid configuration hassles with fseeko.
5284 Don't bother opening SHELLS_FILE if shellstream is NULL;
5287 2000-11-05 Jim Meyering <meyering@lucent.com>
5289 * makepath.h (make_dir): Declare.
5290 * makepath.c (make_dir): Remove `static' attribute.
5293 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
5295 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
5296 last one in a bucket, advance to the next bucket.
5298 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
5300 * fnmatch.c: Do not comment out all the code if we are using
5301 the GNU C library, because in some cases we are replacing buggy
5302 code in the GNU C library itself.
5304 2000-10-30 Paul Eggert <eggert@twinsun.com>
5306 * error.h, getline.h, modechange.h:
5307 Remove "2000" from Copyright line, as the file hasn't been
5308 changed this year other than in the copyright notice.
5310 * xalloc.h: Add "2000" to Copyright line, as this file
5311 was changed this year.
5313 2000-10-30 Paul Eggert <eggert@twinsun.com>
5315 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
5316 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
5317 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
5319 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
5321 * regex.h (__restrict_arr): Move definition out of #ifndef block.
5322 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
5323 doesn't define __restrict_arr.
5325 2000-10-29 Jim Meyering <meyering@lucent.com>
5327 * xstat.in: Fix grammar in comment.
5329 2000-10-28 Jim Meyering <meyering@lucent.com>
5331 * memchr.c: Update from libc.
5332 Adjust for portability:
5333 [HAVE_STDLIB_H]: Include stdlib.h.
5334 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
5335 Undef __memchr, too.
5336 [!weak_alias]: Define __memchr to memchr.
5338 * regex.c: Update from libc.
5339 * regex.h: Likewise.
5340 * getopt1.c: Likewise.
5341 * memcmp.c: Likewise.
5343 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
5344 Avoid using fseek, when possible -- it's broken by design.
5345 Patch by Ulrich Drepper.
5347 2000-10-26 Jim Meyering <meyering@lucent.com>
5349 * strftime.c: Update from libc.
5351 2000-10-25 Jim Meyering <meyering@lucent.com>
5353 * obstack.c: Update from libc.
5355 2000-10-23 Jim Meyering <meyering@lucent.com>
5357 * hard-locale.c (hard_locale): Revert last change -- it was simply
5358 wrong. That set_locale call must not have any side effects.
5361 2000-10-22 Jim Meyering <meyering@lucent.com>
5363 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
5364 [CYCLIC]: Remove now-unused definition.
5366 * save-cwd.c (O_DIRECTORY): Define, if needed.
5367 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
5368 Suggestion from Ulrich Drepper.
5370 2000-10-21 Jim Meyering <meyering@lucent.com>
5372 * dirname.c (dir_name_r): New function, factored out of dir_name.
5373 (dir_name): Use dir_name_r.
5374 * dirname.h (dir_name_r): Declare it.
5376 2000-10-21 Jim Meyering <meyering@lucent.com>
5378 * dirname.c (memrchr): Declare if necessary.
5379 (dir_name): Remove the restriction that there be no
5380 trailing slashes. Now, this code skips past them, effectively
5382 [TEST_DIRNAME] (main): New unit tests.
5384 * memrchr.c: New file from GNU libc.
5385 Undef __memrchr, too.
5386 [!weak_alias]: Define __memrchr to memrchr.
5387 Guard weak_alias use with `#ifdef weak_alias'.
5389 2000-10-17 Jim Meyering <meyering@lucent.com>
5391 * quote.h (PARAMS): Define and use.
5392 Reported by Akim Demaille.
5394 * getopt.c: Update from libc.
5396 2000-10-16 Jim Meyering <meyering@lucent.com>
5398 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
5401 2000-09-25 Jim Meyering <meyering@lucent.com>
5403 * md5.h (rol): Define (from GnuPG).
5405 * sha.c: Give credit (GnuPG) where due.
5406 (M): Use rol rather than open-coding it.
5407 Add a FIXME comment.
5409 2000-09-21 Jim Meyering <meyering@lucent.com>
5411 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
5412 Reported by Michael Stone.
5414 2000-09-20 Jim Meyering <meyering@lucent.com>
5416 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
5417 (noinst_HEADERS): Add sha.h.
5418 Based on code from Scott G. Miller and from GnuPG.
5420 2000-09-15 Jim Meyering <meyering@lucent.com>
5422 * regex.c: Update from libc.
5424 2000-09-10 Jim Meyering <meyering@lucent.com>
5426 * getopt.c (_getopt_internal): Update from glibc.
5428 2000-09-09 Jim Meyering <meyering@lucent.com>
5430 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
5431 think it should be used as a general replacement for isascii.
5432 * fnmatch.c: Likewise.
5433 * mbswidth.c: Likewise
5434 * regex.c: Likewise.
5437 * userspec.c: Include sys/param.h and limits.h.
5439 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5440 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
5441 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
5442 UID, GID. Check range.
5444 2000-09-06 Jim Meyering <meyering@lucent.com>
5446 * getopt.c (_getopt_internal): Update from glibc.
5448 2000-08-30 Jim Meyering <meyering@lucent.com>
5450 * strftime.c: Merge in changes from GNU libc.
5452 2000-08-26 Jim Meyering <meyering@lucent.com>
5454 * closeout.c: Include "__fpending.h".
5455 (close_stdout_status): Return right away if there's nothing to flush.
5457 * Makefile.am (noinst_HEADERS): Add __fpending.h.
5458 * __fpending.c: New file.
5459 * __fpending.h: New file.
5461 2000-08-07 Paul Eggert <eggert@twinsun.com>
5463 Standardize on "memory exhausted" instead of "Memory exhausted"
5464 or "virtual memory exhausted".
5465 * obstack.c (print_and_abort): Use "memory exhausted", not
5466 "virtual memory exhausted".
5467 * same.c (same_name): Invoke xalloc_die instead of printing
5469 * userspec.c (parse_user_spec): Likewise.
5470 * bumpalloc.h: comment fix
5471 * same.c, userspec.c: Include xalloc.h.
5473 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
5474 not char *const and pointing to a constant array.
5475 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
5476 (xrealloc): Comment fix.
5478 * userspec.c (parse_user_spec):
5479 Don't translate a message until just before returning,
5480 to avoid unnecessary translation.
5482 2000-08-07 Jim Meyering <meyering@lucent.com>
5484 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
5485 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
5486 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
5487 getgroups.c, gethostname.c, getopt.h, group-member.c,
5488 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
5489 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
5490 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
5491 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
5492 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
5493 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
5494 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
5495 yesno.c: Back out Copyright date changes for each file with no change
5496 this year. This eases coordination with other programs using the same
5497 source code modules. From Paul Eggert.
5499 2000-08-03 Greg McGary <greg@mcgary.org>
5501 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
5502 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
5503 (EXTEND_BUFFER): Use them.
5505 2000-08-01 Jim Meyering <meyering@lucent.com>
5507 * dirname.c (ISSLASH): Define.
5508 (BACKSLASH_IS_PATH_SEPARATOR): Define.
5509 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
5510 both `\' and `/' may be use as path separators.
5511 Based on a patch from Prashant TR.
5513 2000-07-31 Paul Eggert <eggert@twinsun.com>
5515 * quotearg.c (quotearg_n_options): Don't make the initial
5516 slot vector a constant, since it might get modified.
5518 2000-07-31 Jim Meyering <meyering@lucent.com>
5520 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
5521 * obstack.c (print_and_abort): Likewise.
5523 2000-07-30 Paul Eggert <eggert@twinsun.com>
5525 * quotearg.c (quotearg_n_options): Preallocate a slot 0
5526 buffer, so that the caller can always quote one small
5527 component of a "memory exhausted" message in slot 0.
5528 From a suggestion by Jim Meyering.
5530 2000-07-30 Jim Meyering <meyering@lucent.com>
5532 * makepath.c (make_path): Quote the other instance, too.
5534 * quotearg.c (N_STATIC_SLOTVECS): Define.
5535 (STATIC_BUF_SIZE): Define.
5536 (quotearg_n_options): Use only statically allocated storage when
5537 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
5538 than STATIC_BUF_SIZE.
5540 2000-07-29 Jim Meyering <meyering@lucent.com>
5542 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
5543 * dirname.c (dir_name): Likewise.
5545 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
5547 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
5548 (dir_name): Assert that there are no trailing slashes.
5550 2000-07-18 Bruno Haible <haible@clisp.cons.org>
5552 * mbswidth.h (mbswidth): Add a flags argument.
5553 (mbswidth): New declaration.
5554 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
5555 * mbswidth.c (mbswidth): Add a flags argument.
5556 (mbsnwidth): New function.
5558 2000-07-24 Jim Meyering <meyering@lucent.com>
5560 * mbswidth.c: Remove useless #else. From Bruno Haible.
5562 2000-07-23 Paul Eggert <eggert@twinsun.com>
5564 * mbswidth.c (_XOPEN_SOURCE):
5565 Don't define; this causes problems on Solaris 7.
5566 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
5568 2000-07-23 Paul Eggert <eggert@twinsun.com>
5571 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
5572 so that mbstate_t is always defined.
5574 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
5575 be 1 in at least one GCC installation, and this configuration
5576 error is likely to be common. Ignoring MB_LEN_MAX hurts
5577 performance on hosts that have mbrtowc but have only unibyte
5578 locales, but I assume these hosts are rare.
5580 2000-07-23 Paul Eggert <eggert@twinsun.com>
5582 * quotearg.c: Streamline by invoking multibyte code only if needed.
5583 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
5584 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
5585 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
5586 invoke multibyte primitives.
5588 2000-07-23 Jim Meyering <meyering@lucent.com>
5590 * basename.c (base_name): Add an assertion.
5592 2000-07-15 Bruno Haible <clisp.cons.org>
5594 * quotearg.c: When the system forces us to redefine mbstate_t,
5595 shadow its mbsinit function.
5597 2000-07-16 Bruno Haible <haible@clisp.cons.org>
5599 * mbswidth.h: New file.
5600 * mbswidth.c: New file.
5601 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
5602 (noinst_HEADERS): Add mbswidth.h.
5604 2000-07-17 Bruno Haible <haible@clisp.cons.org>
5606 * config.charset: Add support for FreeBSD. Improve support for HP-UX
5609 2000-07-15 Jim Meyering <meyering@lucent.com>
5611 * makepath.c: Include quote.h.
5612 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
5613 corresponding argument in a `quote (...)' call.
5614 Give better diagnostics.
5616 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
5617 (noinst_HEADERS): Add quote.h.
5619 * quote.c (quote, quote_n): New file. Two functions taken verbatim
5620 from tar's src/misc.c.
5621 * quote.h: New file. Prototypes for same.
5623 2000-07-10 Paul Eggert <eggert@twinsun.com>
5625 From a suggestion by Bruno Haible.
5626 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
5627 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
5628 to decide whether to define the BeOS workaround macro;
5629 this adjusts to the change to AC_MBSTATE_T.
5631 2000-07-13 Paul Eggert <eggert@twinsun.com>
5633 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
5635 * quotearg.c (quoting_style_args, quoting_style_vals,
5636 quotearg_buffer_restyled): Add support for
5637 clocale_quoting_style. Undo previous change to
5638 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
5639 and "{RIGHT QUOTATION MARK}" msgids.
5641 2000-07-05 Paul Eggert <eggert@twinsun.com>
5643 The old behavior of quoting `like this' doesn't look good with
5644 newer, ISO-style fonts. See:
5645 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
5647 Instead, quote "like this" by default. Let the translator
5648 tailor the locale-specific quoting behavior by providing
5649 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
5651 * quotearg.c (N_): New macro.
5652 (gettext_default): New function.
5653 (quotearg_buffer_restyled): Use
5654 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
5655 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
5657 2000-07-09 Jim Meyering <meyering@lucent.com>
5659 * Most files: Update copyright dates to include 2000.
5661 2000-07-08 Jim Meyering <meyering@lucent.com>
5663 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
5665 (xgethostname): Remove now-unnecessary #ifdef.
5666 Move declaration of `err' into loop where it's used.
5668 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5670 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
5671 by allocating a larger buffer. Test the gethostname return value for
5672 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
5673 returns an error and ENAMETOOLONG isn't defined.
5675 2000-07-05 Paul Eggert <eggert@twinsun.com>
5676 and Bruno Haible <haible@clisp.cons.org>
5678 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
5680 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5682 * quotearg.c (struct quoting_options): Simplify quote_these_too
5685 2000-07-03 Jim Meyering <meyering@lucent.com>
5687 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
5688 Reported by Bruno Haible.
5690 2000-07-04 Jim Meyering <meyering@lucent.com>
5692 * quotearg.c: Make inclusion of <wchar.h> independent of whether
5693 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
5696 2000-07-03 Paul Eggert <eggert@twinsun.com>
5697 and Bruno Haible <haible@clisp.cons.org>
5699 * quotearg.c (mbrtowc):
5700 Assign to *pwc, and return 1 only if result is nonzero.
5701 (iswprint): Use ISPRINT when substituting our own mbrtowc.
5703 2000-07-03 Jim Meyering <meyering@lucent.com>
5705 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
5706 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
5709 2000-07-02 Jim Meyering <meyering@lucent.com>
5711 * quotearg.c (mbstate_t): Don't define here.
5713 2000-07-02 Jim Meyering <meyering@lucent.com>
5715 * nanosleep.c (SIGCONT): Define if not already defined.
5717 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5719 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
5720 per change in ../m4/ls-mntd-fs.m4.
5721 (read_filesystem_list): Ignore symbolic links.
5723 2000-06-29 Jim Meyering <meyering@lucent.com>
5725 * same.c: Include <string.h> or <strings.h>, as appropriate,
5726 for declaration of strcmp.
5728 * long-options.c: Include <stdlib.h>, for declaration of exit.
5730 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
5731 Avoid warning by casting result to `char *' to remove `const'.
5733 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5735 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
5737 2000-06-26 Paul Eggert <eggert@twinsun.com>
5739 savedir now sets errno on failure and invokes xmalloc to get memory.
5740 Fix a couple of other minor bugs while we're at it.
5742 * savedir.c (<unistd.h>): Do not include; there's no need.
5743 (NAMLEN): Remove macro.
5744 (malloc, realloc): Remove decls.
5746 ("xalloc.h"): Include.
5747 (NAME_SIZE_DEFAULT): New macro.
5748 (savedir): Use xmalloc / xrealloc to allocate memory.
5749 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
5750 Skip "" directory entries.
5751 Use strlen to calculate directory entry length, since the old method
5752 is rarely used these days and isn't worth supporting.
5753 Don't use a pointer after freeing it.
5754 Check for integer overflow when calculating allocation size.
5755 Use memcpy to copy entries, instead of stpcpy.
5756 Set errno properly when returning NULL.
5757 Check for readdir error.
5759 2000-06-26 Jim Meyering <meyering@lucent.com>
5761 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
5763 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5765 * getusershell.c (xmalloc, xrealloc): Remove functions.
5767 Don't include <stdlib.h>. Don't declare malloc, realloc.
5769 2000-06-23 Bruno Haible <haible@clisp.cons.org>
5771 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
5773 2000-06-24 Jim Meyering <meyering@lucent.com>
5775 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
5777 2000-06-21 Jim Meyering <meyering@lucent.com>
5779 * getpass.c: New file, from Bruno Haible. Required for BeOS.
5781 2000-06-19 Paul Eggert <eggert@twinsun.com>
5783 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
5784 (mbrtowc, mbstate_t): Define substitutes if
5785 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
5786 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
5787 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
5789 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5791 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
5792 than 1024, return a memory chunk of least possible size, instead
5793 of size PATH_MAX + 2. In the loop, increment the size proportionally.
5794 Use free/xmalloc instead of xrealloc to avoid copying for very long
5797 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5799 * canon-host.c (canon_host): Use malloc and memcpy to copy an
5800 address, not strdup. Include <stdlib.h> and don't declare free().
5802 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5804 * path-concat.c (path_concat): Don't access dir[-1] if dir is
5807 2000-06-21 Jim Meyering <meyering@lucent.com>
5809 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
5810 (noinst_HEADERS): Add getstr.h.
5812 * getline.c (getstr): Move into a separate file.
5813 * getstr.c (getstr): New file, extracted from getline.c, with
5814 the following changes: new parameter, delim2; both delim[12]
5815 parameters have type `int', not `char'. The latter would lose
5816 with 8-bit delimiters.
5817 * getstr.h: New file.
5819 2000-06-19 Jim Meyering <meyering@lucent.com>
5821 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
5823 2000-06-18 Jim Meyering <meyering@lucent.com>
5825 * mkdir.c: Remove file, due mainly to copyright incompatibility.
5826 Besides, these days every porting target provides a mkdir function.
5828 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
5829 (this snippet comes from src/system.h).
5831 2000-06-15 Paul Eggert <eggert@twinsun.com>
5833 * human.c (adjust_value): New function.
5834 (human_readable_inexact): Apply rounding style even when
5835 printing approximate values.
5837 2000-06-14 Paul Eggert <eggert@twinsun.com>
5839 * human.c (human_readable_inexact): Allow an input block
5840 size that is not a multiple of the output block size, and vice versa.
5841 Reported by Piergiorgio Sartor.
5843 2000-06-14 Paul Eggert <eggert@twinsun.com>
5845 * getdate.y (get_date): Apply relative times after time
5846 zone indicator, not before. Reported by Todd A. Jacobs.
5848 2000-06-13 Jim Meyering <meyering@lucent.com>
5850 * Makefile.am (all-local): Depend on lstat.c and stat.c.
5852 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
5854 2000-06-12 Paul Eggert <eggert@twinsun.com>
5856 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
5858 2000-06-04 Paul Eggert <eggert@twinsun.com>
5860 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
5862 2000-06-04 Jim Meyering <meyering@lucent.com>
5864 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
5865 SunOS 4.1.4 for which gid_t is an unsigned type.
5867 2000-06-03 Jim Meyering <meyering@lucent.com>
5869 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
5871 2000-05-26 Bruno Haible <haible@clisp.cons.org>
5873 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
5874 newer, don't install charset.alias.
5875 * config.charset: Change the Linux/glibc rules so they become empty
5876 on glibc-2.1 or newer.
5878 2000-06-02 Jim Meyering <meyering@lucent.com>
5880 * mountlist.c: Back out last change. Instead, do this...
5881 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
5882 member using the same `ignore'-testing code.
5883 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
5887 2000-05-29 Jim Meyering <meyering@lucent.com>
5889 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
5890 with the `ignore' attribute. Based on a patch from Mark D. Roth.
5892 2000-05-22 Jim Meyering <meyering@lucent.com>
5894 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
5896 2000-05-18 Jim Meyering <meyering@lucent.com>
5898 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
5899 back, too, since it may have been modified by allocate_entry.
5900 (hash_delete): Rewrite to use neither the assignment operator
5901 nor the comma operator in an if-expression.
5903 2000-05-15 Paul Eggert <eggert@twinsun.com>
5906 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
5907 Remove; no longer needed.
5908 "quotearg.h": Add include.
5909 (file_name): Do not bother to explicitly initialize to NULL; it's less
5910 efficient on some hosts.
5911 (close_stdout_status): Remove test as to whether stdout was already
5912 closed; it breaks for the case "echo x | sort >&-".
5913 Quote file name colons.
5914 Do not assume that _("write error") lacks format strings.
5916 2000-05-15 Jim Meyering <meyering@lucent.com>
5918 * version-etc.c (version_etc_copyright): Update the copyright string
5919 used in all --version output.
5921 2000-05-14 Jim Meyering <meyering@lucent.com>
5923 * closeout.c (close_stdout_set_file_name): New function.
5924 (close_stdout_status): Use new file-scoped global.
5925 Return right away if fstat says the stdout file descriptor is invalid.
5926 * closeout.h (close_stdout_set_file_name): Declare.
5928 2000-05-10 Jim Meyering <meyering@lucent.com>
5930 * closeout.c [default_exit_status]: New file-scoped variable.
5931 (close_stdout_set_status): New function.
5932 * closeout.h (close_stdout_set_status): Declare.
5934 2000-05-08 Jim Meyering <meyering@lucent.com>
5936 * long-options.c: Don't include closeout.h.
5937 (parse_long_options): Don't call close_stdout for --version.
5939 2000-05-06 Jim Meyering <meyering@lucent.com>
5941 * strnlen.c: Undefine __strnlen and strnlen.
5942 [!weak_alias]: Define __strnlen to strnlen.
5944 * atexit.c: New file, from libiberty.
5946 2000-05-06 Jim Meyering <meyering@lucent.com>
5948 * closeout.c (close_stdout_status): Also check for errors on the
5951 2000-05-05 Bruno Haible <haible@clisp.cons.org>
5953 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
5954 instead of xmalloc, xrealloc, path_concat.
5955 (locale_charset): Treat empty environment variables as absent.
5956 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
5958 2000-05-04 Jim Meyering <meyering@lucent.com>
5960 * getopt.c: Update from glibc.
5961 * obstack.c: Likewise.
5962 * obstack.h: Likewise.
5963 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
5965 * regex.h: Likewise.
5966 * strndup.c: Likewise.
5967 * strnlen.c: New file, from glibc.
5969 2000-05-01 Jim Meyering <meyering@lucent.com>
5971 * full-write.c (full_write): Remove `FIXME' part of comment.
5973 2000-04-29 Jim Meyering <meyering@lucent.com>
5975 * path-concat.c: Declare strdup only if it's not defined.
5976 * canon-host.c: Likewise.
5978 2000-04-28 Jim Meyering <meyering@lucent.com>
5980 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
5981 redefinition warning on some systems (HPUX). Otherwise, regex.h is
5982 included first, then limits.h is included by locale.h by libintl.h.
5983 From John David Anglin.
5985 2000-04-25 Jim Meyering <meyering@lucent.com>
5987 * makepath.c (S_IRWXUGO): Define.
5988 (make_path): Always perform explicit chmod if MODE specifies any
5989 of the `special' permission bits. Prompted by a bug report against
5990 install from Mate Wierdl and Joost van Baal.
5992 2000-04-18 Jim Meyering <meyering@lucent.com>
5996 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
5997 getpagesize. For BeOS. Based on a patch from Bruno Haible.
5999 2000-04-17 Jim Meyering <meyering@lucent.com>
6001 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6002 the definition of it to rpl_strftime also defined-away the system's
6005 2000-04-15 Jim Meyering <meyering@lucent.com>
6007 Use `C' to denote so-called `contiguous' files, the same way
6009 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6010 (ftypelet): Use S_ISCTG.
6011 From Michael Deutschmann.
6013 2000-04-14 Jim Meyering <meyering@lucent.com>
6015 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6017 2000-04-08 Jim Meyering <meyering@lucent.com>
6019 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6020 names don't conflict. Reported by Eli Zaretskii.
6022 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6024 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6025 bug. Deal with the different error behavior of Irix iconv.
6027 2000-04-07 Jim Meyering <meyering@lucent.com>
6029 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6030 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6032 2000-04-05 Jim Meyering <meyering@lucent.com>
6034 Portability tweaks required for ultrix4.3.
6035 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6036 * readutmp.c: Include sys/types.h before sys/stat.h.
6037 * canon-host.c: Declare strdup.
6038 * path-concat.c: Likewise.
6039 From John David Anglin.
6041 2000-04-04 Jim Meyering <meyering@lucent.com>
6043 Be more DOS 8.3-friendly.
6044 * ref-add.sin: Renamed from ref-add.sed.in.
6045 * ref-del.sin: Renamed from ref-del.sed.in.
6046 * Makefile.am: Reflect renaming.
6047 Reported by Eli Zaretskii.
6049 Use a temporary file name that won't clash with `charset.alias'
6050 in the DOS 8.3 name space.
6051 * Makefile.am (charset_tmp): Define.
6052 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6053 (uninstall-local): Likewise.
6054 Reported by Eli Zaretskii.
6056 2000-03-29 Paul Eggert <eggert@twinsun.com>
6058 * time/strftime.c (my_strftime): Make sure we call the system
6059 strftime, not ourselves, when invoking the underlying strftime.
6061 2000-03-24 Jim Meyering <meyering@lucent.com>
6063 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6064 (charset_alias): Define.
6065 (install-exec-local): Factor out common code.
6066 (uninstall-local): Split lines longer than 80.
6067 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6069 (.sed.in.sed): New rule. Don't redirect directly to $@.
6070 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6072 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6074 * config.charset: Output a line containing "Packages using this file".
6075 * ref-add.sed.in, ref-del.sed.in: New files.
6076 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6077 ref-del.sed): New rules.
6079 2000-03-17 Jim Meyering <meyering@lucent.com>
6081 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6082 Otherwise, include <strings.h>
6084 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6086 * unicodeio.c (utf8_wctomb): New function.
6087 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6088 format instead of in UCS-4 with platform dependent endianness.
6090 2000-03-07 Paul Eggert <eggert@twinsun.com>
6092 * savedir.c (savedir): Work even if directory size is
6093 negative; this can happen with some screwy NFS configurations.
6095 2000-03-06 Jim Meyering <meyering@lucent.com>
6097 * localcharset.c (get_charset_aliases): Don't try to free file_name
6098 if it's NULL (because we ran out of memory). From Bruno Haible.
6100 2000-03-05 Jim Meyering <meyering@lucent.com>
6102 * localcharset.c ("path-concat.h"): Include.
6103 (get_charset_aliases): Use path_concat instead of ANSI string
6106 * unicodeio.h (PARAMS): Define.
6107 Use it to guard prototype.
6109 2000-03-04 Jim Meyering <meyering@lucent.com>
6111 * Makefile.am (install-exec-local): Create $(libdir) before installing
6113 (uninstall-local): Uncomment this rule so `make distcheck' works
6116 * unicodeio.c (<errno.h>): Include it.
6117 (errno): Declare if not defined.
6119 * localcharset.c: Add Bruno's comment justifying use of volatile.
6121 * config.charset: New version, incorporating remarks from a linux
6122 i18n mailing list. From Bruno Haible.
6124 2000-03-02 Jim Meyering <meyering@lucent.com>
6126 * Makefile.am (EXTRA_DIST): Add config.charset.
6128 2000-03-01 Jim Meyering <meyering@lucent.com>
6130 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6131 * unicodeio.c: Likewise.
6133 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6135 * config.charset: New file.
6136 * localcharset.c: New file.
6137 * unicodeio.h, unicodeio.c: New files.
6138 * Makefile.am (DEFS): Add -DLIBDIR=...
6139 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6140 (noinst_HEADERS): Add unicodeio.h.
6141 (all-local, install-exec-local, charset.alias): New targets.
6143 2000-02-28 Paul Eggert <eggert@twinsun.com>
6145 * quotearg.c (ALERT_CHAR): New macro.
6146 (quotearg_buffer_restyled): Use it.
6148 2000-02-27 Jim Meyering <meyering@lucent.com>
6150 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6151 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6153 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6154 not `#if STDC_HEADERS'.
6155 Declare malloc if needed.
6157 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6158 now that autoconf always defines the HAVE_DECL_ symbols.
6159 * human.c: Likewise.
6161 * strtoumax.c: Likewise.
6163 * backupfile.c: Arrange for cpp to fail if the configure-time
6164 declaration check was not run.
6166 * human.c: Likewise.
6168 * strtoumax.c: Likewise.
6170 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6171 then first look up the entire `.'-containing string as a login name.
6173 2000-02-18 Paul Eggert <eggert@twinsun.com>
6175 * getdate.y: Handle two-digit years with leading zeros correctly.
6176 (textint): New typedef.
6177 (parser_control): Member year changed from int to textint.
6179 (YYSTYPE): Removed; replaced by %union with int and textint members.
6180 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6181 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6182 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6183 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6184 (date, number, to_year): Use width of number in digits, not its value,
6185 to determine whether it's a 2-digit year, or a 2-digit time.
6186 (yylex): Store number of digits of numeric tokens.
6187 Reported by John Kendall.
6189 (parser_control): Changed from struct parser_control to typedef (for
6190 consistency). All uses changed.
6192 (tID): Removed; not used.
6193 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6195 2000-02-14 Paul Eggert <eggert@twinsun.com>
6197 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6198 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6200 2000-02-12 Jim Meyering <meyering@lucent.com>
6202 * userspec.c (ISDIGIT): Define it.
6203 (isdigit): Remove definition.
6204 (is_number): Use ISDIGIT, not isdigit.
6205 <libintl.h>: Include.
6207 (parse_user_spec): Mark translatable strings.
6209 2000-02-10 Jim Meyering <meyering@lucent.com>
6211 With these changes, nanosleep.[ch] are finally enough like the other
6212 lib/* replacement files to compile on a few more losing systems.
6214 * nanosleep.h: Don't include config.h.
6215 Remove prototype from declaration of nanosleep.
6216 (PARAMS): Remove now-unneeded definition.
6217 * nanosleep.c: #undef nanosleep.
6218 (rpl_nanosleep): Rename from nanosleep.
6220 2000-02-03 Jim Meyering <meyering@lucent.com>
6222 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6223 rather than with `#if HAVE_UTMPNAME'.
6225 2000-02-01 Jim Meyering <meyering@lucent.com>
6227 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6229 2000-01-31 Jim Meyering <meyering@lucent.com>
6231 * nanosleep.h (nanosleep): Guard declaration with
6232 `#if ! HAVE_DECL_NANOSLEEP'.
6233 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6234 the declaration in that vendor's sys/timers.h.
6235 Reported by Christian Krackowizer.
6237 * quotearg.c (ISASCII): Add #undef and move definition to follow
6238 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6239 (ISPRINT): Likewise.
6240 Reported by Tom Tromey.
6242 2000-01-30 Jim Meyering <meyering@lucent.com>
6244 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6245 uses of ->ut_name. The latter doesn't work with new Linux header files
6246 where only utmpx.ut_user is declared.
6248 * readutmp.h (UT_USER): Define.
6250 2000-01-23 Jim Meyering <meyering@lucent.com>
6252 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6255 2000-01-22 Jim Meyering <meyering@lucent.com>
6257 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6258 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6259 Required for some AIX systems. Reported by Christian Krackowizer.
6260 [TESTING] (main): New function.
6262 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
6263 * dirname.c (dir_name): Support for DOS-style file names with drive
6266 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
6268 * strverscmp.c (ISDIGIT): Define.
6269 (strverscmp): Use ISDIGIT, not isdigit.
6271 2000-01-17 Paul Eggert <eggert@twinsun.com>
6273 * nanosleep.c (nanosleep):
6274 Don't use SA_INTERRUPT to decide whether to call sigaction, as
6275 POSIX.1 doesn't require SA_INTERRUPT and some systems
6276 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
6277 it's been part of POSIX.1 since day 1 (in 1988).
6279 2000-01-17 Jim Meyering <meyering@lucent.com>
6281 * interlock: Remove unused file. Reported by François Pinard.
6283 2000-01-16 Paul Eggert <eggert@twinsun.com>
6285 * quotearg.c (quotearg_buffer_restyled): Do not quote
6286 alert, backslash, formfeed, and vertical tab unnecessarily in
6287 shell quoting style.
6290 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6291 Free Software Foundation, Inc.
6292 Copying and distribution of this file, with or without modification,
6293 are permitted provided the copyright notice and this notice are preserved.