1 2004-03-30 Paul Eggert <eggert@twinsun.com>
3 * lib/cloexec.h, lib/cloexec.c (set_cloexec_flag): Return int
4 not bool, to be more consistent with Unix conventions.
5 Suggested by Bruno Haible.
9 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
12 * getdate.h: Include stdbool.h, and timespec.h instead of
13 the usual <time.h> dance.
14 (get_date): Change signature to support fractional time stamps.
16 * getdate.y: Include "getdate.h" first, as we can now
17 assume C89 and don't need to worry about 'const'.
18 Similarly, include "unlocked-io.h" near start, not in middle.
20 (textint.value): Use long int rather than int.
21 (textint.digits): Use size_t rather than int.
22 (BILLION, LOG10_BILLION): New constants.
23 (parser_control): New member rel_ns. Members day_ordinal,
24 time_zone, month, day, hour, minutes, rel_year, rel_month,
25 rel_day, rel_hour, rel_minutes, rel_seconds
26 are now long int, not int. Member seconds is now struct timespec,
27 not int. New member timespec_seen. Members dates_seen, days_seen,
28 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
30 (%union.intval): Now long int, not int.
32 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
33 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
34 (spec): Now is a timespec or an item list.
35 (timespec, items): New nonterminals.
36 (time, rel, relunit, number, get_date):
37 Add support for fractional seconds.
38 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
39 (gmtime, localtime, mktime): Remove decls; not needed with C89.
40 (to_hour): First arg is now long int, not int.
41 (to_year): Returns long int, not int.
42 Don't treat year -70 like 70.
43 (tm_diff): Returns long int, not int.
44 (lookup_word): Use bool instead of int when appropriate.
45 (yylex): Use size_t for count, not int.
46 Detect overflow when parsing large integer constants.
47 Add support for fractions.
48 (get_date): Make pointers 'const' if possible.
49 Use more-portable code to detect integer overflow.
50 (main) [TEST]: Adjust to above changes. Test for localtime failure.
51 Don't use ctime; it's not reliable if the year has >4 digits.
53 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
54 This is for compatibility with BSD.
56 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
57 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
58 From coreutils' system.h.
60 * userspec.c: Don't include "posixver.h".
61 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
62 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
63 compatible extension. Simplify code by removing a boolean int
64 that was always nonzero if a string was nonnull.
66 2004-03-30 Jim Meyering <jim@meyering.net>
70 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
72 * readtokens.c (readtoken): Don't leak 64 bytes when reading
73 an empty input stream.
75 * readtokens.c: Include <stdbool.h>.
76 (readtoken): Use `size_t' rather than int/long.
78 Use `bool' rather than `int' where appropriate.
79 Use memset rather than an explicit loop.
80 Use x2nrealloc rather than xrealloc.
81 Allow the use of `\0' as a delimiter.
82 (readtokens): Likewise.
83 * readtokens.h (readtoken, readtokens): Update prototypes.
85 2004-03-30 Bruno Haible <bruno@clisp.org>
87 * getloadavg.c (getloadavg): Don't assume setlocale returns
90 2004-03-29 Paul Eggert <eggert@twinsun.com>
92 Merge changes to getloadavg.c from coreutils and Emacs.
94 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
95 Define to an expression, not to the empty string.
96 Include cloexec.h and xalloc.h.
97 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
98 Use set_cloexec_flag rather than rolling our own.
99 * cloexec.c, cloexec.h: New files.
101 2004-03-18 Paul Eggert <eggert@twinsun.com>
103 * getopt.h: Sync with libc CVS.
105 2004-03-18 Paul Eggert <eggert@twinsun.com>
106 Bruno Haible <bruno@clisp.org>
108 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
109 not on all platforms that have <wchar.h>.
110 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
112 2004-03-09 Paul Eggert <eggert@twinsun.com>
114 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
116 * getopt_int.h: New file, also synced from libc.
118 2004-03-07 Paul Eggert <eggert@twinsun.com>
120 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
121 '#if' expressions. Unlike the code it replaces, it does not
122 depend on (defined _SC_PAGESIZE). However, it does depend on
123 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
124 first reported by Jason Andrade in
125 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
127 2004-01-18 Simon Josefsson <jas@extundo.com>
129 * strdup.h: New file.
130 * strdup.c: Include it.
131 * path-concat.c: Include strdup.h. Drop strdup declaration.
132 * userspec.c: Include strdup.h. Drop strdup declaration.
134 2004-02-06 Karl Berry <karl@gnu.org>
136 * config.charset: update from gettext 0.14.1.
138 2004-02-05 Paul Eggert <eggert@twinsun.com>
140 Add comments and code, prompted by suggestions from Bruno Haible
142 * quotearg.h (quotearg_alloc): New decl. Improve the comments
143 describing the enum quoting_style values.
144 * quotearg.c (quotearg_alloc): New function.
145 (quotearg_buffer_restyled): Treat lone { and } as special.
146 Treat = as special. Work around bug with older shells
147 that "see" a '\' that is really the 2nd byte of a multibyte char.
148 Quote empty string with shell_quoting_style.
150 2004-02-03 Bruno Haible <bruno@clisp.org>
152 * pipe.h: New file, from GNU gettext.
153 * pipe.c: New file, from GNU gettext.
155 2004-01-27 Bruno Haible <bruno@clisp.org>
157 * execute.h: New file, from GNU gettext.
158 * execute.c: New file, from GNU gettext.
159 * w32spawn.h: New file, from GNU gettext.
161 2004-01-23 Paul Eggert <eggert@twinsun.com>
163 Exit-status fix from coreutils.
165 Use exit_failure consistently in place of EXIT_FAILURE,
166 so that program exit statuses are consistent on failure.
168 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
169 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
170 * argmatch.h: Comment fix to match the above.
171 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
172 Now a macro referring to exit_failure, instead of a separate
173 variable. Include "exitfail.h" to get it.
174 * xstrtol.h: Include "exitfail.h".
175 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
177 * long-options.c (parse_long_options): Use prototype
178 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
181 2004-01-21 Jim Meyering <jim@meyering.net>
183 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
184 so as not to conflict with a different-sized __mktime_internal
185 function in GNU libc.
186 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
187 Problem building statically-linked `ls' reported by Michael Brunnbauer.
189 2004-01-18 Paul Eggert <eggert@twinsun.com>
191 Merge from diffutils.
193 * file-type.c (file_type): Add typed memory objects.
194 * file-type.h (S_TYPEISTMO): New macro.
196 * c-stack.h (c_stack_action): Remove argv argument.
197 * c-stack.c (c_stack_action): Likewise. All uses changed.
198 (die): Don't calculate message unless segv_action returns.
199 (get_stack_location, min_address_from_argv, max_address_from_argv,
200 volatile stack_base, volatile_stack_size): Remove.
201 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
202 that every segmentation violation is a stack overflow. (Ouch!)
203 See Debian bug 136249 (still outstanding) for more info about why
204 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
206 2003-11-30 Bruno Haible <bruno@clisp.org>
208 Safer stack allocation.
209 * setenv.c: Include allocsa.h.
210 (alloca): Remove fallback definition.
211 (freea): Remove macro.
212 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
215 2003-10-17 Bruno Haible <bruno@clisp.org>
217 * binary-io.h: Avoid warnings on Cygwin.
219 2003-12-28 Bruno Haible <bruno@clisp.org>
221 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
222 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
224 2003-11-28 Bruno Haible <bruno@clisp.org>
226 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
228 2003-11-27 Bruno Haible <bruno@clisp.org>
230 * wait-process.c: On Windows, include windows.h. Needed on mingw.
232 2003-11-17 Bruno Haible <bruno@clisp.org>
234 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
236 2003-11-24 Bruno Haible <bruno@clisp.org>
238 * xallocsa.h: New file, from GNU gettext.
239 * xallocsa.c: New file, from GNU gettext.
241 2003-11-24 Bruno Haible <bruno@clisp.org>
243 * allocsa.h: New file, from GNU gettext.
244 * allocsa.c: New file, from GNU gettext.
246 2003-11-24 Bruno Haible <bruno@clisp.org>
248 * eealloc.h: New file.
250 2004-01-15 Jim Meyering <jim@meyering.net>
252 Merge from coreutils.
254 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
255 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
256 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
258 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
259 optional configure-time default.
261 * version-etc.c (version_etc_copyright): Update copyright date.
263 * xreadlink.c (xreadlink): Correct outdated comment.
265 2004-01-15 Paul Eggert <eggert@twinsun.com>
267 Merge from coreutils.
269 * posixver.c: Include posixver.h.
271 * same.c: Include <stdbool.h>, <limits.h>.
272 (_POSIX_NAME_MAX): Define if not defined.
274 (same_name): If file names are silently truncated, report
275 that the file names are the same if they are the same after
276 the silent truncation.
278 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
280 * xstrtod.c (xstrtod): Likewise. All callers changed to
281 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
284 2004-01-14 Paul Eggert <eggert@twinsun.com>
286 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
287 with like-named macro in fnmatch.c.
288 (EXT): Use an internal constant instead.
290 Merge fnmatch patches from glibc.
291 * fnmatch.c (mbsinit): Remove define.
292 Add libc_hidden_ver (__fnmatch, fnmatch).
293 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
294 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
296 2003-12-14 Karl Berry <karl@gnu.org>
298 * config.charset: update from gettext-runtime.
300 2003-12-03 Paul Eggert <eggert@twinsun.com>
302 * getgroups.c (getgroups): xmalloc takes one argument, not two.
303 Bug reported by Alfred M. Szmidt.
305 2003-11-29 Karl Berry <karl@gnu.org>
307 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
309 2003-11-23 Paul Eggert <eggert@twinsun.com>
310 Bruno Haible <bruno@clisp.org>
312 * printf-parse.h: Don't include sys/types.h.
313 (ARG_NONE): New macro.
314 (char_directive): Change type of *arg_index fields to size_t.
315 * printf-parse.c: Don't include sys/types.h.
316 (SSIZE_MAX): Remove macro.
317 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
318 Remove unnecessary overflow check.
319 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
322 2003-11-24 Paul Eggert <eggert@twinsun.com>
324 * alloca.c: Remove dependency on xalloc module.
325 (xalloc_die): Remove.
326 (memory_full) [!defined emacs]: New macro.
327 [!defined emacs]: Don't include xalloc.h.
328 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
329 address arithmetic overflows. Change datatypes a bit to avoid
332 2003-11-22 Jim Meyering <jim@meyering.net>
334 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
336 2003-11-17 Bruno Haible <bruno@clisp.org>
338 * vasnprintf.c (alloca): Remove fallback definition.
339 (freea): Remove definition.
340 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
341 Reported by Paul Eggert.
343 2003-11-17 Jim Meyering <jim@meyering.net>
345 On systems without utime and without a utimes function capable of
346 dealing with a NULL struct utimbuf* argument, this utime replacement
347 could -- in unusual circumstances -- leak a file descriptor.
348 * utime.c: Include <unistd.h> and <errno.h>.
349 (utime_null): Be sure to close `fd' and to preserve errno.
350 Reported by Geoff Collyer via Arnold Robbins.
352 2003-11-16 Paul Eggert <eggert@twinsun.com>
353 Bruno Haible <bruno@clisp.org>
355 Protect against address arithmetic overflow.
356 * printf-args.h: Include stddef.h.
357 (arguments): Change type of field 'count' to size_t.
358 * printf-args.c (printf_fetchargs): Use size_t instead of
359 'unsigned int' where appropriate.
360 * printf-parse.h: Include sys/types.h.
361 (char_directive): Change type of *arg_index fields to ssize_t.
362 (char_directives): Change type of fields 'count', max_*_length to
364 * printf-parse.c: Include sys/types.h and xsize.h.
365 (SSIZE_MAX): Define fallback value.
366 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
367 instead of 'int' where appropriate. Check a_allocated, d_allocated
368 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
369 * vasnprintf.c: Include xsize.h.
370 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
371 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
372 overflow. Avoid wraparound when converting a width or precision from
375 2003-11-16 Bruno Haible <bruno@clisp.org>
377 Update from GNU gettext.
378 * printf-parse.c: Generalize to it can be compiled for wide strings.
379 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
380 * vasnprintf.c: Generalize to it can be compiled for wide strings.
381 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
382 SNPRINTF): New macros.
383 Don't include <alloca.h> if the file is used inside libintl.
384 (local_wcslen): New function, for Solaris 2.5.1.
385 (VASNPRINTF): Use it instead of wcslen.
387 2003-11-16 Bruno Haible <bruno@clisp.org>
389 * xsize.h (xmax): New function.
390 (xsum, xsum3, xsum4): Declare as "pure" functions.
392 2003-11-12 Paul Eggert <eggert@twinsun.com>
394 * xalloc.h: Do not include <limits.h> or <stdint.h>.
395 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
396 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
397 heuristic is just as accurate as far as we know, and it removes a
398 dependency on size_max.m4 and ptrdiff_max.m4.
400 2003-11-12 Paul Eggert <eggert@twinsun.com>
402 * xstrtol.c (__xstrtol): Remove "break" immediately after
403 "return", to pacify some unknown compiler. Problem reported
406 2003-11-11 Bruno Haible <bruno@clisp.org>
408 * xsize.h (SIZE_MAX): Remove fallback definition.
409 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
412 2003-11-10 Paul Eggert <eggert@twinsun.com>
414 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
415 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
416 rejected some allocations of exactly SIZE_MAX - 2 bytes.
418 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
419 not (size_t) -1, since it's defined here.
421 2003-11-06 Paul Eggert <eggert@twinsun.com>
423 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
424 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
425 Reject sizes of exactly SIZE_MAX bytes.
426 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
427 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
429 2003-11-05 Bruno Haible <bruno@clisp.org>
431 * xsize.h: Include limits.h, to avoid a possible collision with
432 SIZE_MAX defined in <limits.h> on Solaris.
434 2003-11-04 Bruno Haible <bruno@clisp.org>
437 * linebreak.c: Include xsize.h.
438 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
439 argument for overflow.
440 Suggested by Paul Eggert.
442 2003-10-31 Bruno Haible <bruno@clisp.org>
444 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
445 to avoid (extremely rare) race condition.
446 Suggested by Paul Eggert.
448 2003-11-03 Jim Meyering <jim@meyering.net>
450 * userspec.c: Include "userspec.h".
451 * userspec.h: New file.
453 2003-10-31 Paul Eggert <eggert@twinsun.com>
455 * mountlist.h (struct mount_entry.me_type_malloced): New member.
456 * mountlist.c (SIZE_MAX): Define if not defined already.
457 (read_filesystem_list): Set and use me_type_malloced.
458 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
459 whatever the type happens to be), for brevity and consistency.
460 Check for size calculation overflow on Alphas running OSF/1.
462 2003-10-31 Jim Meyering <jim@meyering.net>
464 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
466 * linebuffer.c: Include <string.h> for declaration of memset.
468 2003-10-30 Paul Eggert <eggert@twinsun.com>
469 Bruno Haible <bruno@clisp.org>
471 * vasprintf.c: Include <limits.h>, <stdlib.h>.
472 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
474 2003-10-29 Paul Eggert <eggert@twinsun.com>
476 * xalloc.h (xalloc_oversized): Now a macro, not a function,
477 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
479 * quotearg.c (quotearg_n_options): Use it.
480 * group-member.c: Include <stdbool.h>.
481 (free_group_info): Arg is now const *; don't free arg.
482 (get_group_info): Now returns bool and accepts struct group_info *,
483 rather than returning a malloc'ed struct group_info *.
484 All uses changed. Check for overflow in internal size calculation.
486 * getusershell.c (readname): Simplify the code by using x2nrealloc
487 rather than xmalloc/xrealloc.
488 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
489 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
490 conformance bug: the old code used a pointer after freeing the
491 storage that it addressed.
492 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
493 rather than doing it by hand.
494 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
495 the buffer preserved. Use free and xmalloc instead.
496 * quotearg.c (quotearg_n_options): Likewise.
497 Use a simpler test for size overflow. Don't use xalloc_oversized
498 because unsigned int might be wider than size_t (!); this suggests
499 that we should switch from unsigned int to size_t for slot numbers.
501 2003-10-27 Bruno Haible <bruno@clisp.org>
503 * stdbool_.h: Better support for BeOS.
505 2003-10-27 Paul Eggert <eggert@twinsun.com>
507 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
508 to allocate the returned structure. Do not allocate a subarray,
509 as x2nrealloc will do that.
510 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
511 instead of xnrealloc.
512 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
514 2003-10-26 Paul Eggert <eggert@twinsun.com>
516 * xalloc.h (xalloc_oversized): New static inline function, for
517 callers that want to do their own size-overflow checking. Include
518 <stdbool.h>, since xalloc_oversized returns bool.
519 * xalloc.c (array_size_overflow): Remove. All callers changed
520 to use xalloc_oversized.
522 Add two functions x2realloc, x2nrealloc, for programs that grow
523 arrays dynamically by doubling their sizes.
524 * xalloc.h (x2realloc, x2nrealloc): New decls.
525 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
528 Port to C99 semantics for 'inline' of external functions.
529 Bug reported by Bruno Haible.
530 * xmalloc.c (xnmalloc_inline): New static inline function,
531 with the old contents of xnmalloc.
532 (xnmalloc, xmalloc): Use it.
533 (xnrealloc_inline): New static inline function,
534 with the old contents of xnrealloc.
535 (xnrealloc, xrealloc): Use it.
537 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
539 2003-10-25 Paul Eggert <eggert@twinsun.com>
541 Fix several address-calculation bugs in the hash modules,
542 plus some minor code cleanup.
544 * hash.h: Include <stdbool.h>, for bool.
545 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
546 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
547 hash_get_n_entries, hash_get_max_bucket_length,
548 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
549 hash_rehash): Use size_t rather than unsigned.
550 * hash.c (struct hash_table, hash_get_n_buckets,
551 hash_get_n_buckets_used, hash_get_n_entries,
552 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
553 hash_get_entries, hash_do_for_each, hash_string, is_prime,
554 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
556 (SIZE_MAX): Define if not defined.
557 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
558 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
560 Use const * when possible.
561 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
562 (check_tuning): Fix bug: if tuning parameters were very close to
563 0 or 1, rounding errors could have caused subscript violations.
564 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
565 (hash_initialize): Add 'fail:' label
566 to free table and return NULL, and use it to simplify code.
567 Use calloc rather than clearing the storage ourself.
568 (hash_initialize, hash_rehash): Check for arithmetic overflow in
569 buffer size calculations.
570 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
571 Include <stddef.h>, for size_t.
572 * hash-pjw.c (hash_pjw): Likewise.
573 Switch to method described by Bruno Haible.
574 Include <limits.h>, for CHAR_BIT.
575 (SIZE_BITS): New macro.
577 2003-10-21 Paul Eggert <eggert@twinsun.com>
579 * getndelim2.c (getndelim2): When size calculation overflows,
580 ceiling the allocation at NMAX bytes rather than silently
581 discarding input bytes before NMAX is reached. This makes
582 a difference only if NMAX exceeds SIZE_MAX / 2.
584 * obstack.c: Merge from glibc.
585 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
586 Add libc_hidden_def (_obstack_newchunk).
587 (_obstack_free) [! defined _LIBC]: Remove.
588 [defined _LIBC]: Make a strong alias from obstack_free, rather than
589 a clone of the function body.
590 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
591 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
593 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
594 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
597 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
598 (obstack_ptr_grow_fast, obstack_int_grow_fast):
599 Don't use lvalue casts, as GCC plans to remove support for them
600 in GCC 3.5. Reported by Joseph S. Myers. This bug
601 was also present in the non-GCC version, indicating that this
602 code had always been buggy and had never been widely used.
603 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
604 Use the fast variant of each macro, rather than copying the
605 definiens of the fast variant; that way, we'll be more likely to
606 catch future bugs in the fast variants.
608 2003-10-20 Bruno Haible <bruno@clisp.org>
610 * wait-process.h: New file, from GNU gettext.
611 * wait-process.c: New file, from GNU gettext.
613 2003-10-19 Jim Meyering <jim@meyering.net>
615 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
617 2003-10-16 Paul Eggert <eggert@twinsun.com>
619 * getgroups.c: Include <errno.h>, <stdlib.h>.
620 (getgroups): First arg is int, not size_t.
621 Don't let 'free' mangle errno.
623 2003-10-16 Jim Meyering <jim@meyering.net>
625 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
627 2003-10-15 Paul Eggert <eggert@twinsun.com>
629 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
631 (new_exclude, add_exclude_file): Initial size no longer needs to
633 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
634 our own address arithmetic overflow checking.
636 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
637 (fnmatch): Do not alloca more than 2000 wide characters;
638 instead, use malloc for large buffers.
639 Check for address arithmetic overflow, and return -1
640 with errno set to ENOMEM in that case.
641 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
642 (NEW_PATTERN): Do not alloca more than 8000 bytes;
643 instead, return -1. Check for address arithmetic overflow.
645 2003-10-14 Paul Eggert <eggert@twinsun.com>
647 Handle invalid suffixes and overflow independently, so that
648 callers can treat them independently as needed. Fix some bugs in
649 suffix handling, e.g., "100k@" was not diagnosed as an invalid
650 suffix for a human-readable blocksize. The major caller-visible
651 change is the addition of a new
652 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
653 that both overflow and suffix chars were found.
655 * human.c (humblock): Don't check separately for invalid suffix
656 char; that is xstrtoumax's job (now that its bug is fixed).
657 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
658 INTMAX_MAX]: New macros.
659 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
660 TYPE_MAXIMUM): New macros.
661 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
662 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
663 if overflow occurs, as it's what __strtol does and it's more useful
665 (__xstrtol): If __strtol reports some error other than ERANGE,
666 reflect it to the caller as LONGINT_INVALID. If it reports
667 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
668 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
669 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
671 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
672 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
673 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
674 [defined UINTMAX_MAX]: New macros.
676 2003-10-14 Bruno Haible <bruno@clisp.org>
678 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
679 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
680 Also use volatile where needed.
682 2003-10-12 Paul Eggert <eggert@twinsun.com>
684 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
685 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
686 and define in terms of the other primitives.
687 * xmalloc.c: Include stdbool.h; do not include exit.h.
688 (SIZE_MAX): Define if not already defined.
689 (array_size_overflow): New function.
690 (xalloc_die): Abort instead of exiting if 'error' returns.
691 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
692 (xmalloc, xrealloc): Use them.
693 (xcalloc): Check for address arithmetic overflow.
694 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
695 a bit faster than strcpy.
697 2003-10-08 Paul Eggert <eggert@twinsun.com>
699 Merge getpass from libc, plus a few fixes.
701 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
703 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
704 __fsetlocking to empty.
705 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
706 do include <bits/libc-lock.h>.
707 Do not include <fcntl.h>; not needed.
708 [_LIBC]: Include <wchar.h>.
709 (NOTCANCEL_MODE): New macro.
710 (flockfile, funlockfile) [_LIBC]: New macros.
711 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
712 [!_LIBC]: New macros.
713 (call_fclose): New function.
714 (getpass): Use it. Save tty stream separately; this simplifies the
715 code and makes it more reliable if stdin happens to equal stdout.
716 Invoke __fsetlocking on tty.
717 Handle thread cancellation if needed.
718 Namespace cleanup (use __tcgetattr, __getline).
719 Use bool for Booleans.
720 [USE_IN_LIBIO]: Handle wide streams.
721 [!_LIBC]: Unconditionally do the fseek, since we don't know what
722 stream might go where.
724 * unlocked-io.h: Include <stdio.h>, so that the caller
725 doesn't have to include <stdio.h> before us.
726 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
727 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
728 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
729 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
730 if not declared, so that we can use getpass.c code from libc without
732 (flockfile, ftrylockfile, funlockfile): New macros.
734 2003-10-06 Bruno Haible <bruno@clisp.org>
736 * version-etc-2.h: Remove file.
737 * version-etc-2.c: Remove file.
739 2003-09-25 Jim Meyering <jim@meyering.net>
740 Bruno Haible <bruno@clisp.org>
742 This lets translators provide better translations for the
743 "Written by ..." part of --version output.
744 * version-etc.h: Include stdarg.h.
745 (version_etc_copyright): Declare as readonly.
746 (version_etc): Make this function variadic with a NULL-terminated list
747 of author name strings.
748 (version_etc_va): New declaration.
749 * version-etc.c: Include stdarg.h, stdlib.h.
750 (version_etc_copyright): Declare as readonly.
751 (version_etc_va): New function. Provide a different translatable string
752 for each possible number of authors < 10. Abbreviate when there are 10
754 (version_etc): Make this function variadic. Call version_etc_va.
755 Suggestion from Gary V. Vaughan.
757 * long-options.h (parse_long_options): Change prototype: the authors
758 string is moved to the end and becomes variadic.
759 * long-options.c: Include stdarg.h.
760 (parse_long_options): Make this function variadic, too.
761 Call version_etc_va, not version_etc.
763 2003-10-06 Bruno Haible <bruno@clisp.org>
765 * fatal-signal.h: New file, from GNU gettext.
766 * fatal-signal.c: New file, from GNU gettext.
768 2003-10-04 Karl Berry <karl@gnu.org>
770 * argp*: update from libc.
772 2003-10-01 Larry Jones <lawrence.jones@eds.com>
774 * getpass.c (getpass): Use a no-op fseek when switching from input to
775 output mode on the same stream.
777 2003-09-29 Paul Eggert <eggert@twinsun.com>
779 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
780 Fix arg typo in previous patch.
782 2003-09-28 Jim Meyering <jim@meyering.net>
784 * error.c: Correct cpp indentation.
786 2003-09-27 Paul Eggert <eggert@twinsun.com>
788 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
789 Omit the special code that used __typeof__, since we worry that
790 it could be more trouble than it's worth. See:
791 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
792 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
796 2003-09-26 Jim Meyering <jim@meyering.net>
798 * error.c (error_tail): Move some declarations
799 into inner scope where the local variables are used.
801 2003-09-26 Bruno Haible <bruno@clisp.org>
803 * stpncpy.h (gnu_stpncpy): New declaration.
804 (stpncpy): Define as alias for gnu_stpncpy.
805 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
807 2003-09-26 Paul Eggert <eggert@twinsun.com>
809 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
810 (error_tail): Do not loop, reallocating temporary buffer, since
811 the output cannot contain more wide characters than the input
812 contains bytes, the size must be big enough already. This avoids
813 one potential size overflow calculation. Check for size overflow
814 when calculating temporary buffer size. Free temporary buffer
815 when done, if it was allocated with malloc; this plugs a memory
816 leak. Remove casts from void * to pointers, that are no longer
817 needed now that we're assuming C89 or better.
819 Merge error changes from glibc.
821 * error.c, error.h: Update copyright notice header to match glibc.
822 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
823 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
824 Disable cancellation while printing error.
825 * error.h: Prepend __ to parameter names.
827 2003-09-25 Karl Berry <karl@gnu.org>
829 * argp-fmtstream.c, argp-help.c: update from libc.
831 2003-09-25 Bruno Haible <bruno@clisp.org>
833 * version-etc-2.h: New file, from version-etc.h with modifications.
834 * version-etc-2.c: New file, from version-etc.c with modifications.
836 2003-09-25 Simon Josefsson <jas@extundo.com>
838 * xgetdomainname.h: New file.
839 * xgetdomainname.c: New file.
841 2003-09-25 Simon Josefsson <jas@extundo.com>
842 Bruno Haible <bruno@clisp.org>
844 * getdomainname.h: New file.
845 * getdomainname.c: New file.
847 2003-09-24 Paul Eggert <eggert@twinsun.com>
849 * linebuffer.c (freebuffer): Don't free the argument, just
850 the buffer associated with the argument. Bug reported by
853 2003-09-19 Karl Berry <karl@gnu.org>
855 * argp.h: update from libc.
857 2003-09-16 Paul Eggert <eggert@twinsun.com>
859 * linebuffer.c (readlinebuffer): Return NULL immediately upon
860 input error, instead of returning NULL the next time we are called
861 (and therefore losing track of errno).
863 2003-09-15 Paul Eggert <eggert@twinsun.com>
865 * getndelim2.c (getndelim2): Don't trash errno when a read
866 fails, so that the caller gets the proper errno.
868 * readutmp.c (read_utmp): Likewise.
869 Check for fstat error. Close stream and free storage
872 2003-09-14 Bruno Haible <bruno@clisp.org>
874 * fwriteerror.h: New file.
875 * fwriteerror.c: New file.
877 2003-09-14 Jim Meyering <jim@meyering.net>
879 * getloadavg.c: Correct cpp indentation.
880 * strdup.c: Likewise.
881 * vasnprintf.c: Likewise.
883 2003-09-12 Paul Eggert <eggert@twinsun.com>
885 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
886 * obstack.c [!defined _LIBC]: Likewise.
887 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
888 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
889 * exitfail.c: Don't include stdlib.h; no longer needed.
891 More changes to assume C89 or better.
893 * error.c (error_tail): Assume vprintf.
895 * argmatch.c (getenv): Remove decl.
896 * progreloc.c (get_full_program_name): Define via prototype.
897 * setenv.c (clearenv): Likewise.
898 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
900 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
901 (malloc, memcpy): Remove decls.
902 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
903 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
904 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
905 (memcpy): Remove macro.
906 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
907 (__P): Remove. All uses removed.
908 (PTR): Remove. All uses changed to void *.
909 (CHAR_BIT, NULL): Remove.
910 (spaces, zeros, memset_space, memset_zero)
911 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
913 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
914 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
915 Define with prototype.
916 Remove now-unnecessary prototype decl.
917 (extra_args_spec): Assume ANSI C. All uses changed.
918 (extra_args_spec_iso): Remove.
919 (my_strftime, emacs_strftimeu): Define via prototype.
920 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
922 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
923 * strtoimax.c: Include <stdlib.h> unconditionally.
924 (strtoul, strtol): Remove decls.
925 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
927 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
928 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
929 (LOCALE_PARAM_PROTO): New macro.
930 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
931 (INTERNAL (strtol), strtol): Define with a prototype.
932 (PARAMS): Remove. All uses removed.
933 * tempname.c: Include <string.h> unconditionally.
934 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
935 * xgethostname.c (main): Define with a prototype.
936 * xmalloc.c: Include "xalloc.h" first, to check interface.
937 Include <stdlib.h> unconditionally.
938 (calloc, malloc, realloc, free): Remove decls.
939 * xstrtod.c: Include "xstrtod.h" first, to check interface.
940 Include <stdlib.h> unconditionally. Sort include file names.
942 (xstrtod): Define with a prototype.
943 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
944 (strtol, strtoul): Remove decls.
946 2003-09-11 Paul Eggert <eggert@twinsun.com>
948 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
949 Include <stdlib.h>, <string.h> unconditionally.
950 Remove now-unnecessary cast to char *.
951 * strnlen.c: Include <string.h> unconditionally.
952 * yesno.c (yesno): Define with a prototype.
954 2003-09-10 Bruno Haible <bruno@clisp.org>
956 * strcspn.c: Include <string.h> unconditionally.
957 * strpbrk.c: Include <string.h> unconditionally.
958 * strstr.c: Include <string.h> unconditionally.
959 * unicodeio.c: Include <string.h> unconditionally.
960 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
961 * unsetenv.c: Likewise.
962 * xreadlink.c: Include <stdlib.h> unconditionally.
963 * yesno.c: Include <stdlib.h> unconditionally.
964 (rpmatch): Add prototype.
966 2003-09-10 Jim Meyering <jim@meyering.net>
968 * error.c: Correct indentation of cpp directives.
970 2003-09-09 Paul Eggert <eggert@twinsun.com>
974 * acosl.c (main): Use a prototype.
975 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
978 * getloadavg.c (getloadavg, main): Define via prototypes.
980 * getopt.h (struct option.name): Assume C89, and use 'const'.
981 (getopt, etopt_long, getopt_long_only, _getopt_internal)
982 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
984 * getopt.c (const): Remove macro.
985 Include <string.h> unconditionally.
986 (my_index): Remove; all uses changed to strchr.
987 (strlen): Remove decl.
988 (exchange): Remove forward decl; no longer needed.
989 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
990 Define with prototype.
991 * getopt1.c (const): Remove macro.
992 (getopt_long, getopt_long_only, main): Define with prototype.
994 * getugroups.c: Include <string.h> unconditionally.
996 * getusershell.c: Include <stdlib.h> unconditionally.
997 (getusershell, setusershell, endusershell, readname, main):
998 Define with prototypes.
1000 * group-member.c: Include group-member.h first.
1001 Include <stdlib.h> unconditionally.
1003 * hard-locale.c: Include hard-locale.h first.
1004 Include <stdlib.h>, <string.h> unconditionally.
1006 * hash.c (free, malloc): Remove decls.
1007 Include <stdlib.h> unconditionally.
1009 * human.c: Include <stdlib.h>, <string.h> unconditionally.
1010 (getenv): Do not declare.
1012 * idcache.c: Include <string.h> unconditionally.
1014 * long-options.c: Include long-options.h first, to test interface.
1015 Include <stdlib.h> unconditionally.
1017 * makepath.c: Include makepath.h first, to test interface.
1018 Include <stdlib.h> and <string.h> unconditionally.
1020 * linebuffer.c: Include <stdlib.h>.
1021 (free): Remove decl.
1023 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
1024 rpl_malloc returns void *, not char *.
1025 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
1027 * md5.h: Include <limits.h> unconditionally.
1028 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
1029 (__P): Remove; all uses removed.
1030 * md5.c: Include "md5.h" first.
1031 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
1032 md5_buffer, md5_process_bytes, md5_process_block):
1033 Define with prototypes.
1034 * sha.h (__P): Remove all uses. (It wasn't defined??)
1035 * sha.c: Include "sha.h" first.
1036 Include <stdlib.h>, <string.h> unconditionally.
1038 * memchr.c (__ptr_t): Remove; all uses changed to void *.
1039 * memcmp.c (__ptr_t): Likewise.
1040 * memrchr.c (__ptr_t): Likewise.
1041 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
1042 Include <string.h> unconditionally.
1043 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
1044 * memchr.c: Include <stdlib.h> unconditionally.
1045 * memchr.c (LONG_MAX): Remove.
1046 * memrchr.c (LONG_MAX): Likewise.
1047 * memchr.c (__memchr): Define via a prototype.
1048 * memrchr.c (__memrchr): Likewise.
1049 * memcmp.c (__P): Remove, and remove all uses.
1050 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
1051 Remove forward decls; no longer needed.
1052 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
1053 Use types required by C89 in prototype.
1055 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
1056 * savedir.c: Likewise.
1057 * mkdir.c (free): Remove decl.
1058 * rmdir.c (rmdir): Define with a prototype.
1059 * savedir.c: Include savedir.h first, to test interface.
1061 * mktime.c (STDC_HEADERS): Remove.
1062 Include <stdlib.h>, <string.h> unconditionally.
1064 * modechange.c: Include <stdlib.h> unconditionally.
1065 (malloc): Remove decl.
1067 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
1068 (free): Remove decl.
1070 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
1071 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
1072 (This type really should be intptr_t, but that's a C99ism.)
1073 (_obstack_memcpy): Remove: all uses changed to memcpy.
1074 Include <string.h> unconditionally.
1075 (struct obstack): Assume __STDC__ for types of members
1076 chunkfun, freefun, extra_arg.
1077 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
1078 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
1079 obstack_begin, obstack_specify_allocation,
1080 obstack_specify_allocation_with_arg, obstack_chunkfun,
1081 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
1082 Remove unprototyped decls and the macros that use them.
1083 * obstack.c (POINTER): Remove. All uses changed to void *.
1084 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
1085 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
1086 (defined __STDC__ && __STDC__)]:
1087 Remove nonprototyped code.
1088 Include <stdlib.h> unconditionally.
1089 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
1090 _obstack_allocated_p, _obstack_free, obstack_free,
1091 _obstack_memory_used, print_and_abort):
1092 Define using prototypes.
1093 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
1094 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
1095 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
1096 obstack_next_free, obstack_object_size, obstack_room) [0]:
1097 Remove unused, unprototyped code.
1099 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
1101 * physmem.c (physmem_total, physmem_available, main): Define
1104 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
1105 (main): Define with a prototype.
1107 * posixver.c (getenv): Remove decl.
1109 * putenv.c (malloc): Returns void *, not char *.
1110 Include <string.h> unconditionally.
1111 (strchr, memcpy, NULL): Do not define.
1113 * readtokens.c: Include readtokens.h first, to test interface.
1114 Include <stdlib.h>, <string.h> unconditionally.
1115 (init_tokenbuffer): Define with a prototype.
1117 * regex.c (PARAMS): Remove. All uses removed.
1118 All uses of _RE_ARGS removed, too.
1119 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1121 (bzero): Assume memset exists.
1122 (memcmp, memcpy, NULL): Remove.
1123 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
1124 char, or assignments to local vars of type signed char.
1125 (init_syntax_once, PREFIX(extract_number_and_incr),
1126 PREFIX(print_partial_compiled_pattern),
1127 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
1128 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
1129 PREFIX(regex_grow_registers), PREFIX(regex_compile),
1130 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
1131 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
1132 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
1133 wcs_compile_range, byte_compile_range, truncate_wchar,
1134 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
1135 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
1136 count_mbs_length, wcs_re_match_2_internal,
1137 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
1138 PREFIX(alt_match_null_string_p),
1139 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
1140 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
1141 regfree, PREFIX(extract_number)): Define with prototype. Remove
1142 now-unnecessary declaration, if any.
1143 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
1145 Remove now-unnecessary casts among pointer types.
1146 * regex.h (_RE_ARGS): Remove. All uses removed.
1148 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
1149 (free): Remove decl.
1151 * rpmatch.c: Include <stdlib.h> unconditionally.
1153 * same.c: Include <stdlib.h>, <string.h> unconditionally.
1154 (free): Remove decl.
1156 * save-cwd.c: Include <stdlib.h> unconditionally.
1157 * xgetcwd.c: Likewise.
1159 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
1160 (free): Remove decl.
1162 * strchrnul.c (strchrnul): Define with a prototype.
1163 Fix bug: c_in was not converted to char before searching.
1165 The following changes are not K&R related:
1167 * group-member.h: Include <sys/types.h>, so that this file is
1169 * makepath.h: Likewise.
1171 * getusershell.c (readname, default_index, line_size, readname):
1172 Use size_t, not int, for sizes.
1173 (readname): If the size overflows, report an error instead of
1176 2003-09-09 Derek Robert Price <derek@ximbiot.com>
1178 * getndelim2.c: Assume stdlib.h per the C89 spec.
1180 2003-09-08 Paul Eggert <eggert@twinsun.com>
1182 Assume C89 or better; remove K&R cruft.
1183 A few of these changes were first proposed by Derek Robert Price
1184 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
1186 * addext.c: Include <string.h> unconditionally.
1187 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
1188 Don't declare getenv or malloc.
1190 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
1191 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
1193 (find_stack_direction, alloca): Use prototypes.
1195 * atexit.c (atexit): Define using a prototype.
1197 * basename.c, dirname.c, stripslash.c:
1198 Include <string.h> unconditionally.
1200 * bcopy.c: Include <stddef.h>.
1201 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
1203 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
1205 * error.h (error, error_at_line, error_print_progname)
1206 [! (defined (__STDC__) && __STDC__)]: Remove decls.
1207 * error.c: Include error.h first, to check interface.
1208 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1209 (VA_START): Remove; all uses changeed to va_start.
1210 (exit, strerror): Remove decls.
1211 (error_print_progname): Prototype uncondionally.
1212 Don't include <errno.h>; no longer needed.
1213 (private_strerror): Remove.
1214 (error_tail): Always define.
1215 (error, error_at_line): Assume C89 or better; always use prototypes.
1216 * fatal.c: Include "fatal.h" first, to test interface.
1217 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1218 (VA_START): Remove; all uses changed to va_start.
1219 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
1221 (exit): Remove decl.
1222 (fatal): Prototype unconditionally. Assume va_start works.
1223 Abort at end, to pacify gcc.
1225 * euidaccess.c (main): Define with a prototype.
1227 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
1229 * exitfail.c: Include <stdlib.h> unconditionally.
1231 * fnmatch_.h (__P): Remove. All uses changed to assume
1233 * fnmatch.c: Include fnmatch.h first, to test interface.
1234 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
1235 (getenv): Remove decl.
1236 (fnmatch): Define using a prototype.
1237 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
1238 (FCT): Define using a prototype.
1240 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
1242 * gethostname.c: Include <stddef.h>.
1243 (gethostname): Define with prototype. Length is size_t, not int.
1245 2003-09-08 Paul Eggert <eggert@twinsun.com>
1247 * getversion.c: Remove; was migrated to backupfile.c in 1997.
1248 getversion.c should have been removed then, but was accidentally
1251 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
1252 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
1254 2003-09-07 Paul Eggert <eggert@twinsun.com>
1256 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
1257 copy_tm_result. Bug reported by Simon Josefsson in
1258 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
1260 2003-09-06 Paul Eggert <eggert@twinsun.com>
1262 * time_r.c, time_r.h: New files.
1264 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
1266 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
1267 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
1269 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
1271 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
1272 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
1275 * timegm.c: Switch to glibc implementation, with the following changes:
1276 [defined HAVE_CONFIG_H]: Include <config.h>.
1277 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
1278 (__mktime_internal) [!defined _LIBC]: New decl.
1279 (__gmtime_r) [!defined _LIBC]: New macro and function.
1280 (timegm): Use a prototype, since gnulib assumes C89.
1281 Do not bother declaring tmp to be const, as it's not really usefu.
1282 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
1283 (timegm): Declare only if HAVE_DECL_TIMEGM.
1285 2003-09-03 Paul Eggert <eggert@twinsun.com>
1287 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
1288 Bug reported by Lute Kamstra in
1289 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
1291 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
1292 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
1293 course with correspondingly smaller numbers for tomorrow and
1294 yesterday. From Tadayoshi Funaba. Originally installed into
1295 sh-utils on 1999-08-07, but the patch got lost (I guess during the
1298 2003-08-31 Simon Josefsson <jas@extundo.com>
1300 * timegm.h: New file.
1301 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
1303 2003-08-31 Karl Berry <karl@gnu.org>
1305 * argp.h: update from libc.
1307 2003-08-28 Bruno Haible <bruno@clisp.org>
1309 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
1310 warning on QNX, which defines O_BINARY to 000000.
1312 2003-08-24 Bruno Haible <bruno@clisp.org>
1314 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
1315 MSVC7 <stdio.h> is included later.
1317 2003-08-20 Bruno Haible <bruno@clisp.org>
1319 * progname.h: New file, from GNU gettext.
1320 * progname.c: New file, from GNU gettext.
1321 * progreloc.c: New file, from GNU gettext.
1323 2003-08-19 Bruno Haible <bruno@clisp.org>
1325 * xstrdup.c: Assume <string.h> exists.
1327 2003-08-18 Jim Meyering <jim@meyering.net>
1329 * setenv.h: Indent nested cpp directive.
1330 * vasnprintf.c: Remove trailing blanks.
1332 2003-08-17 Simon Josefsson <jas@extundo.com>
1333 Bruno Haible <bruno@clisp.org>
1335 * xstrndup.h: New file.
1336 * xstrndup.c: New file.
1338 2003-08-17 Bruno Haible <bruno@clisp.org>
1340 * strndup.h: New file.
1342 2003-08-16 Paul Eggert <eggert@twinsun.com>
1344 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
1345 space, undoing this 2003-08-12 change:
1346 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
1348 2003-08-16 Jim Meyering <jim@meyering.net>
1350 Merge from coreutils.
1351 * xstrtoimax.c: #else #if -> #elif.
1352 * xstrtoumax.c: Likewise.
1354 2003-08-15 Paul Eggert <eggert@twinsun.com>
1356 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
1357 rather than tab, after '#' in shell-script copyright notices.
1358 Suggested by Bruno Haible.
1360 2003-08-15 Jim Meyering <jim@meyering.net>
1361 and Paul Eggert <eggert@twinsun.com>
1363 Merge from coreutils.
1364 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
1365 member but strut utmpx does not. Needed for AIX 4.3.3.
1366 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
1368 2003-08-15 Jim Meyering <jim@meyering.net>
1370 Merge from coreutils.
1371 * xgethostname.c: Include <stdlib.h>.
1372 (xghostname): Don't exit for anything other than memory-related
1373 failure; just return NULL.
1374 * userspec.c: Include "posixver.h".
1375 (parse_user_spec): Accept `.' as a separator only
1376 in pre-POSIX-200112 mode.
1377 * strtoimax.c: Use #elif rather than #else #if.
1378 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
1379 Remove function, now that we can rely on a working tzset function.
1380 [!_LIBC]: Ensure that the required autoconf test has been run.
1381 [!defined _NL_CURRENT && HAVE_STRFTIME]:
1382 Use underlying_strftime for %r.
1383 * sha.c: Merge in some clean-up and optimization changes from glibc.
1384 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
1385 Ensure that it is a multiple of 64.
1386 Rearrange loop exit tests so as to avoid performing an
1387 additional fread after encountering an error or EOF.
1388 * realloc.c: Update copyright date.
1390 2003-08-14 Jim Meyering <jim@meyering.net>
1392 Merge from coreutils.
1393 * obstack.h: Whitespace changes.
1394 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
1395 and xcalloc return values.
1396 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
1397 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
1398 hang on OSF/1 5.1 for DIR on both local and remote file systems.
1399 Reported by (and fix confirmed by) Nelson H. F. Beebe.
1400 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1402 Use mntctl's return value to drive the entry-processing loop, since
1403 we can't rely on the value of the vmt_length member in the last
1404 entry. On some systems doing so could result in exhausting
1405 virtual memory. Based in part on a patch from Mike Jetzer.
1407 2003-08-14 Jim Meyering <jim@meyering.net>
1408 and Paul Eggert <eggert@twinsun.com>
1410 Merges from coreutils, plus other fixes.
1411 * physmem.c: Merge in portability changes from gcc/libiberty
1412 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
1413 for credits and details. Thanks to Kaveh Ghazi for helping
1414 to keep these files in sync.
1415 (ARRAY_SIZE): Define it.
1416 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
1417 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
1418 (memcasecmp): Don't assume size_t fits in unsigned int.
1419 Remove casts and duplicate code.
1420 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
1421 (memcpy): Remove definition.
1422 Merge in some clean-up and optimization changes from glibc.
1423 [BLOCKSIZE]: Move definition to top of file.
1424 Ensure that it is a multiple of 64.
1425 Rearrange loop exit tests so as to avoid performing an
1426 additional fread after encountering an error or EOF.
1427 * md5.h (md5_uintptr): Define.
1428 * makepath.c (CLEANUP_CWD): Report an error if we failed to
1429 return to the initial working directory. Preserve errno
1431 * idcache.c: Include "xalloc.h".
1432 (xmalloc, xrealloc): Remove decls.
1433 (getuser): Remove casts no longer required in C89.
1434 * human.c: Include stdio.h, for sprintf.
1435 * group-member.c: Include "xalloc.h".
1436 (xmalloc, xrealloc): Remove decls.
1437 (get_group_info): Remove casts no longer required in C89.
1438 * getusershell.c (readname): Remove casts no longer required in C89.
1439 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
1440 * getline.c: Whitespace fix, from coreutils.
1442 2003-08-13 Paul Eggert <eggert@twinsun.com>
1444 * exclude.c: Include <ctype.h>
1445 (IN_CTYPE_DOMAIN): New macro.
1447 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
1450 * argp-help.c, argp-parse.c, config.charset, getopt.h:
1451 Undo previous (whitespace-only) change.
1453 2003-08-12 Paul Eggert <eggert@twinsun.com>
1455 * argp-help.c, argp-parse.c, config.charset, getopt.h:
1456 Normalize leading white space and remove trailing white space.
1457 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
1458 notice, as per ../config/srclist-update.
1460 Merge from coreutils.
1461 * euidaccess.h: New file.
1462 * euidaccess.c: Include it.
1463 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
1464 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
1465 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
1467 2003-08-11 Bruno Haible <bruno@clisp.org>
1469 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
1470 (vasnprintf): Use it instead of wcslen.
1472 2003-08-11 Bruno Haible <bruno@clisp.org>
1474 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
1475 value to ensure that _Bool promotes to int. Use #define for _Bool when
1476 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
1478 2003-08-10 Karl Berry <karl@gnu.org>
1480 * regex.h: update from libc (whitespace fix).
1482 2003-08-09 Paul Eggert <eggert@twinsun.com>
1484 Merge some files from coreutils. These changes were
1485 originally made by Jim Meyering.
1486 * acl.c: Include <sys/types.h> before <sys/stat.h>;
1487 many older Unixes require this.
1488 * alloca.c (alloca): Remove cast to argument of free;
1489 no longer needed in C89.
1490 * alloca_.h, regex.h: Fix white space to match
1491 what GNU indent does.
1493 2003-08-05 Paul Eggert <eggert@twinsun.com>
1495 * bumpalloc.h: Remove.
1497 2003-08-04 Paul Eggert <eggert@twinsun.com>
1499 * getloadavg.c: Change copyright notice and spacing to conform to
1502 Merge from coreutils.
1503 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
1505 * getdate.y (date): Also accept dates like May-23-2003; suggestion
1506 from Karl Berry, implemented by Jim Meyering.
1507 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
1508 from Dmitry V. Levin.
1509 Remove anachronistic cast of xrealloc.
1510 * fnmatch_.h (__const): Remove. Use 'const'.
1511 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
1512 type. Otherwise, it wouldn't compile with at least /bin/cc on
1513 ymp-cray-unicos9.0.2.X.
1514 Combine two mostly-identical uses of alloca into one.
1515 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
1517 2003-08-04 Dave Love <d.love@dl.ac.uk>
1521 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
1522 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
1523 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
1524 obsolete NLIST_NAME_UNION.
1525 [__GNU__]: Undef BSD and FSCALE.
1526 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
1528 2003-08-03 Paul Eggert <eggert@twinsun.com>
1530 * stdbool_.h (_Bool): Make it signed char, instead of
1531 an enum type, so that it's guaranteed to promote to int. See:
1532 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
1534 2003-07-31 Paul Eggert <eggert@twinsun.com>
1536 * strerror.c: Include config.h, limits.h. Declare sprintf.
1537 (strerror): Don't assume that a printable int fits in 14 bytes.
1539 2003-07-24 Derek Robert Price <derek@ximbiot.com>
1540 Bruno Haible <bruno@clisp.org>
1542 * getline.h (getline, getdelim): Change return type to ssize_t.
1543 * getline.c (getline, getdelim): Likewise.
1544 Remove _GNU_SOURCE define; now it's defined in config.h through
1547 2003-07-22 Paul Eggert <eggert@twinsun.com>
1549 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
1550 over-parenthesization in macros.
1552 Sync with coreutils.
1554 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
1557 Use `exit_failure' for xalloc and xmemcoll instead of their own
1558 private exit-failure variables.
1559 * xalloc.h (xalloc_exit_failure): Remove.
1560 * xmalloc.c: Likewise. Include exitfail.h.
1561 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
1562 * xmemcoll.h (xmemcoll_exit_failure): Remove.
1563 * xmemcoll.c: Likewise. Include exitfail.h.
1564 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
1566 2003-07-18 Paul Eggert <eggert@twinsun.com>
1568 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
1569 * closeout.c: Likewise. Include "closeout.h" right after config.h,
1570 to test that it can stand by itself. Include "exitfail.h".
1571 Clients should set exit_failure instead.
1572 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
1574 2003-07-18 Andreas Schwab <schwab@suse.de>
1576 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
1578 2003-07-18 Bruno Haible <bruno@clisp.org>
1580 * getndelim2.h: New file.
1581 * getndelim2.c: Make into a module of its own. Include config.h,
1583 (getndelim2): Make non-static. Change return type to ssize_t.
1584 * getline.h: Change argument names.
1585 * getline.c: Include getndelim2.h instead of getndelim2.c.
1586 * getnline.c: Include getndelim2.h.
1588 2003-07-17 Bruno Haible <bruno@clisp.org>
1590 * Makefile.am: Remove file.
1591 * Makefile.in: Remove file.
1593 2003-07-17 Bruno Haible <bruno@clisp.org>
1595 * getnline.h: New file.
1596 * getnline.c: New file.
1597 * getndelim2.c: New file, extracted from getline.c.
1598 (getndelim2): Renamed from getdelim2, with added nmax argument.
1599 * getline.c: Include getndelim2.c.
1600 (getdelim2): Moved out to getndelim2.c.
1601 (getline, getdelim): Update.
1603 2003-07-15 <karl@gnu.org>
1605 * vasnprintf.c: update from gettext.
1607 2003-07-15 Jim Meyering <jim@meyering.net>
1609 * makepath.c (make_path): Enclose diagnostic in _(...).
1611 2003-07-14 Paul Eggert <eggert@twinsun.com>
1613 * asnprintf.c, asprintf.c, config.charset, gettext.h,
1614 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
1615 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
1616 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
1617 vasprintf.c, vasprintf.h: Regenerate. These files are now being
1618 updated automatically by ../config/srclist-update. This changes
1619 their license from LPGL to GPL.
1621 2003-07-14 Jim Meyering <jim@meyering.net>
1623 Don't emit diagnostics. Let callers do that.
1624 * save-cwd.c: Don't include "error.h".
1625 (save_cwd): Don't call error. Ensure that errno is valid
1626 when returning nonzero.
1628 * save-cwd.h (restore_cwd): Update prototype.
1629 * save-cwd.c (restore_cwd): Remove two parameters.
1630 Simplify. Don't call error upon failure. Let callers do that.
1631 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
1632 when auditing is enabled. But don't bother updating the #if.
1634 2003-07-14 Simon Josefsson <jas@extundo.com>
1636 * mempcpy.h: New file.
1637 * mempcpy.c: New file.
1639 2003-07-14 Paul Eggert <eggert@twinsun.com>
1641 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
1642 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
1643 unicodeio.c, unicodeio.h, unlocked-io.h:
1644 Switch from LGPL to GPL.
1646 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
1648 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
1649 it breaks C++ compilation.
1650 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
1652 2003-07-10 Jim Meyering <jim@meyering.net>
1654 * vasnprintf.c: Remove trailing blanks.
1655 Make cpp indentation consistent.
1657 2003-07-09 Paul Eggert <eggert@twinsun.com>
1659 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
1660 posixver.c, strftime.c, strnlen.c, strverscmp.c:
1661 Switch from LGPL to GPL.
1663 2003-07-07 Paul Eggert <eggert@twinsun.com>
1665 * mktime.c: Fix some boundary cases and remove need for floating point.
1667 Issue a compile-time diagnostic if time_t is floating point, or if
1668 two's complement arithmetic is not in effect, or if arithmetic
1669 right shift does not propagate the sign. These assumptions were
1670 all in the original code but they weren't checked.
1672 (TIME_T_MIDPOINT, verify): New macros.
1673 (__isleap): Remove; it has integer overflow problems.
1674 (leapyear): New function, without those problems.
1675 (ydhms_tm_diff): Remove; splitting into two parts.
1676 (ydhms_diff): New function, containing the arithmetic part of
1677 the old ydhms_tm_diff function. Issue a compile-time
1678 diagnostic if we are not using C99 integer division.
1679 Avoid casts when possible.
1680 (guess_time_tm): New function, containing the checking part of
1681 the old ydhms_tm_diff function. Return the new value, rather than
1682 the difference between it and the old. Accept a new argument T
1683 so that *T specifies the old value. Check for overflow in the result.
1685 (__mktime_internal): Use a time_t offset, not a long int offset.
1686 This undoes the 2003-06-04 change, which is no longer needed now
1687 that we have better overflow checking.
1688 (localtime_offset): Likewise.
1690 (__mktime_internal): Avoid harmful overflow on hosts where time_t
1691 and long are 64-bit but int is only 32-bit.
1692 (ydhms_diff): Use long int to store year1 and yday1.
1693 Issue a compile-time diagnostic if long int is not wide enough.
1695 (__mktime_internal): Use long int to store adjusted year and yday.
1696 Use plain C rather than preprocessor commands, if that doesn't
1698 Check for overflow (and try to repair) after each probe
1699 rather than checking only at the very end. This avoids some bugs
1700 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
1701 does not equal GMT offset at maximum time).
1702 Use integer to check for overflow rather than floating point; this
1703 is more portable to non-IEEE hosts, and is a tad faster.
1704 When we detect that we are oscillating between two values,
1705 don't check whether tm_isdst has the requested value, since
1706 we already know the answer. When tm_isdst has the wrong value,
1707 use a different heuristic to find the right one, based on the
1708 extreme values actually observed in practice in tz2003a,
1709 rather than the (overly optimistic) "previous 3 calendar quarters".
1711 (not_equal_tm, print_tm, check_result): Use "const T" rather than
1712 "T const" to accommodate glibc style.
1713 (check_result): Use less-confusing report format. "long" -> "long int.
1715 Don't loop if the iteration overflows time_t.
1716 Allow a negative step in the iteration.
1718 2003-07-01 Paul Eggert <eggert@twinsun.com>
1720 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
1721 having it depend on HAVE_SYS_TYPES_H.
1723 2003-06-25 Bruno Haible <bruno@clisp.org>
1725 * readlink.c: New file.
1727 2003-06-20 Bruno Haible <bruno@clisp.org>
1729 Assume C89, so PARAMS isn't needed.
1730 * unicodeio.h (PARAMS): Remove.
1731 * unicodeio.c: Don't use PARAMS.
1733 2003-06-18 Jim Meyering <jim@meyering.net>
1735 Merge changes from coreutils.
1736 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
1737 Remove explicit declarations of xmalloc and realloc.
1739 (read_utmp): Remove anachronistic cast of xmalloc.
1741 2003-06-17 Paul Eggert <eggert@twinsun.com>
1743 Assume C89, so PARAMS isn't needed.
1744 * backupfile.h (PARAMS): Remove. All uses removed.
1745 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
1746 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
1747 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
1748 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
1749 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
1750 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
1751 xstrtol.h: Likewise.
1752 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
1753 same.h, strverscmp.h: Do not include config.h; no longer needed.
1754 Anyway, config.h should always be included before any other file.
1756 2003-06-11 Simon Josefsson <jas@extundo.com>
1758 * sysexit_.h: New file.
1760 2003-05-20 Derek Price <derek@ximbiot.com>
1762 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
1764 2003-06-10 Simon Josefsson <jas@extundo.com>
1766 * strchrnul.h: New file.
1767 * strchrnul.c: New file.
1769 2003-06-10 Simon Josefsson <jas@extundo.com>
1771 * argp.h: New file, from glibc.
1772 * argp-ba.c: New file, from glibc.
1773 * argp-eexst.c: New file, from glibc.
1774 * argp-fmtstream.c: New file, from glibc.
1775 * argp-fmtstream.h: New file, from glibc.
1776 * argp-fs-xinl.c: New file, from glibc.
1777 * argp-help.c: New file, from glibc.
1778 * argp-namefrob.h: New file, from glibc.
1779 * argp-parse.c: New file, from glibc.
1780 * argp-pv.c: New file, from glibc.
1781 * argp-pvh.c: New file, from glibc.
1782 * argp-xinl.c: New file, from glibc.
1784 2003-06-07 Jim Meyering <jim@meyering.net>
1786 * readtokens.h: Put `Free Software Foundation, Inc.'
1787 in place of my name in the copyright comment.
1788 Remove definition and uses of __P.
1791 * stat.c: Don't declare xmalloc explicitly.
1792 Instead, include "xalloc.h".
1793 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
1794 xrealloc, and xcalloc return values.
1795 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
1797 * xgetcwd.h: Remove definition/uses of PARAMS.
1799 2003-06-06 Jim Meyering <jim@meyering.net>
1801 * stdbool_.h: Renamed from stdbool.h.in.
1803 2003-06-06 Jim Meyering <jim@meyering.net>
1805 Merge from coreutils.
1806 * same.c: (same_name): Declare *_basename locals to be `const'.
1807 Consolidate declarations and initializations of *_base* locals.
1809 Merge from coreutils.
1810 This avoids a core dump on systems without GNU putenv,
1811 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
1812 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
1813 (unsetenv): New static function, from GNU libc.
1814 (rpl_putenv): Use it.
1816 * modechange.c: Remove trailing blanks.
1818 Merge from coreutils.
1819 * fsusage.c: Remove declaration of statfs.
1820 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
1822 * posixtm.c: Include <stdbool.h> unconditionally.
1824 2003-06-05 Paul Eggert <eggert@twinsun.com>
1826 * mktime.c (__mktime_internal): When resolving a tm_isdst
1827 mismatch, look in future quarters as well as past. This fixes a
1828 bug when processing fall-backwards gaps immediately after a long
1829 period of daylight-saving time.
1831 * mktime.c: Assume freestanding C89 or better.
1832 (HAVE_LIMITS_H): Remove. Assume it's 1.
1833 (__P): Remove; not used.
1834 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
1835 (mktime, not_equal_tm, print_tm, check_result,
1836 main): Use prototypes. Use const * where appropriate.
1837 (main): Fix typo in testing code that uncovered by above changes.
1838 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
1840 2003-06-04 Paul Eggert <eggert@twinsun.com>
1842 * mktime.c: Fix Debian bug 177940
1843 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
1844 (localtime_offset): Now long int, not time_t, because we want it
1845 to be guaranteed to be signed. All uses changed.
1846 (__mktime_internal): If overflow would occur when adding offset,
1849 Merge 'human' changes from coreutils. Rewrite to support
1850 locale-specific notations like thousands separators.
1851 * human.c: Simplify authorship notice.
1852 Include human.h immediately after config.h.
1853 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
1854 <limits.h>: Do not include, since human.h does.
1855 (SIZE_MAX, UINTMAX_MAX): New macros.
1856 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
1857 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
1858 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
1859 (power_letter): Renamed from suffixes.
1860 (generate_suffix_backwards): Remove.
1861 (adjust_value): Now takes int style (because of human.h changes)
1862 and long double value (for greater precision on some platforms).
1863 (group_number): New function.
1864 (human_readable): Use it. Use integer options, not enum.
1865 Put the options before the sizes in the arg list.
1866 Support all the new options.
1867 The old human_readable function has been removed;
1868 use inttostr.h instead.
1869 (human_readable, default_block_size, humblock):
1870 Use uintmax_t, not int, for block sizes.
1871 (human_readable_inexact, block_size_types): Remove.
1872 (block_size_opts): New constant.
1873 (human_options): Renamed from human_block_size, with new signature
1874 that allows block sizes up to UINTMAX_MAX. All callers changed.
1875 * human.h: Add copyright and authorship notice.
1876 Include <limits.h> and <stdbool.h> unconditionally.
1877 (PARAMS): Remove. All uses removed.
1878 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
1879 (enum human_inexact_style): Remove tag; now a nameless enum.
1880 (human_floor, human_ceiling, human_round_to_even): Now have
1881 values 2, 0, 1 rather than -1, 1, 0.
1882 (human_group_digits, human_suppress_point_zero, human_autoscale,
1883 human_base_1024, human_SI, human_B): New constants.
1884 (human_readable_inexact, human_block_size): Remove.
1885 (human_readable): Size args are now uintmax_t, not int.
1886 (human_options): New decl.
1888 * exclude.c: (new_exclude, add_exclude): Remove casts that are
1889 unnecessary now that we assume C89 or better. This change
1890 imported from coreutils.
1892 * mktime.c (__mktime_internal): Do not reject negative timestamps
1893 arbitrarily. This is the same patch as 2003-05-28, but it got lost
1894 in the 2003-05-30 sync from glibc.
1896 .h files should stand alone, but we shouldn't include <sys/types.h>
1897 if we can get away with just <stddef.h>.
1899 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
1900 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
1901 rather than <sys/types.h>, as we merely need size_t.
1902 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
1904 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
1905 Include <stdio.h>, to get FILE.
1906 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
1907 memcasecmp.h has included <stddef.h> and all we need is size_t.
1908 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
1909 our interface, instead of including <sys/types.h>
1911 2003-06-02 Paul Eggert <eggert@twinsun.com>
1914 Fix some minor time-related bugs with POSIX time arguments.
1915 Some valid time stamps were being rejected (notably -1, and
1916 time stamps before 1900 on 64-bit hosts). And some invalid
1917 time stamps were being accepted, e.g. September 31.
1919 * posixtm.h (posixtime): Return bool instead of time_t, so
1920 that we can return (time_t) -1 successfully.
1921 * posixtm.c: Likewise.
1922 [HAVE_STDBOOL_H]: Include <stdbool.h>.
1923 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
1924 (t): Remove static var.
1925 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
1926 of static var. All uses changed.
1927 (year): Do not reject years before 1900; they can occur with
1929 (posix_time_parse): Do not check for out-of-range components;
1930 that is now the caller's responsibility, since our checks were
1931 only approximations.
1932 (posixtime): Use mktime to check for out-of-range components,
1933 since it knows them exactly.
1934 If mktime returns (time_t) -1, check whether an error actually occurred
1935 by invoking localtime on -1.
1936 (main) [TEST_POSIXTIME]: Check for input data errors, and report
1937 posixtime failures better.
1938 Improve the test data (in comments only).
1940 2003-05-30 <karl@gnu.org>
1942 * mktime.c: update from libc.
1944 2003-05-30 Bruno Haible <bruno@clisp.org>
1946 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
1947 * localcharset.h: Likewise.
1948 * localcharset.c: Likewise.
1950 2003-05-28 Paul Eggert <eggert@twinsun.com>
1952 Assume the headers required for C89 freestanding compilers.
1953 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
1954 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
1955 without checking for HAVE_LIMITS_H.
1956 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
1957 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
1959 * fatal.c: Include <stdarg.h> without checking for __STDC__.
1960 * exclude.c: Include <stdbool.h> unconditionally.
1961 * tempname.c: Include <stddef.h> unconditionally.
1962 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
1963 * modechange.c, rpmatch.c (NULL): Don't define, since
1964 <stddef.h> does that.
1965 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
1966 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
1967 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
1968 * xstrtol.c: Likewise.
1969 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
1970 * savedir.c: Include <stddef.h> instead of defining NULL.
1972 * addext.c (addext): Use assignment rather than cast, to avoid
1973 warnings on some platforms.
1975 * mktime.c (__mktime_internal): Do not reject negative timestamps
1978 2003-05-10 Bruno Haible <bruno@clisp.org>
1980 * linebreak.c (iconv_string_length): Don't return -1 just because the
1981 string is longer than 4 KB.
1983 2003-05-12 Jim Meyering <jim@meyering.net>
1985 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
1986 the space-padded-by-default conversion specifiers, %e, %k, %l.
1988 2003-05-03 Bruno Haible <bruno@clisp.org>
1990 Upgrade to Unicode-4.0.
1991 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
1992 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
1993 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
1994 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
1995 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
1996 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
1997 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
1998 Change width of U+E0100..U+E01EF from 1 to 0.
2000 2003-04-25 Bruno Haible <bruno@clisp.org>
2002 * copy-file.c: Include <stddef.h>, for size_t.
2004 2003-04-25 Jim Meyering <jim@meyering.net>
2006 * copy-file.c (copy_file_preserving): Declare buf_size to be
2007 of type size_t, not int.
2009 2003-04-11 Jim Meyering <jim@meyering.net>
2011 Merge changes from Coreutils.
2013 2003-03-22 Jim Meyering <jim@meyering.net>
2015 * strftime.c (widen): Cast alloca return value to proper type.
2017 2003-01-19 Ulrich Drepper <drepper@redhat.com>
2020 * strftime.c (my_strftime): Handle very large width
2021 specifications for numeric values correctly. Improve checks for
2024 2003-01-19 Jim Meyering <jim@meyering.net>
2026 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
2027 (nl_get_alt_digit) [! defined my_strftime]: Define.
2028 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
2029 _nl_get_alt_digit and _nl_get_walt_digit.
2031 * strftime.c (my_strftime): Merge in locale-related changes from libc.
2032 These changes have no effect outside of _LIBC.
2034 2003-04-10 Bruno Haible <bruno@clisp.org>
2036 * findprog.h: New file, from GNU gettext.
2037 * findprog.c: New file, from GNU gettext.
2039 2003-04-05 Jim Meyering <jim@meyering.net>
2041 Merge changes from Coreutils.
2043 * exclude.h (PARAMS): Remove definition and uses.
2044 * exclude.c: Remove uses of `PARAMS'.
2046 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
2047 Add test-cases for DOS filenames. Declare program_name.
2048 (main): Set up program_name. Patch by Rich Dawe.
2050 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2052 Use mntctl's return value to drive the entry-processing loop, since
2053 we can't rely on the value of the vmt_length member in the last
2054 entry. On some systems doing so could result in exhausting
2055 virtual memory. Based in part on a patch from Mike Jetzer.
2057 2003-04-04 Bruno Haible <bruno@clisp.org>
2059 * linebreak.h: New file, from GNU gettext.
2060 * linebreak.c: New file, from GNU gettext with slight modifications.
2061 * lbrkprop.h: New file, from GNU gettext.
2063 2003-04-03 Bruno Haible <bruno@clisp.org>
2065 * utf8-ucs4.h: New file, from GNU gettext.
2066 * utf16-ucs4.h: New file, from GNU gettext.
2067 * ucs4-utf8.h: New file, from GNU gettext.
2068 * ucs4-utf16.h: New file, from GNU gettext.
2070 2003-04-02 Bruno Haible <bruno@clisp.org>
2072 * binary-io.h: New file, from GNU gettext.
2074 2003-04-01 Bruno Haible <bruno@clisp.org>
2076 * pathname.h: New file, from GNU gettext.
2077 * concatpath.c: New file, from GNU gettext.
2079 2003-03-30 Bruno Haible <bruno@clisp.org>
2081 * copy-file.c (copy_file_preserving): Don't set owner if the function
2082 chown() doesn't exist.
2084 2003-03-28 Bruno Haible <bruno@clisp.org>
2086 * copy-file.h: New file, from GNU gettext.
2087 * copy-file.c: New file, from GNU gettext.
2089 2003-03-18 Jim Meyering <jim@meyering.net>
2091 * quote.c (quote_n): Fix typo in comment.
2093 2003-03-14 Jim Meyering <jim@meyering.net>
2095 Merge changes from Coreutils.
2096 * obstack.h (obstack_object_size): Declare temporary, __o,
2097 to be const, in order to avoid warnings.
2098 (obstack_room): Likewise.
2099 (obstack_empty_p): Likewise.
2101 2003-03-13 Paul Eggert <eggert@twinsun.com>
2103 Merge changes from Bison.
2104 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
2105 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
2106 when compiling Bison 1.875's `bitset bset = obstack_alloc
2107 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
2108 * hash.c: Include <stdbool.h> unconditionally.
2110 2003-03-09 Paul Eggert <eggert@twinsun.com>
2112 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
2113 Reported by Bruce Becker; see:
2114 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
2116 2003-03-03 Paul Eggert <eggert@twinsun.com>
2117 Bruno Haible <bruno@clisp.org>
2119 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
2120 Reported by John Hughes, see
2121 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
2123 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
2125 * poll_.h: New file.
2128 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
2130 * mathl.h: New file.
2131 * acosl.c: New file.
2132 * asinl.c: New file.
2133 * atanl.c: New file.
2134 * ceill.c: New file.
2137 * floorl.c: New file.
2138 * frexpl.c: New file.
2139 * ldexpl.c: New file.
2141 * sincosl.c: New file.
2143 * sqrtl.c: New file.
2145 * trigl.c: New file.
2146 * trigl.h: New file.
2148 2003-02-17 Bruno Haible <bruno@clisp.org>
2150 * mkdtemp.h: New file, from GNU gettext.
2151 * mkdtemp.c: New file, from GNU gettext.
2153 2003-01-31 Bruno Haible <bruno@clisp.org>
2155 * rename.c: #undef rename before defining rpl_rename.
2156 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
2158 2003-01-30 Bruno Haible <bruno@clisp.org>
2160 * printf-args.h: New file, from GNU gettext.
2161 * printf-args.c: New file, from GNU gettext.
2162 * printf-parse.h: New file, from GNU gettext.
2163 * printf-parse.c: New file, from GNU gettext.
2164 * vasnprintf.h: New file, from GNU gettext.
2165 * vasnprintf.c: New file, from GNU gettext.
2166 * asnprintf.c: New file, from GNU gettext.
2167 * vasprintf.h: New file, from GNU gettext with modifications.
2168 * vasprintf.c: New file, from GNU gettext.
2169 * asprintf.c: New file, from GNU gettext.
2171 2003-01-29 Bruno Haible <bruno@clisp.org>
2173 * stpncpy.h: New file, from GNU gettext with modifications.
2174 * stpncpy.c: New file, from GNU gettext with modifications.
2176 2003-01-28 Bruno Haible <bruno@clisp.org>
2178 * c-ctype.h: New file, from GNU gettext, with changes suggested by
2180 * c-ctype.c: New file, from GNU gettext, with changes suggested by
2183 2003-01-27 Bruno Haible <bruno@clisp.org>
2185 * xsetenv.h: New file, from GNU gettext.
2186 * xsetenv.c: New file, from GNU gettext.
2188 2003-01-23 Bruno Haible <bruno@clisp.org>
2190 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
2192 2003-01-22 Bruno Haible <bruno@clisp.org>
2194 * exit.h: New file, from GNU gettext.
2196 2003-01-11 Bruno Haible <bruno@clisp.org>
2198 * stpcpy.h (stpcpy): Use ANSI C function declarations.
2199 * strcase.h (strcasecmp, strncasecmp): Likewise.
2201 2003-01-14 Jim Meyering <jim@meyering.net>
2203 * same.c (same_name): Tweak a comment.
2205 2003-01-11 Bruno Haible <bruno@clisp.org>
2207 * same.c (same_name): Reorder tests so as to avoid calling stat()
2208 when a string comparison is sufficient.
2210 2003-01-11 Bruno Haible <bruno@clisp.org>
2212 * readtokens.c (readtoken): Cast character to 'unsigned char', not
2215 2003-01-11 Bruno Haible <bruno@clisp.org>
2217 * hash-pjw.c: Add comment about low quality of this function.
2219 2003-01-12 Paul Eggert <eggert@twinsun.com>
2221 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
2222 to avoid collisions with libcurses and libreadline.
2224 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
2225 * getstr.h, getstr.c: Remove.
2226 * getline.c: Include "getline.h", to check interface.
2227 Move body of old getstr.c here: this defines MIN_CHUNK and
2228 declares getdelim2, which is renamed from getstr.
2229 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
2231 * linebuffer.c (readlinebuffer): Renamed from readline.
2233 * linebuffer.h: Likewise.
2234 (readline): Remove backward-compatibility macro.
2236 2003-01-12 Jim Meyering <jim@meyering.net>
2238 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
2240 2003-01-10 Bruno Haible <bruno@clisp.org>
2242 * alloca_.h: New file.
2243 * getdate.y: Unconditionally include alloca.h.
2244 * makepath.c: Likewise.
2245 * setenv.c: Likewise.
2246 * userspec.c: Likewise.
2248 2003-01-09 Bruno Haible <bruno@clisp.org>
2250 * stdbool.h.in: New file.
2252 2003-01-08 Bruno Haible <bruno@clisp.org>
2254 * safe-read.c: Include specification header first, to ensure its
2256 * full-write.c: Likewise.
2258 2003-01-08 Jim Meyering <jim@meyering.net>
2260 * full-write.c: Undefine and define-away `const' after inclusion
2261 of errno.h, not before. Suggestion from Bruno Haible.
2263 2003-01-07 Jim Meyering <jim@meyering.net>
2265 * full-write.c: Rework so that it may serve to define full_read, too.
2266 * full-read.c: Simply #define FULL_READ and include full-write.c.
2268 2003-01-06 Jim Meyering <jim@meyering.net>
2270 * version-etc.c: Update year in translatable copyright string.
2272 2002-12-25 Bruno Haible <bruno@clisp.org>
2274 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
2275 * xstrtol.h: Likewise.
2276 * xstrtoimax.c: Likewise.
2277 * xstrtoumax.c: Likewise.
2278 * human.h: Likewise.
2280 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
2281 on systems that have <inttypes.h> but not <stdint.h>.
2283 2002-12-31 Paul Eggert <eggert@twinsun.com>
2285 * memcoll.c (memcoll): Fall back on a simple algorithm using
2286 memcmp if strcoll doesn't work.
2288 2002-12-23 Bruno Haible <bruno@clisp.org>
2290 * localcharset.h: New file.
2291 * localcharset.c: Include it.
2292 * unicodeio.c: Likewise.
2294 2002-12-22 Bruno Haible <bruno@clisp.org>
2296 * utime.c (utime_null): No need to call ftruncate if the file was
2299 2002-12-23 Bruno Haible <bruno@clisp.org>
2301 * memcoll.c (STRCOLL): New macro.
2304 2002-12-22 Bruno Haible <bruno@clisp.org>
2306 * getstr.h (getstr): Define, to avoid clash with libcurses.
2307 * linebuffer.h (readline): Define, to avoid clash with libreadline.
2309 2002-12-22 Bruno Haible <bruno@clisp.org>
2311 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
2313 2002-12-23 Bruno Haible <bruno@clisp.org>
2315 * getline.h: Include <stddef.h>, for size_t.
2317 * unicodeio.h: Include <stddef.h>, for size_t.
2318 * unicodeio.c: Don't include <stddef.h>.
2320 2002-12-17 Bruno Haible <bruno@clisp.org>
2322 * canon-host.c (strdup): Remove unused declaration.
2324 * fsusage.c: Include full_read.h.
2325 (get_fs_usage): Use full_read instead of safe_read.
2327 * utime.c (utime_null): Use SAFE_READ_ERROR.
2329 2002-12-11 Bruno Haible <bruno@clisp.org>
2331 * setenv.h: Rewritten to cope with systems that have setenv() but not
2333 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
2336 2002-12-11 Bruno Haible <bruno@clisp.org>
2338 * setenv.c (alloca): Fall back to malloc.
2340 (setenv): Use freea() to free memory allocated with alloca().
2342 2002-11-13 Bruno Haible <bruno@clisp.org>
2344 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
2345 function declarations.
2346 * unsetenv.c (unsetenv): Likewise.
2348 2002-03-04 Bruno Haible <bruno@clisp.org>
2350 Portability to AIX 4.3.3.
2351 * unsetenv.c: New file, extracted from setenv.c.
2352 * setenv.c: Move the unsetenv() function to unsetenv.c.
2354 2001-12-20 Bruno Haible <bruno@clisp.org>
2356 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
2357 use malloc instead. For SunOS 4.
2359 2001-12-11 Bruno Haible <bruno@clisp.org>
2361 * setenv.c: Declare alloca.
2362 (compar_fn_t): New typedef.
2363 (KNOWN_VALUE, STORE_VALUE): Use it.
2365 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
2368 2002-12-10 Paul Eggert <eggert@twinsun.com>
2370 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
2371 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
2372 Choose values that are less likely to collide with system fnmatch
2374 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
2375 defined (e.g., a pure POSIX system).
2376 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
2377 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
2379 2002-12-06 Jim Meyering <jim@meyering.net>
2381 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
2383 Merge in changes from libc's misc/error.c, in preparation
2384 for the merge of gnulib's changes back into libc.
2386 * error.c (_): Define only if not already defined.
2387 Move definition to follow all #include directives.
2388 Include unlocked-io.h only if !_LIBC.
2389 [_LIBC]: Include <libio/libioP.h>.
2390 [USE_IN_LIBIO]: Include <libio/iolibio.h>
2391 (fflush): Tweak definition to use INTUSE.
2394 2002-12-05 Paul Eggert <eggert@twinsun.com>
2396 * alloca.c [defined emacs]: Include "lisp.h".
2397 (xalloc_die) [defined emacs]: New macro.
2398 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
2399 [! defined emacs]: Include <xalloc.h>.
2400 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
2401 (pointer): Typedef to POINTER_TYPE *.
2402 (malloc): Remove decl; we now always use xmalloc.
2403 (alloca): Use old-style definition, since Emacs needs this.
2404 Check for arithmetic overflow when computing combined size.
2406 2002-12-04 Paul Eggert <eggert@twinsun.com>
2408 Do not generate unlocked-io.h automatically, since it's easier to
2409 maintain it by hand.
2411 * unlocked-io.h: New file, from GNU diffutils,
2412 but with proper copyright notice and attribution.
2414 * Makefile.am: Add copyright notice.
2415 (libfetish_a_SOURCES): Add unlocked-io.h.
2416 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
2417 (DISTCLEANFILES, io_functions): Remove macros.
2418 (EXTRA_DIST): Remove gen_uio.
2419 (unlocked-io.h): Remove rule.
2421 2002-12-04 Jim Meyering <jim@meyering.net>
2423 Reflect the fact that stat.c and lstat.c are no longer generated.
2424 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
2425 (DISTCLEANFILES): Likewise.
2426 (EXTRA_DIST): Likewise.
2427 (all_local): Don't depend on stat.c or lstat.c.
2428 (stat.c, lstat.c): Remove rules.
2429 (EXTRA_DIST): Remove xstat.in.
2431 * xstat.in: Remove file. Contents moved into stat.c.
2432 * stat.c: New file. Contents mostly from xstat.in.
2433 * stat.c: Rework so that it may serve to define rpl_lstat, too.
2434 * lstat.c: New file. Simply #define LSTAT and include stat.c.
2436 * safe-read.c: Rework so that it may serve to define safe_write, too.
2437 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
2439 2002-12-03 Jim Meyering <jim@meyering.net>
2441 * safe-read.c, safe-write.c: Change variable names and comments, but
2442 not semantics, to minimize the differences between these two files.
2443 (safe_read): Change comment to mention SAFE_READ_ERROR.
2445 * safe-read.c (IS_EINTR): Define.
2446 (safe_read): Use IS_EINTR in place of in-function cpp directives.
2448 2002-12-02 Bruno Haible <bruno@clisp.org>
2450 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
2451 Define, taken from safe-read.c.
2452 (INT_MAX): Provide fallback.
2453 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
2454 * safe-write.h (SAFE_WRITE_ERROR): Define.
2456 * safe-read.c (EINTR): Remove definition.
2457 (safe_read): Don't use EINTR if it is absent.
2459 2002-12-02 Jim Meyering <jim@meyering.net>
2461 * safe-read.c (EINTR): Define.
2462 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
2463 (INT_MAX): Provide fallback.
2464 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
2466 * safe-read.h (SAFE_READ_ERROR): Define.
2468 2002-12-01 Jim Meyering <jim@meyering.net>
2470 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
2471 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
2473 2002-11-27 Paul Eggert <eggert@twinsun.com>
2475 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2476 hash_rehash): Replace `if (limit <= value) abort ();' with
2477 `if (! (value < limit)) abort ();', for readability.
2479 2002-11-26 <karl@gnu.org>
2481 * strdup.c: copy from libc again, with jim's ok.
2482 * .cppi-disable: re-add strdup.c
2484 2002-11-25 <karl@gnu.org>
2486 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
2487 instead of "strtol.c".
2489 2002-11-25 Jim Meyering <jim@meyering.net>
2491 * mktime.c: Sync from libc, now that it has the latest fix.
2493 2002-11-24 <karl@gnu.org>
2495 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
2496 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
2498 2002-11-24 Jim Meyering <jim@meyering.net>
2500 Update from coreutils:
2502 * mktime.c: Merge in changes from libc.
2504 Avoid a link-time failure on some Linux systems.
2505 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
2506 (__mon_yday): Declare with the STATIC attribute.
2507 (__mktime_internal): Likewise.
2508 Based on a report from Greg Schafer.
2510 2002-11-23 Jim Meyering <jim@meyering.net>
2512 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
2513 Use `unsigned', not `int', as type of index.
2515 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
2517 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
2519 2002-11-22 Paul Eggert <eggert@twinsun.com>
2521 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
2522 hint that one should use `if (! x) abort ();' rather than `assert
2523 (x);', and anyway it's one less thing to worry about configuring.
2524 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2525 hash_rehash, hash_insert): Use abort rather than assert.
2527 2002-11-22 Paul Eggert <eggert@twinsun.com>
2529 * quotearg.h: Allow multiple inclusion by surrounding with
2530 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
2531 so that we can be included first.
2532 (PARAMS): Remove; we now assume C89 or later. All uses removed.
2533 * quotearg.c: Include quotearg.h immediately after config.h.
2534 No need to include stddef.h or sys/types.h any more.
2535 Surround local include files with "", not "<>".
2536 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
2537 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
2538 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
2539 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
2540 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
2541 (ISPRINT): Remove; no longer needed now that we assume C89.
2543 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
2546 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
2547 quotearg_char): Use SIZE_MAX rather than
2548 (size_t) -1 when we are talking about "infinity".
2550 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
2552 2002-11-22 Bruno Haible <bruno@clisp.org>
2554 * safe-read.h: Assume C89. Add comments.
2555 (safe_read): Change return type to size_t.
2556 * safe-read.c (safe_read): Change return type to size_t. Handle byte
2557 counts > SSIZE_MAX correctly.
2558 * safe-write.h: New file.
2559 * safe-write.c: New file.
2560 * full-read.h: New file.
2561 * full-read.c: New file.
2562 * full-write.h: Assume C89. Add comments.
2563 * full-write.c: Include safe-write.h.
2564 (full_write): Rewritten to use safe_write.
2565 Suggested by Jim Meyering and Paul Eggert.
2567 2002-11-21 Bruno Haible <bruno@clisp.org>
2569 Remove case insensitive option matching.
2570 * argmatch.h (argcasematch): Remove declaration.
2571 (ARGCASEMATCH): Remove macro.
2572 (__xargmatch_internal): Remove case_sensitive argument.
2573 (XARGMATCH): Update.
2574 (XARGCASEMATCH): Remove macro.
2575 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
2576 case_sensitive argument.
2577 (argcasematch): Remove function.
2578 (__xargmatch_internal): Remove case_sensitive argument.
2579 (main): Use XARGMATCH instead of XARGCASEMATCH.
2581 * xmalloc.c: Change compile-time error message. Add comment about
2582 required autoconf version.
2584 2002-11-21 Jim Meyering <jim@meyering.net>
2586 * strdup.c (strdup): Tweak comment and initial #if/#include.
2588 Merge in changes from the coreutils.
2590 2002-09-25 Paul Eggert <eggert@twinsun.com>
2591 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
2592 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
2593 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
2594 int. Work more efficiently if X is the same width as uintmax_t.
2595 Do not compare X to -1, to avoid bogus compiler warning.
2596 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
2597 Don't assume that f_frsize and f_bsize are the same type.
2599 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
2602 * makepath.c (make_path): Restore umask *before* creating the final
2604 (make_path): Minor reformatting.
2606 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
2607 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
2609 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
2610 ones. At least on GNU/Linux systems, `auto' means something else.
2613 2002-11-20 Paul Eggert <eggert@twinsun.com>
2615 Merge argmatch cleanups from Bison. Assume C89.
2617 * argmatch.c: Include config.h here, not in argmatch.h.
2618 Include stdlib.h, for EXIT_FAILURE.
2619 Always include <string.h>, since we assume C89.
2620 (EXIT_FAILURE): Remove pre-C89 bug workaround.
2621 * argmatch.h: Do not include <config.h> or <sys/types.h>.
2622 Include <stddef.h> instead, since it's all we need for size_t.
2623 (PARAMS): Remove. All uses removed.
2624 (ARRAY_CARDINALITY): Do not bother to #undef.
2625 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
2626 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2627 Remove unnecessary parentheses.
2628 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2629 Insert necessary parentheses.
2630 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
2631 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
2633 2002-11-19 Bruno Haible <bruno@clisp.org>
2635 * mbswidth.c: Include mbswidth.h right at the beginning.
2636 * mbswidth.h: Include <stddef.h>, for size_t.
2638 * mbswidth.h (PARAMS): Remove macro.
2639 (mbswidth, mbsnwidth): Use ANSI C function declarations.
2640 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
2642 * gcd.h (PARAMS): Remove macro.
2643 (gcd): Use ANSI C function declarations.
2644 * gcd.c (gcd): Likewise.
2646 2002-11-15 Bruno Haible <bruno@clisp.org>
2648 * strcspn.c: Include <stddef.h>.
2649 (strcspn): Use ANSI C function declaration. Change return type to
2651 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
2652 (strpbrk): Use NULL.
2653 * strpbrk.h (PARAMS): Remove macro.
2654 (strpbrk): Use ANSI C function declaration.
2655 * strstr.c: Don't include <sys/types.h>.
2656 * strstr.h (PARAMS): Remove macro.
2657 (strstr): Use ANSI C function declarations.
2659 2002-11-06 Bruno Haible <bruno@clisp.org>
2661 * gcd.h (gcd): Change argument type to 'unsigned long'.
2662 * gcd.c (gcd): Likewise.
2664 2002-11-05 Bruno Haible <bruno@clisp.org>
2666 * gcd.h: New file, from gettext-0.11.5.
2667 * gcd.c: New file, from gettext-0.11.5.
2669 2002-11-05 Bruno Haible <bruno@clisp.org>
2671 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2672 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2673 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2674 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2676 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2677 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2679 * closeout.c: Include gettext.h instead of <libintl.h>.
2680 * human.c: Include gettext.h instead of <libintl.h>.
2681 * quotearg.c: Include gettext.h instead of <libintl.h>.
2682 * rpmatch.c: Include gettext.h instead of <libintl.h>.
2683 * unicodeio.c: Include gettext.h instead of <libintl.h>.
2684 * userspec.c: Include gettext.h instead of <libintl.h>.
2685 * version-etc.c: Include gettext.h instead of <libintl.h>.
2686 * xmalloc.c: Include gettext.h instead of <libintl.h>.
2687 (textdomain): Remove definition.
2688 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
2690 * long-options.c: Remove include of <libintl.h> and definition of _.
2691 * same.c: Remove include of <libintl.h> and definition of _.
2693 2002-11-04 Bruno Haible <bruno@clisp.org>
2695 * stpcpy.h: New file, from GNU gettext-0.11.5.
2696 * strcase.h: New file, from GNU gettext-0.11.5.
2697 * strpbrk.h: New file, from GNU gettext-0.11.5.
2698 * strstr.h: New file, from GNU gettext-0.11.5.
2699 * xgetcwd.h: New file, from GNU gettext-0.11.5.
2701 2002-05-09 Bruno Haible <bruno@clisp.org>
2703 * config.charset: Update for newest glibc. Add canonical names
2704 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
2706 2002-05-09 Bruno Haible <bruno@clisp.org>
2708 * localcharset.c (get_charset_aliases): Add more Windows specific
2711 2002-05-08 Owen Taylor <otaylor@redhat.com>
2713 * config.charset: A few additions for Solaris.
2715 2001-12-05 Bruno Haible <bruno@clisp.org>
2717 * localcharset.c (locale_charset): Don't return an empty string.
2719 2001-10-23 Bruno Haible <haible@clisp.cons.org>
2721 * config.charset: msdos in uk_UA uses CP1125.
2723 2001-08-05 Bruno Haible <haible@clisp.cons.org>
2725 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
2726 * localcharset.c (locale_charset): Declare as extern "C".
2728 2002-02-15 Bruno Haible <bruno@clisp.org>
2730 * config.charset [msdosdjgpp]: For Russian, use CP866.
2732 2002-02-11 Bruno Haible <bruno@clisp.org>
2734 * config.charset: Add support for NetBSD.
2736 2002-09-25 <karl@gnu.org>
2738 * strdup.c: copy from libc/string (via ../config/srclist*).
2739 * getopt*: copy from libc/posix.
2740 * gettext.h: copy from gettext.
2741 * .cppi-disable: add strdup.c, gettext.h.
2743 2002-07-01 Jim Meyering <meyering@lucent.com>
2745 * c-stack.c: Include sys/time.h.
2746 From Volker Borchert.
2748 2002-06-11 Paul Eggert <eggert@twinsun.com>
2750 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
2751 New macro. Use it uniformly instead of
2752 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
2753 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
2754 reported by Vin Shelton.
2756 2002-06-22 Jim Meyering <meyering@lucent.com>
2758 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
2759 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
2761 2002-06-22 Paul Eggert <eggert@twinsun.com>
2763 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
2764 Do not assume SA_SIGINFO behavior.
2765 Bug reported by Jim Meyering on NetBSD 1.5.2.
2767 2002-06-22 Jim Meyering <meyering@lucent.com>
2769 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
2771 * exitfail.c, exitfail.h: Likewise.
2772 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
2774 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
2776 (EXTRA_DIST): Add fnmatch_loop.c.
2777 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
2779 * fnmatch_loop.c: New file, from diffutils-2.8.2.
2780 * fnmatch.c: Update from diffutils-2.8.2.
2781 * fnmatch_.h: New file. From diffutils-2.8.2.
2782 * fnmatch.h: Remove file.
2784 2002-06-18 Paul Eggert <eggert@twinsun.com>
2786 * file-type.h: Report an error if neither S_ISREG nor
2787 S_IFREG is defined, instead of using a test specific to glibc
2788 2.2. This should be safe, since POSIX requires S_ISREG and
2789 Unix Version 7 had S_IFREG. We don't need to check for
2790 <sys/types.h> since we don't use any symbols that it defines.
2792 2002-06-15 Jim Meyering <meyering@lucent.com>
2794 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
2795 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
2796 have been included before this file.
2798 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
2800 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
2801 so that each temporary file name is unique and valid in the first
2802 8 characters, for operation under DOS.
2804 2002-06-15 Jim Meyering <meyering@lucent.com>
2806 Work even with DJGPP 2.03, which lacks support for symlinks.
2808 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
2810 * lchown.c (S_ISLNK): Likewise.
2812 2002-06-14 Jim Meyering <meyering@lucent.com>
2814 * file-type.h: Use the version from diffutils-2.8.2.
2815 * file-type.c: Likewise.
2817 2002-05-27 Jim Meyering <meyering@lucent.com>
2819 Fix a problem seen only on nonconforming systems whereby ls.c's
2820 use of localtime, and then of gettimeofday would cause trouble:
2821 the localtime call used to initialize rpl_gettimeofday's save
2822 mechanism would clobber ls's current local time information so
2823 that in any long listing the first file would always be listed
2824 with date 1970-01-01. Analysis by Volker Borchert.
2826 * gettimeofday.c (localtime): Undefine.
2827 (rpl_localtime): New function.
2829 2002-05-22 Jim Meyering <meyering@lucent.com>
2831 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
2832 * file-type.h: New file.
2833 * file-type.c (file_type): New file/function. Extracted from diffutils.
2835 2002-04-29 Paul Eggert <eggert@twinsun.com>
2837 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
2839 2002-04-28 Paul Eggert <eggert@twinsun.com>
2841 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
2842 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
2843 of 127, since 64 is the largest conceivable number for ancient
2845 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
2847 2002-04-28 Jim Meyering <meyering@lucent.com>
2849 * sig2str.c (WTERMSIG): Remove definition (unused).
2851 2002-04-28 Paul Eggert <eggert@twinsun.com>
2853 * sig2str.h, sig2str.c: New files.
2854 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
2856 2002-04-24 Jim Meyering <meyering@lucent.com>
2858 * gettext.h: New file, from Gettext.
2859 * Makefile.am (INCLUDES): Remove -I../intl.
2860 (libfetish_a_SOURCES): Add gettext.h.
2862 2002-04-16 Jim Meyering <meyering@lucent.com>
2864 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
2865 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
2866 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
2868 2002-04-12 Jim Meyering <meyering@lucent.com>
2870 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
2872 2002-03-10 Jim Meyering <meyering@lucent.com>
2874 * makepath.c (make_path): Remove a comma from a diagnostic.
2875 Suggestion from Santiago Vila.
2877 2002-03-08 Jim Meyering <meyering@lucent.com>
2879 * rename.c: Mention that this wrapper is needed also on
2880 mips-dec-ultrix4.4 systems.
2882 2002-03-02 Jim Meyering <meyering@lucent.com>
2884 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
2885 not HAVE_CLOCK_SETTIME.
2887 2002-02-27 Paul Eggert <eggert@twinsun.com>
2889 * nanosleep.h: Rename to....
2890 * timespec.h: New name for nanosleep.h. All uses changed.
2892 * gettime.c: New file.
2893 * settime.c: New file.
2896 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
2897 timespec.h. Remove nanosleep.h.
2899 2002-02-25 Paul Eggert <eggert@twinsun.com>
2901 * acl.c, acl.h: New files.
2902 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
2904 2002-02-24 Jim Meyering <meyering@lucent.com>
2906 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
2907 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
2908 cause trouble. Reported by Nelson Beebe.
2910 2002-02-23 Paul Eggert <eggert@twinsun.com>
2912 * path-concat.c (xpath_concat): Reorder code to pacify
2913 compilers that don't know that xalloc_die never returns.
2915 2002-02-20 Jim Meyering <meyering@lucent.com>
2917 * getdate.c: Regenerate using bison-1.33.
2919 2002-02-15 Paul Eggert <eggert@twinsun.com>
2921 * posixver.c, posixver.h: New files.
2922 * Makefile.am (libfetish_a_SOURCES): Add them.
2924 2002-02-02 Paul Eggert <eggert@twinsun.com>
2925 Bruno Haible <bruno@clisp.org>
2927 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
2928 (fwrite_success_callback): New declaration.
2929 * unicodeio.c (unicode_to_mb): New function, extracted from
2930 print_unicode_char. Call failure callback instead of error.
2931 (fwrite_success_callback): New function.
2932 (exit_failure_callback): New function.
2933 (fallback_failure_callback): New function.
2934 (print_unicode_char): Call unicode_to_mb.
2936 2002-01-26 Jim Meyering <meyering@lucent.com>
2938 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
2940 2002-01-22 Jim Meyering <meyering@lucent.com>
2942 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
2943 Otherwise, some versions of automake would omit the rule that makes
2944 Makefile from Makefile.in.
2946 2001-01-21 Paul Eggert <eggert@twinsun.com>
2948 * xmemcoll.h, xmemcoll.c: New files.
2949 * Makefile.am (libfetish_a_SOURCES): Add them.
2950 * memcoll.c: Include errno.h, and declare errno if not defined.
2951 (memcoll): Set errno to zero if there is no error.
2953 * quotearg.c (quotearg_buffer_restyled):
2954 Fix bug with quoting buffers containing NUL when backslashing escapes.
2955 This bug was exposed by the other changes in this patch.
2956 (quotearg_n_options): New arg ARGSIZE.
2957 All callers changed.
2958 (quoting_options_from_style): New function.
2959 (quotearg_n_style): Use it.
2960 (quotearg_n_style_mem): New function.
2962 * quotearg.h (quotearg_n_style_mem): New function.
2964 2002-01-16 Jim Meyering <meyering@lucent.com>
2966 * getdate.y: Add three semicolons, each just before a closing brace.
2967 Bison (as of version 1.31) no longer papers over that mistake.
2969 2002-02-14 Paul Eggert <eggert@twinsun.com>
2971 * backupfile.c (ISDIGIT): Comment fix.
2972 * getdate.y (ISDIGIT): Likewise.
2973 * posixtm.c (ISDIGIT, year): Likewise.
2974 * strverscmp.c (ISDIGIT): Likewise.
2975 * userspec.c (ISDIGIT): Likewise.
2977 2002-01-05 Jim Meyering <meyering@lucent.com>
2979 * version-etc.c (version_etc_copyright): Update copyright year.
2981 2001-01-19 Paul Eggert <eggert@twinsun.com>
2983 * closeout.c (close_stdout_status): If ferror (stdout), do
2984 not silently exit merely because the output buffer happens to
2985 have nothing pending.
2987 2001-12-18 Paul Eggert <eggert@twinsun.com>
2989 See the big note in ../ChangeLog.
2990 * human.c (suffixes): Prefer K to k for 1024.
2991 (generate_suffix_backwards): New function.
2992 (human_readable_inexact): Use it.
2993 * xstrtol.c (__xstrtol): If there is no number but there
2994 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
2995 Accept 'K' as well as 'k'.
2997 2001-12-15 Jim Meyering <meyering@lucent.com>
2999 * regex.h (__restrict_arr): Update from libc.
3001 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
3002 as `remote' if the name starts with `//'. Suggested by Michael Stone.
3005 2001-12-10 Jim Meyering <meyering@lucent.com>
3007 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
3008 Instead, include "xalloc.h".
3009 (initbuffer): Don't cast xmalloc return value to char*.
3010 (readline): Reword comment.
3011 Don't cast xrealloc return value to char*
3014 2001-12-09 Jim Meyering <meyering@lucent.com>
3016 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
3017 `signed and unsigned type in conditional expression'.
3018 * posixtm.c (posix_time_parse): Likewise.
3020 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
3022 * readtokens.c (readtoken): Declare an index to be of type unsigned
3023 to avoid a pedantic warning.
3025 * getstr.c: Don't include assert.h.
3026 (getstr): Remove warning-evoking assertions.
3027 Return -1 if offset parameter is out of bounds.
3028 Change the type of a local from int to size_t.
3030 * strftime.c (my_strftime_localtime_r): Include this function
3031 definition in the `#if ! HAVE_TM_GMTOFF' block.
3033 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
3034 Include xalloc.h instead.
3036 2001-12-02 Jim Meyering <meyering@lucent.com>
3038 * tempname.c: Don't declare getenv, thus reverting the change of
3039 2001-11-18. It's no longer necessary, now that stdlib.h is always
3042 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
3043 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
3045 2001-11-30 Akim Demaille <akim@epita.fr>
3047 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
3048 before being defined.
3050 2001-11-27 Paul Eggert <eggert@twinsun.com>
3052 * quotearg.h (quotearg_n, quotearg_n_style):
3053 First arg is int, not unsigned.
3054 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
3055 (SIZE_MAX, UINT_MAX): New macros.
3056 (quotearg_n_options): Abort if N is negative.
3057 Avoid overflow check on hosts where size_t is 64 bits and int
3058 is 32 bits, as overflow is impossible there.
3059 Fix off-by-one typo that caused unnecessary reallocation.
3061 2001-11-27 Jim Meyering <meyering@lucent.com>
3063 * tempname.c: Merge with version from libc.
3064 * regex.c: Likewise.
3066 * tempname.c: Include stdlib.h unconditionally. On some old systems
3067 for which STDC_HEADERS is 0, it was not included, resulting in a
3068 warning about an integer-to-pointer conversion problem with getenv.
3069 Reported by Volker Borchert.
3071 2001-11-26 Jim Meyering <meyering@lucent.com>
3073 * gtod.h: Remove file.
3074 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
3075 * gettimeofday.c: Don't include gtod.h.
3076 (GTOD_init): Remove function.
3077 (rpl_gettimeofday): Do its job here instead, rather than aborting.
3078 Suggestion from Volker Borchert.
3080 2001-11-23 Jim Meyering <meyering@lucent.com>
3082 * hash.h (struct hash_table): Don't define here. Merely declare it.
3083 * hash.c (struct hash_table): Define it here instead.
3085 2001-11-22 Jim Meyering <meyering@lucent.com>
3087 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
3089 2001-11-18 Paul Eggert <eggert@twinsun.com>
3091 * tempname.c (TMP_MAX): Remove; no longer needed.
3092 (TEMPORARIES): New macro.
3093 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
3094 removes an artificial limitation (e.g. HP-UX 10.20, where
3097 2001-11-18 Jim Meyering <meyering@lucent.com>
3099 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
3102 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
3103 files will be created before anything else.
3105 2001-11-17 Jim Meyering <meyering@lucent.com>
3107 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
3108 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
3109 rather than group writable. Patch by Juan F. Codagnone.
3111 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
3112 Instead, include "xalloc.h".
3114 * mountlist.c: Include unlocked-io.h after all system headers.
3115 Remove explicit declarations of xmalloc, xrealloc,
3116 and xstrdup. Instead, include "xalloc.h".
3118 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
3119 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
3120 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
3122 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
3123 Reported by Padraig Brady.
3125 * mkstemp.c: #undef mkstemp.
3127 (rpl_mkstemp): Rename from mkstemp.
3130 2001-11-16 Jim Meyering <meyering@lucent.com>
3132 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
3133 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
3134 determine the amount of total physical memory, use pstat_getstatic.
3135 HPUX-11 doesn't define _SC_PHYS_PAGES.
3136 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
3137 If sysconf couldn't be used to determine the amount of available
3138 physical memory, use both pstat_getstatic and pstat_getdynamic.
3139 Based on a patch from Bob Proulx.
3141 2001-11-05 Jim Meyering <meyering@lucent.com>
3143 * xstat.in (slash_aware_lstat): Correct a misleading comment.
3145 2001-11-03 Jim Meyering <meyering@lucent.com>
3147 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
3148 in argmatch_to_argument call.
3150 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
3153 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
3154 e.g., a fault due to an attempt to free a NULL pointer.
3156 2001-11-01 Jim Meyering <meyering@lucent.com>
3158 * dirfd.c, dirfd.h: New files.
3159 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
3161 * hash.c (hash_print) [TESTING]: Clean up.
3163 2001-10-22 Paul Eggert <eggert@twinsun.com>
3165 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
3166 to avoid a warning if -Wall.
3168 2001-10-21 Paul Eggert <eggert@twinsun.com>
3170 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
3172 2001-10-21 Jim Meyering <meyering@lucent.com>
3174 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
3175 this code would end up calling gettext even in packages built
3177 * getopt.c (_): Likewise.
3178 * regex.c (_): Likewise.
3180 2001-10-20 Paul Eggert <eggert@twinsun.com>
3182 * error.c (strerror_r): Do not declare unless !_LIBC.
3183 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
3184 Use strerror_r that is only a macro, even if it is not a function.
3185 (strerror): Check for HAVE_DECL_STRERROR before declaring.
3186 (private_strerror): Use prototypes, not old-style function definition.
3187 (print_errno_message): New function.
3188 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
3190 (error_tail, error, error_at_line): Use it.
3192 2001-10-11 Jim Meyering <meyering@lucent.com>
3194 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
3195 and quote_n (1, ... to avoid clobbering a buffer.
3197 2001-10-05 Jim Meyering <meyering@lucent.com>
3199 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
3200 * hash-pjw.c: New file (factored out of fileutils' remove.c).
3201 * hash-pjw.h: New file.
3203 2001-09-30 Jim Meyering <meyering@lucent.com>
3205 * mountlist.c [MOUNTED_GETFSSTAT]:
3206 Include <sys/ucred.h>, for Apple Darwin.
3207 Include sys/mount.h and sys/fs_types.h only if available.
3209 (read_filesystem_list): Use FS_TYPE.
3211 2001-09-29 Paul Eggert <eggert@twinsun.com>
3213 * exclude.c (excluded_filename): 0 -> false, since it's
3216 2001-09-28 Paul Eggert <eggert@twinsun.com>
3218 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
3219 #defines strtoimax. Also treat the other strto* functions
3222 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
3223 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
3224 (strtoimax, strtoumax): Do not declare if already defined as a macro.
3226 2001-09-26 Jim Meyering <meyering@lucent.com>
3228 Most macros in unlocked-io.h had the wrong number of arguments.
3229 * gen-uio: New script.
3230 (USE_UNLOCKED_IO): Define to 1 if not already defined.
3231 * unlocked-io.hin: Remove file.
3232 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
3233 rather than trying to embed it here.
3234 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
3235 Reported by Padraig Brady.
3237 2001-09-25 Volker Borchert <bt@teknon.de>
3239 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
3241 2001-09-23 Jim Meyering <meyering@lucent.com>
3243 * mountlist.c: Remove useless parentheses in #if directives.
3244 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
3245 the deprecated MOUNTED symbol is no longer defined in mntent.h.
3247 2001-09-22 Jim Meyering <meyering@lucent.com>
3249 * localcharset.c: Update from latest gettext.
3250 * config.charset: Likewise.
3252 2001-09-20 Jim Meyering <meyering@lucent.com>
3254 * xstrtol.c (strtoimax): Guard declaration with
3255 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
3256 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
3257 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
3258 (strtoumax): Likewise, for completeness (it wasn't necessary).
3260 2001-09-06 Paul Eggert <eggert@twinsun.com>
3262 * strtoimax.c (HAVE_LONG_LONG):
3263 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
3264 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
3265 to work around bug in IBM C compiler.
3267 2001-09-16 Jim Meyering <meyering@lucent.com>
3269 * mkdir.c: New file.
3271 2001-09-04 Paul Eggert <eggert@twinsun.com>
3273 * xgetcwd.c: Revert some of the previous change; intead,
3274 fix the HAVE_GETCWD_NULL code to behave more like the
3275 !HAVE_GETCWD_NULL code used to.
3278 (xgetcwd): Do not return NULL when memory is exhausted; instead,
3281 2001-09-04 Paul Eggert <eggert@twinsun.com>
3283 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
3284 Use ssize_t, not int, to store result of readlink.
3285 Check for ssize_t overflow as well as size_t overflow,
3286 as POSIX says the result of readlink is implementation-defined
3287 when ssize_t overflows.
3288 Remove unnecessary cast to char*.
3289 Use free+malloc instead of realloc, as the storage doesn't need
3290 to be preserved and it's clearer and can be more efficient that way.
3291 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
3292 * xreadlink.h (xreadlink): Update prototype.
3294 2001-09-03 Paul Eggert <eggert@twinsun.com>
3296 * exclude.c (fnmatch_no_wildcards): Fix confusion between
3297 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
3298 spotted by Jim Meyering.
3300 2001-09-03 Jim Meyering <meyering@lucent.com>
3302 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
3304 2001-09-03 Paul Eggert <eggert@twinsun.com>
3306 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
3307 like the HAVE_GETCWD_NULL code.
3308 Include pathmax.h if not HAVE_GETCWD.
3309 Do not include xalloc.h.
3310 (INITIAL_BUFFER_SIZE): New symbol.
3311 Do not use xmalloc / xrealloc, since the caller is responsible for
3312 handling errors. Preserve errno around `free' during failure.
3313 Do not overrun buffer when using getwd.
3315 2001-09-03 Paul Eggert <eggert@twinsun.com>
3317 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
3318 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
3320 2001-09-02 Jim Meyering <meyering@lucent.com>
3322 * error.c: Update from GNU libc.
3324 2001-09-01 Jim Meyering <meyering@lucent.com>
3326 * xreadlink.c: New file.
3327 * xreadlink.h: New file.
3328 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
3330 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
3331 doesn't conflict with sparc Solaris 7's definition in
3332 /usr/include/sys/int_types.h.
3334 * exclude.c: Use `""', not `<>' to #include non-system header files.
3335 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
3336 and strncasecmp as r-values. Unixware didn't have declarations.
3338 2001-08-31 Jim Meyering <meyering@lucent.com>
3340 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
3341 Use an initial, malloc'd, buffer of length 128 rather than
3342 a statically allocated one of length 1024.
3344 2001-08-30 Paul Eggert <eggert@twinsun.com>
3346 * xgetcwd.c: Don't include pathmax.h.
3347 Include stdlib.h and unistd.h if available.
3349 (xmalloc, xstrdup, free): Remove decls.
3350 (xgetcwd): Don't assume sizes fit in unsigned.
3351 Check for overflow when computing sizes.
3352 Simplify reallocation code.
3354 2001-08-28 Paul Eggert <eggert@twinsun.com>
3356 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
3358 * strtoimax.c: Renamed from strtoxmax.c, removing the
3361 Also, make the following further changes to make this file's
3362 configuration more similar to that of strtol.c:
3363 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
3364 (strtoumax, uintmax_t, strtoull, strtol): Remove.
3365 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
3366 (strtoimax): Renamed from strtoumax. All uses of unsigned values
3367 changed to signed values.
3369 And make the following changes as well:
3370 Fix copyright notice, as 1999 was missing.
3371 (verify): New macro.
3372 (strtoimax): Check sizes at compile-time, not run-time.
3373 Prefer strtol to strtoll if both work.
3374 (main): Remove; it was not that useful and was a pain to maintain.
3376 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
3378 2001-08-30 Paul Eggert <eggert@twinsun.com>
3380 * savedir.c (savedir): Remove size parameter, as POSIX says that
3381 a directory's st_size can have an arbitrary value, so the old
3382 usage could waste an arbitrary amount of memory. All uses
3384 * savedir.h: Update prototype.
3386 2001-08-30 Paul Eggert <eggert@twinsun.com>
3388 * xstrtol.c (strtoimax): New decl.
3390 2001-08-28 Paul Eggert <eggert@twinsun.com>
3392 * xstrtol.h: Add copyright notice.
3393 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
3394 LONGINT_INVALID_SUFFIX_CHAR.
3396 2001-08-30 Paul Eggert <eggert@twinsun.com>
3398 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
3401 2001-08-30 Paul Eggert <eggert@twinsun.com>
3403 * hash.c: Remove '2001' from copyright notice.
3405 2001-08-30 Paul Eggert <eggert@twinsun.com>
3407 * full-write.h: New file.
3408 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
3409 * full-write.c: Correct credits, as cccp.c no longer
3410 exists and anyway it was so heavily changed from the old cccp
3411 code as to be unrecognizable. Include full-write.h.
3412 (full_write) Return size_t, with short writes meaning failure.
3413 All callers changed. This fixes a bug with large buffers
3415 * utime.c: Include full-write.h.
3417 2001-08-30 Paul Eggert <eggert@twinsun.com>
3419 Merge 'exclude' changes from tar 1.13.22.
3420 This fixes one or two unlikely storage allocation overflow bugs,
3421 but doesn't change user-visible behavior otherwise.
3423 2001-08-30 Paul Eggert <eggert@twinsun.com>
3425 * exclude.c (bool): Declare, perhaps by including stdbool.h.
3426 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
3427 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
3428 Include if available.
3429 (<xalloc.h>): Include
3430 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
3431 (verify): New macro. Use it to verify that EXCLUDE macros do not
3432 collide with FNM macros.
3433 (struct patopts): New struct.
3434 (struct exclude): Use it, as exclude patterns now come with options.
3435 (new_exclude): Support above changes.
3436 (new_exclude, add_exclude_file):
3437 Initial size must now be a power of two to simplify overflow checking.
3438 (free_exclude, fnmatch_no_wildcards): New function.
3439 (excluded_filename): No longer requires options arg, as the options
3440 are determined by add_exclude. Now returns bool, not int.
3441 (excluded_filename, add_exclude):
3442 Add support for the fancy new exclusion options.
3443 (add_exclude, add_exclude_file): Now takes int options arg.
3444 Check for arithmetic overflow when computing sizes.
3445 (add_exclude_file): xrealloc might modify errno, so don't
3446 realloc until after errno might be used.
3448 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
3450 (free_exclude): New decl.
3451 (add_exclude, add_exclude_file): Now takes int options arg.
3452 (excluded_filename): No longer requires options arg, as the options
3453 are determined by add_exclude. Now returns bool, not int.
3455 2001-08-30 Paul Eggert <eggert@twinsun.com>
3457 * alloca.c (alloca): Arg is of type size_t, not unsigned.
3459 2001-08-27 Jim Meyering <meyering@lucent.com>
3461 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
3463 * version-etc.c (N_): Remove definition.
3464 Revert most of last change.
3465 Instead, simply don't mark the `Copyright...' string for translation.
3466 Based on advice from Paul Eggert.
3468 * strtoxmax.c: Tweak comment.
3470 2001-08-26 Jim Meyering <meyering@lucent.com>
3472 * version-etc.c (version_etc_copyright_fmt): Replace literal year
3473 of copyright with `%s' so translators don't get an untranslated
3475 (COPYRIGHT_YEAR): Define.
3476 (version_etc): Use fprintf rather than fputs.
3477 Suggestion from Ulrich Drepper.
3479 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
3481 * strtoll.c: New file, from GNU libc.
3482 * xstrtoimax.c: New file.
3484 * xstrtol.h: Add xstrtoimax.
3485 * strtoumax.c: New file. Simply include "strtoumax.c".
3486 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
3488 * strtoumax.c: Factor to work both for unsigned and signed types, ...
3489 * strtoxmax.c: ... then renamed to this.
3491 2001-08-13 Paul Eggert <eggert@twinsun.com>
3493 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
3494 Port to Solaris 8, where 'sed' requires a space after the 'r'
3495 command, and where sh dislikes "$/". Clean up the spacing a bit.
3496 Redirect output to $tmp just once.
3498 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
3500 * addext.c (<errno.h>): Include.
3501 (errno): Declare if not defined.
3502 (addext): Work correctly when pathconf returns -1 and leaves
3503 errno alone because there is no limit. Also, work even if
3504 pathconf returns a value greater than SIZE_MAX.
3506 2001-08-12 Jim Meyering <meyering@lucent.com>
3508 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
3509 Simply `return getcwd (NULL, 0);'.
3510 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
3511 Use 1300 as initial value for length, not PATH_MAX.
3513 * pathmax.h: Clean up cpp syntax.
3515 2001-08-12 Jim Meyering <meyering@lucent.com>
3517 * gettimeofday.c: New file.
3519 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
3521 2001-08-04 Jim Meyering <meyering@lucent.com>
3523 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
3524 to get in sync with glibc.
3526 2001-08-03 Paul Eggert <eggert@twinsun.com>
3528 The following changes are from gettext 0.10.39 as maintained by
3531 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
3532 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
3533 with inverted sense. All uses changed.
3535 * mbswidth.c: Don't include <limits.h>.
3536 Include <stdlib.h> and <string.h> unconditionally.
3537 (iswcntrl, mbsinit, ISCNTRL): New macros.
3538 (mbsnwidth): Use K&R style function declarations.
3539 Don't bother checking for MB_LEN_MAX == 1, since the compiler
3540 can optimize it when MB_CUR_MAX == 1.
3541 The width of control characters is zero, not 1.
3543 2001-07-15 Jim Meyering <meyering@lucent.com>
3545 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
3546 (BUILT_SOURCES): Add unlocked-io.h.
3547 (io_functions): Define.
3548 (unlocked-io.h): New rule.
3549 (DISTCLEANFILES): Add unlocked-io.h.
3550 (all-local): Depend on unlocked-io.h, to ensure it is created.
3552 * unlocked-io.hin: New file
3554 * regex.c: Update from glibc.
3556 2001-07-05 Jim Meyering <meyering@lucent.com>
3558 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
3560 (libfetish_a_SOURCES): Put all .h files here instead.
3561 Remove a thus-exposed (better checks in automake) duplicate and
3562 two unnecessary .h files.
3564 2001-06-11 Jim Meyering <meyering@lucent.com>
3566 * regex.c: Update from GNU libc.
3568 2001-05-27 Jim Meyering <meyering@lucent.com>
3570 * readutmp.h (UT_TYPE): Define.
3572 2001-05-24 Jim Meyering <meyering@lucent.com>
3574 * argmatch.c: Include "quote.h".
3575 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
3576 quote function. Reported by Göran Uddeborg.
3578 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
3580 * dirname.c (dir_name): Compute append_dot using path, not newpath
3581 which is not yet declared.
3583 2001-05-11 Paul Eggert <eggert@twinsun.com>
3585 * Makefile.am (libfetish_a_SOURCES):
3586 Add strftime.c, since we now compile it on all hosts.
3588 * strftime.c (my_strftime):
3589 Define to nstrftime if emacs, but only if my_strftime is not defined.
3590 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
3591 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
3592 Add one more extra argument: a nanoseconds value.
3595 (my_strftime function): Add %N format.
3596 (emacs_strftimeu): Renamed from emacs_strftime,
3597 with extra ut argument.
3599 2001-05-11 Paul Eggert <eggert@twinsun.com>
3601 dirname code cleanup. base_name now behaves more compatibly
3602 with POSIX basename when given file names that have trailing
3603 slashes, and similarly for dir_name. Add new primitives
3604 base_len and dir_len. Put the directory-name-related decls
3607 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
3608 * backupfile.c (base_name): Likewise.
3609 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
3610 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
3611 * makepath.c (strip_trailing_slashes): Likewise.
3612 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
3614 * rename.c (strip_trailing_slashes): Likewise.
3615 * same.c (base_name): Likewise.
3616 * stripslash.c (ISSLASH): Likewise.
3618 * addext.c: Include <dirname.h> after size_t is defined.
3619 * backupfile.c: Likewise.
3621 * addext.c (addext): Use base_len to trim redundant
3622 trailing slashes instead of doing it ourselves.
3623 But do not trim the last slash if it is not redundant.
3625 * backupfile.c (find_backup_file_name,
3626 max_backup_version): Use base_len instead of rolling it ourselves.
3627 Handle the case of "" and (on DOS) "C:" correctly.
3629 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
3630 Include <string.h>, <dirname.h>.
3631 (base_name): Allow file names ending in slashes, other than names
3632 that are all slashes. In this case, return the basename followed
3633 by the slashes. This is more general, and can be used in places
3634 where the original base_name purposely had an assertion failure.
3635 (base_len): New function.
3637 * dirname.c: Include <string.h> instead of <stdlib.h>.
3638 Do not include <assert.h>; no longer needed.
3640 (memrchr): Remove decl.
3641 (dir_name_r): Remove.
3642 (dir_len): Renamed from dirlen. All callers changed.
3643 Rewrite in terms of base_name, for simplicity and consistency.
3644 (dir_name): Never return NULL. All callers changed.
3645 Do not include <stdlib.h> in test program; no longer needed.
3646 return 0; is fine for test program.
3648 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
3650 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
3652 * path-concat.c (path_concat): Use base_len to compute
3653 base length, not strlen; this means we cannot rely on memcpy
3656 * same.c (STREQ): Remove.
3657 (same_name): Handle the case where the basename ends in trailing '/'.
3659 * stripslash.c (strip_trailing_slashes): Return nonzero if
3660 a slash was stripped. Do not strip the last slash after a
3663 2001-04-08 Jim Meyering <meyering@lucent.com>
3665 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
3666 recomputed; that's necessary when the offset spans a DST transition.
3667 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
3669 2001-04-02 Jim Meyering <meyering@lucent.com>
3671 * regex.h, regex.c: Update from GNU libc.
3673 2001-03-19 Paul Eggert <eggert@twinsun.com>
3675 * version-etc.c (version_etc_copyright): Update to 2001.
3677 2001-03-16 Paul Eggert <eggert@twinsun.com>
3679 * tempname.c (uint64_t): Define to uintmax_t if
3680 not defined, and if UINT64_MAX is not defined.
3681 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
3682 Reported by John David Anglin.
3684 2001-03-10 Bruno Haible <haible@clisp.cons.org>
3686 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
3687 alias if codeset is empty.
3688 * config.charset (BeOS): Use wildcard syntax.
3690 2001-03-13 Jim Meyering <meyering@lucent.com>
3692 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
3693 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
3696 2001-03-06 Bruno Haible <haible@clisp.cons.org>
3698 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
3700 * unicodeio.c (print_unicode_char): Simplify accordingly.
3702 2001-03-06 Bruno Haible <haible@clisp.cons.org>
3704 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
3705 support for DOS/DJGPP.
3707 2001-02-28 Paul Eggert <eggert@twinsun.com>
3709 * Makefile.am (libfetish_a_SOURCES):
3710 Add dup-safer.c, fopen-safer.c.
3711 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
3713 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
3715 2001-02-25 Paul Eggert <eggert@twinsun.com>
3717 The mkstemp replacement is taken from glibc 2.2.2, with some
3718 portability fixes for use outside glibc, as follows:
3720 * tempname.c (struct_stat64): New macro.
3721 (direxists, __gen_tempname): Use it.
3722 This avoids a portability problem with Solaris 8.
3724 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
3725 (<stddef.h>, <stdint.h>, <string.h>):
3726 Include only if STDC_HEADERS || _LIBC.
3727 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
3728 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
3729 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
3730 (__set_errno): Define this macro if <errno.h> doesn't.
3731 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
3732 Define these macros if <stdio.h> doesn't.
3733 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
3734 Define these macros if <sys/stat.h>
3735 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
3736 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
3737 __xstat64): Define if not _LIBC.
3738 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
3739 (__gen_tempname): Invoke gettimeofday only if
3740 HAVE_GETTIMEOFDAY || _LIBC;
3741 otherwise, fall back on plain "time".
3742 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
3744 * mkstemp.c (__GT_FILE): Define to zero if not defined.
3746 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
3748 2001-02-17 Jim Meyering <meyering@lucent.com>
3750 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
3751 around included file name.
3753 * strnlen.c (__strnlen): Merge in a change from GNU libc.
3755 * strftime.c: Update from GNU libc (the only changes were to comments).
3757 2001-02-13 Bruno Haible <haible@clisp.cons.org>
3759 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
3761 2001-02-17 Paul Eggert <eggert@twinsun.com>
3763 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
3764 Remove workaround macros for hosts that have mbrtowc but not
3765 mbstate_t, as we now insist on proper declarations for both
3766 before using mbrtowc.
3768 2001-02-17 Jim Meyering <meyering@lucent.com>
3770 * regex.c: Update from libc.
3772 2001-02-16 Paul Eggert <eggert@twinsun.com>
3774 * alloca.c (malloc): Undef before defining, since stdlib.h
3775 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
3776 Reported by Mark Hounschell via Paul Eggert.
3778 2001-01-30 Bruno Haible <haible@clisp.cons.org>
3780 * config.charset: Update for FreeBSD 4.2.
3782 2001-01-26 Jim Meyering <meyering@lucent.com>
3784 * quotearg.c: Include stddef.h.
3785 * quote.c: Include stddef.h.
3786 Reported by Axel Kittenberger.
3788 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
3789 line in double quotes so that it evokes a better diagnostic.
3790 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
3791 Reported by Axel Kittenberger.
3793 2001-01-15 Bruno Haible <haible@clisp.cons.org>
3795 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
3796 to avoid a warning. Add back 'const' to inptr.
3798 2001-01-16 Jim Meyering <meyering@lucent.com>
3800 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
3803 2001-01-14 Jim Meyering <meyering@lucent.com>
3805 * rename.c: New file. From Volker Borchert.
3806 Include stdlib.h, string.h or strings.h, and xalloc.h.
3807 Use strip_trailing_slashes rather than open-coding it.
3809 2001-01-03 Paul Eggert <eggert@twinsun.com>
3811 * strftime.c: Sync with glibc time/strftime.c 1.81.
3813 2001-01-03 Jim Meyering <meyering@lucent.com>
3815 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
3816 local `inptr' to avoid warning with some system declarations of iconv.
3818 2000-12-29 Paul Eggert <eggert@twinsun.com>
3820 * modechange.c: Do not assume that mode_t uses the
3821 traditional octal encoding. E.g. "chmod 1 FOO" should set
3822 the other-execute bit of FOO even if S_IXOTH != 1.
3824 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
3825 WOTH, XOTH, ALLM): New macros.
3826 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
3827 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
3829 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
3830 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
3832 No need to use uintmax_t; unsigned long is long enough.
3833 Don't bother to get suffix since we don't use it.
3835 2000-12-24 Jim Meyering <meyering@lucent.com>
3837 * hash.c (is_prime): Return explicit boolean values.
3838 (hash_get_first): Return NULL to appease Irix5.6's 89.
3839 Reported by Nelson Beebe.
3841 2000-10-31 Bruno Haible <haible@clisp.cons.org>
3843 * localcharset.c (locale_charset): Add support for Win32.
3845 2000-12-18 Paul Eggert <eggert@twinsun.com>
3847 * physmem.h, physmem.c: New files.
3849 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
3850 (noinst_HEADERS): Add physmem.h.
3852 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
3853 't' for compatibility with Solaris 8 sort.
3855 2000-12-18 Bruno Haible <haible@clisp.cons.org>
3857 * config.charset: Add support for BeOS.
3859 2000-12-16 Jim Meyering <meyering@lucent.com>
3861 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
3862 SHELLS_FILE to a file name that's useful on djgpp systems.
3864 (ADDITIONAL_DEFAULT_SHELLS): Define.
3865 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
3866 Based mostly on a patch from Prashant TR.
3868 2000-12-16 Jim Meyering <meyering@lucent.com>
3870 This bug had a serious impact on chown: `chown N:M FILE' (for integer
3871 N and M) would have treated it like `chown N:N FILE'.
3873 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
3875 2000-10-31 Bruno Haible <haible@clisp.cons.org>
3877 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
3878 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
3879 to the list of canonical encodings. Rename EUC-CN to GB2312.
3881 2000-12-08 Andreas Schwab <schwab@suse.de>
3883 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
3884 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
3886 2000-12-07 Jim Meyering <meyering@lucent.com>
3888 * stripslash.c (ISSLASH): Define.
3889 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
3892 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
3893 (dir_name_r): Declare this function as static.
3894 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
3895 manifest itself on a name containing a mix of slashes and
3897 Make this function work with names starting with a DOS-style
3898 drive letter and colon prefix.
3899 (dir_name): Append `.' if necessary.
3900 Based mostly on patches from Prashant TR and Eli Zaretskii.
3902 * dirname.h (dir_name_r): Remove prototype.
3904 2000-12-05 Jim Meyering <meyering@lucent.com>
3906 * dirname.c (dir_name_r): Add `const' in a few local declarations.
3908 2000-12-04 Jim Meyering <meyering@lucent.com>
3910 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
3911 Also include memory.h, stdlib.h, unistd.h if appropriate.
3912 Reported by Andreas Jaeger (conflicting declaration of malloc).
3914 2000-12-02 Jim Meyering <meyering@lucent.com>
3916 * closeout.h: Make idempotent, to avoid some obscure warnings.
3918 2000-12-01 Paul Eggert <eggert@twinsun.com>
3920 * memrchr.c: Include <config.h> before any system include file.
3922 2000-11-29 Paul Eggert <eggert@twinsun.com>
3924 * dirname.c (dir_name_r): Fix typo: int -> size_t.
3926 2000-11-26 Jim Meyering <meyering@lucent.com>
3928 * memcoll.c: Include sys/types.h. From Werner Almesberger.
3930 2000-11-22 Paul Eggert <eggert@twinsun.com>
3932 * strftime.c (my_strftime): Do not invoke mbrlen with a
3933 size of (size_t) -1; it's not portable.
3935 2000-11-17 Akim Demaille <akim@epita.fr>
3937 * obstack.h: Formatting changes.
3938 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
3939 prevent type checking.
3940 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
3941 cast the value to (void *): assigning a `foo *' to a `void *'
3943 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
3945 2000-11-17 Jim Meyering <meyering@lucent.com>
3947 * strstr.c: Update from GNU libc.
3949 2000-11-16 Jim Meyering <meyering@lucent.com>
3951 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
3953 2000-11-11 Jim Meyering <meyering@lucent.com>
3955 * error.c: Add a couple #includes, merging from GNU libc version.
3957 2000-11-10 Jim Meyering <meyering@lucent.com>
3959 * obstack.h: Update from GNU libc.
3960 * obstack.c: Likewise.
3962 2000-11-06 Paul Eggert <eggert@twinsun.com>
3964 * getusershell.c (setusershell): Use rewind rather than
3965 fseek/fseeko, to avoid configuration hassles with fseeko.
3966 Don't bother opening SHELLS_FILE if shellstream is NULL;
3969 2000-11-05 Jim Meyering <meyering@lucent.com>
3971 * makepath.h (make_dir): Declare.
3972 * makepath.c (make_dir): Remove `static' attribute.
3975 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
3977 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
3978 last one in a bucket, advance to the next bucket.
3980 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
3982 * fnmatch.c: Do not comment out all the code if we are using
3983 the GNU C library, because in some cases we are replacing buggy
3984 code in the GNU C library itself.
3986 2000-10-30 Paul Eggert <eggert@twinsun.com>
3988 * error.h, getline.h, modechange.h:
3989 Remove "2000" from Copyright line, as the file hasn't been
3990 changed this year other than in the copyright notice.
3992 * xalloc.h: Add "2000" to Copyright line, as this file
3993 was changed this year.
3995 2000-10-30 Paul Eggert <eggert@twinsun.com>
3997 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
3998 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
3999 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4001 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
4003 * regex.h (__restrict_arr): Move definition out of #ifndef block.
4004 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
4005 doesn't define __restrict_arr.
4007 2000-10-29 Jim Meyering <meyering@lucent.com>
4009 * xstat.in: Fix grammar in comment.
4011 2000-10-28 Jim Meyering <meyering@lucent.com>
4013 * memchr.c: Update from libc.
4014 Adjust for portability:
4015 [HAVE_STDLIB_H]: Include stdlib.h.
4016 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
4017 Undef __memchr, too.
4018 [!weak_alias]: Define __memchr to memchr.
4020 * regex.c: Update from libc.
4021 * regex.h: Likewise.
4022 * getopt1.c: Likewise.
4023 * memcmp.c: Likewise.
4025 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
4026 Avoid using fseek, when possible -- it's broken by design.
4027 Patch by Ulrich Drepper.
4029 2000-10-26 Jim Meyering <meyering@lucent.com>
4031 * strftime.c: Update from libc.
4033 2000-10-25 Jim Meyering <meyering@lucent.com>
4035 * obstack.c: Update from libc.
4037 2000-10-23 Jim Meyering <meyering@lucent.com>
4039 * hard-locale.c (hard_locale): Revert last change -- it was simply
4040 wrong. That set_locale call must not have any side effects.
4043 2000-10-22 Jim Meyering <meyering@lucent.com>
4045 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
4046 [CYCLIC]: Remove now-unused definition.
4048 * save-cwd.c (O_DIRECTORY): Define, if needed.
4049 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
4050 Suggestion from Ulrich Drepper.
4052 2000-10-21 Jim Meyering <meyering@lucent.com>
4054 * dirname.c (dir_name_r): New function, factored out of dir_name.
4055 (dir_name): Use dir_name_r.
4056 * dirname.h (dir_name_r): Declare it.
4058 2000-10-21 Jim Meyering <meyering@lucent.com>
4060 * dirname.c (memrchr): Declare if necessary.
4061 (dir_name): Remove the restriction that there be no
4062 trailing slashes. Now, this code skips past them, effectively
4064 [TEST_DIRNAME] (main): New unit tests.
4066 * memrchr.c: New file from GNU libc.
4067 Undef __memrchr, too.
4068 [!weak_alias]: Define __memrchr to memrchr.
4069 Guard weak_alias use with `#ifdef weak_alias'.
4071 2000-10-17 Jim Meyering <meyering@lucent.com>
4073 * quote.h (PARAMS): Define and use.
4074 Reported by Akim Demaille.
4076 * getopt.c: Update from libc.
4078 2000-10-16 Jim Meyering <meyering@lucent.com>
4080 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
4083 2000-09-25 Jim Meyering <meyering@lucent.com>
4085 * md5.h (rol): Define (from GnuPG).
4087 * sha.c: Give credit (GnuPG) where due.
4088 (M): Use rol rather than open-coding it.
4089 Add a FIXME comment.
4091 2000-09-21 Jim Meyering <meyering@lucent.com>
4093 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
4094 Reported by Michael Stone.
4096 2000-09-20 Jim Meyering <meyering@lucent.com>
4098 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
4099 (noinst_HEADERS): Add sha.h.
4100 Based on code from Scott G. Miller and from GnuPG.
4102 2000-09-15 Jim Meyering <meyering@lucent.com>
4104 * regex.c: Update from libc.
4106 2000-09-10 Jim Meyering <meyering@lucent.com>
4108 * getopt.c (_getopt_internal): Update from glibc.
4110 2000-09-09 Jim Meyering <meyering@lucent.com>
4112 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
4113 think it should be used as a general replacement for isascii.
4114 * fnmatch.c: Likewise.
4115 * mbswidth.c: Likewise
4116 * regex.c: Likewise.
4119 * userspec.c: Include sys/param.h and limits.h.
4121 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4122 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
4123 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
4124 UID, GID. Check range.
4126 2000-09-06 Jim Meyering <meyering@lucent.com>
4128 * getopt.c (_getopt_internal): Update from glibc.
4130 2000-08-30 Jim Meyering <meyering@lucent.com>
4132 * strftime.c: Merge in changes from GNU libc.
4134 2000-08-26 Jim Meyering <meyering@lucent.com>
4136 * closeout.c: Include "__fpending.h".
4137 (close_stdout_status): Return right away if there's nothing to flush.
4139 * Makefile.am (noinst_HEADERS): Add __fpending.h.
4140 * __fpending.c: New file.
4141 * __fpending.h: New file.
4143 2000-08-07 Paul Eggert <eggert@twinsun.com>
4145 Standardize on "memory exhausted" instead of "Memory exhausted"
4146 or "virtual memory exhausted".
4147 * obstack.c (print_and_abort): Use "memory exhausted", not
4148 "virtual memory exhausted".
4149 * same.c (same_name): Invoke xalloc_die instead of printing
4151 * userspec.c (parse_user_spec): Likewise.
4152 * bumpalloc.h: comment fix
4153 * same.c, userspec.c: Include xalloc.h.
4155 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
4156 not char *const and pointing to a constant array.
4157 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
4158 (xrealloc): Comment fix.
4160 * userspec.c (parse_user_spec):
4161 Don't translate a message until just before returning,
4162 to avoid unnecessary translation.
4164 2000-08-07 Jim Meyering <meyering@lucent.com>
4166 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
4167 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
4168 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
4169 getgroups.c, gethostname.c, getopt.h, group-member.c,
4170 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
4171 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
4172 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
4173 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
4174 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
4175 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
4176 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
4177 yesno.c: Back out Copyright date changes for each file with no change
4178 this year. This eases coordination with other programs using the same
4179 source code modules. From Paul Eggert.
4181 2000-08-03 Greg McGary <greg@mcgary.org>
4183 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
4184 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
4185 (EXTEND_BUFFER): Use them.
4187 2000-08-01 Jim Meyering <meyering@lucent.com>
4189 * dirname.c (ISSLASH): Define.
4190 (BACKSLASH_IS_PATH_SEPARATOR): Define.
4191 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
4192 both `\' and `/' may be use as path separators.
4193 Based on a patch from Prashant TR.
4195 2000-07-31 Paul Eggert <eggert@twinsun.com>
4197 * quotearg.c (quotearg_n_options): Don't make the initial
4198 slot vector a constant, since it might get modified.
4200 2000-07-31 Jim Meyering <meyering@lucent.com>
4202 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
4203 * obstack.c (print_and_abort): Likewise.
4205 2000-07-30 Paul Eggert <eggert@twinsun.com>
4207 * quotearg.c (quotearg_n_options): Preallocate a slot 0
4208 buffer, so that the caller can always quote one small
4209 component of a "memory exhausted" message in slot 0.
4210 From a suggestion by Jim Meyering.
4212 2000-07-30 Jim Meyering <meyering@lucent.com>
4214 * makepath.c (make_path): Quote the other instance, too.
4216 * quotearg.c (N_STATIC_SLOTVECS): Define.
4217 (STATIC_BUF_SIZE): Define.
4218 (quotearg_n_options): Use only statically allocated storage when
4219 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
4220 than STATIC_BUF_SIZE.
4222 2000-07-29 Jim Meyering <meyering@lucent.com>
4224 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
4225 * dirname.c (dir_name): Likewise.
4227 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
4229 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
4230 (dir_name): Assert that there are no trailing slashes.
4232 2000-07-18 Bruno Haible <haible@clisp.cons.org>
4234 * mbswidth.h (mbswidth): Add a flags argument.
4235 (mbswidth): New declaration.
4236 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
4237 * mbswidth.c (mbswidth): Add a flags argument.
4238 (mbsnwidth): New function.
4240 2000-07-24 Jim Meyering <meyering@lucent.com>
4242 * mbswidth.c: Remove useless #else. From Bruno Haible.
4244 2000-07-23 Paul Eggert <eggert@twinsun.com>
4246 * mbswidth.c (_XOPEN_SOURCE):
4247 Don't define; this causes problems on Solaris 7.
4248 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
4250 2000-07-23 Paul Eggert <eggert@twinsun.com>
4253 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
4254 so that mbstate_t is always defined.
4256 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
4257 be 1 in at least one GCC installation, and this configuration
4258 error is likely to be common. Ignoring MB_LEN_MAX hurts
4259 performance on hosts that have mbrtowc but have only unibyte
4260 locales, but I assume these hosts are rare.
4262 2000-07-23 Paul Eggert <eggert@twinsun.com>
4264 * quotearg.c: Streamline by invoking multibyte code only if needed.
4265 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
4266 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
4267 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
4268 invoke multibyte primitives.
4270 2000-07-23 Jim Meyering <meyering@lucent.com>
4272 * basename.c (base_name): Add an assertion.
4274 2000-07-15 Bruno Haible <clisp.cons.org>
4276 * quotearg.c: When the system forces us to redefine mbstate_t,
4277 shadow its mbsinit function.
4279 2000-07-16 Bruno Haible <haible@clisp.cons.org>
4281 * mbswidth.h: New file.
4282 * mbswidth.c: New file.
4283 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
4284 (noinst_HEADERS): Add mbswidth.h.
4286 2000-07-17 Bruno Haible <haible@clisp.cons.org>
4288 * config.charset: Add support for FreeBSD. Improve support for HP-UX
4291 2000-07-15 Jim Meyering <meyering@lucent.com>
4293 * makepath.c: Include quote.h.
4294 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
4295 corresponding argument in a `quote (...)' call.
4296 Give better diagnostics.
4298 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
4299 (noinst_HEADERS): Add quote.h.
4301 * quote.c (quote, quote_n): New file. Two functions taken verbatim
4302 from tar's src/misc.c.
4303 * quote.h: New file. Prototypes for same.
4305 2000-07-10 Paul Eggert <eggert@twinsun.com>
4307 From a suggestion by Bruno Haible.
4308 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
4309 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
4310 to decide whether to define the BeOS workaround macro;
4311 this adjusts to the change to AC_MBSTATE_T.
4313 2000-07-13 Paul Eggert <eggert@twinsun.com>
4315 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
4317 * quotearg.c (quoting_style_args, quoting_style_vals,
4318 quotearg_buffer_restyled): Add support for
4319 clocale_quoting_style. Undo previous change to
4320 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
4321 and "{RIGHT QUOTATION MARK}" msgids.
4323 2000-07-05 Paul Eggert <eggert@twinsun.com>
4325 The old behavior of quoting `like this' doesn't look good with
4326 newer, ISO-style fonts. See:
4327 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
4329 Instead, quote "like this" by default. Let the translator
4330 tailor the locale-specific quoting behavior by providing
4331 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
4333 * quotearg.c (N_): New macro.
4334 (gettext_default): New function.
4335 (quotearg_buffer_restyled): Use
4336 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
4337 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
4339 2000-07-09 Jim Meyering <meyering@lucent.com>
4341 * Most files: Update copyright dates to include 2000.
4343 2000-07-08 Jim Meyering <meyering@lucent.com>
4345 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
4347 (xgethostname): Remove now-unnecessary #ifdef.
4348 Move declaration of `err' into loop where it's used.
4350 2000-07-05 Bruno Haible <haible@clisp.cons.org>
4352 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
4353 by allocating a larger buffer. Test the gethostname return value for
4354 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
4355 returns an error and ENAMETOOLONG isn't defined.
4357 2000-07-05 Paul Eggert <eggert@twinsun.com>
4358 and Bruno Haible <haible@clisp.cons.org>
4360 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
4362 2000-07-05 Bruno Haible <haible@clisp.cons.org>
4364 * quotearg.c (struct quoting_options): Simplify quote_these_too
4367 2000-07-03 Jim Meyering <meyering@lucent.com>
4369 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
4370 Reported by Bruno Haible.
4372 2000-07-04 Jim Meyering <meyering@lucent.com>
4374 * quotearg.c: Make inclusion of <wchar.h> independent of whether
4375 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
4378 2000-07-03 Paul Eggert <eggert@twinsun.com>
4379 and Bruno Haible <haible@clisp.cons.org>
4381 * quotearg.c (mbrtowc):
4382 Assign to *pwc, and return 1 only if result is nonzero.
4383 (iswprint): Use ISPRINT when substituting our own mbrtowc.
4385 2000-07-03 Jim Meyering <meyering@lucent.com>
4387 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
4388 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
4391 2000-07-02 Jim Meyering <meyering@lucent.com>
4393 * quotearg.c (mbstate_t): Don't define here.
4395 2000-07-02 Jim Meyering <meyering@lucent.com>
4397 * nanosleep.c (SIGCONT): Define if not already defined.
4399 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4401 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
4402 per change in ../m4/ls-mntd-fs.m4.
4403 (read_filesystem_list): Ignore symbolic links.
4405 2000-06-29 Jim Meyering <meyering@lucent.com>
4407 * same.c: Include <string.h> or <strings.h>, as appropriate,
4408 for declaration of strcmp.
4410 * long-options.c: Include <stdlib.h>, for declaration of exit.
4412 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
4413 Avoid warning by casting result to `char *' to remove `const'.
4415 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4417 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
4419 2000-06-26 Paul Eggert <eggert@twinsun.com>
4421 savedir now sets errno on failure and invokes xmalloc to get memory.
4422 Fix a couple of other minor bugs while we're at it.
4424 * savedir.c (<unistd.h>): Do not include; there's no need.
4425 (NAMLEN): Remove macro.
4426 (malloc, realloc): Remove decls.
4428 ("xalloc.h"): Include.
4429 (NAME_SIZE_DEFAULT): New macro.
4430 (savedir): Use xmalloc / xrealloc to allocate memory.
4431 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
4432 Skip "" directory entries.
4433 Use strlen to calculate directory entry length, since the old method
4434 is rarely used these days and isn't worth supporting.
4435 Don't use a pointer after freeing it.
4436 Check for integer overflow when calculating allocation size.
4437 Use memcpy to copy entries, instead of stpcpy.
4438 Set errno properly when returning NULL.
4439 Check for readdir error.
4441 2000-06-26 Jim Meyering <meyering@lucent.com>
4443 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
4445 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4447 * getusershell.c (xmalloc, xrealloc): Remove functions.
4449 Don't include <stdlib.h>. Don't declare malloc, realloc.
4451 2000-06-23 Bruno Haible <haible@clisp.cons.org>
4453 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
4455 2000-06-24 Jim Meyering <meyering@lucent.com>
4457 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
4459 2000-06-21 Jim Meyering <meyering@lucent.com>
4461 * getpass.c: New file, from Bruno Haible. Required for BeOS.
4463 2000-06-19 Paul Eggert <eggert@twinsun.com>
4465 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
4466 (mbrtowc, mbstate_t): Define substitutes if
4467 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
4468 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
4469 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
4471 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4473 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
4474 than 1024, return a memory chunk of least possible size, instead
4475 of size PATH_MAX + 2. In the loop, increment the size proportionally.
4476 Use free/xmalloc instead of xrealloc to avoid copying for very long
4479 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4481 * canon-host.c (canon_host): Use malloc and memcpy to copy an
4482 address, not strdup. Include <stdlib.h> and don't declare free().
4484 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4486 * path-concat.c (path_concat): Don't access dir[-1] if dir is
4489 2000-06-21 Jim Meyering <meyering@lucent.com>
4491 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
4492 (noinst_HEADERS): Add getstr.h.
4494 * getline.c (getstr): Move into a separate file.
4495 * getstr.c (getstr): New file, extracted from getline.c, with
4496 the following changes: new parameter, delim2; both delim[12]
4497 parameters have type `int', not `char'. The latter would lose
4498 with 8-bit delimiters.
4499 * getstr.h: New file.
4501 2000-06-19 Jim Meyering <meyering@lucent.com>
4503 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
4505 2000-06-18 Jim Meyering <meyering@lucent.com>
4507 * mkdir.c: Remove file, due mainly to copyright incompatibility.
4508 Besides, these days every porting target provides a mkdir function.
4510 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
4511 (this snippet comes from src/system.h).
4513 2000-06-15 Paul Eggert <eggert@twinsun.com>
4515 * human.c (adjust_value): New function.
4516 (human_readable_inexact): Apply rounding style even when
4517 printing approximate values.
4519 2000-06-14 Paul Eggert <eggert@twinsun.com>
4521 * human.c (human_readable_inexact): Allow an input block
4522 size that is not a multiple of the output block size, and vice versa.
4523 Reported by Piergiorgio Sartor.
4525 2000-06-14 Paul Eggert <eggert@twinsun.com>
4527 * getdate.y (get_date): Apply relative times after time
4528 zone indicator, not before. Reported by Todd A. Jacobs.
4530 2000-06-13 Jim Meyering <meyering@lucent.com>
4532 * Makefile.am (all-local): Depend on lstat.c and stat.c.
4534 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
4536 2000-06-12 Paul Eggert <eggert@twinsun.com>
4538 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
4540 2000-06-04 Paul Eggert <eggert@twinsun.com>
4542 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
4544 2000-06-04 Jim Meyering <meyering@lucent.com>
4546 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
4547 SunOS 4.1.4 for which gid_t is an unsigned type.
4549 2000-06-03 Jim Meyering <meyering@lucent.com>
4551 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
4553 2000-05-26 Bruno Haible <haible@clisp.cons.org>
4555 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
4556 newer, don't install charset.alias.
4557 * config.charset: Change the Linux/glibc rules so they become empty
4558 on glibc-2.1 or newer.
4560 2000-06-02 Jim Meyering <meyering@lucent.com>
4562 * mountlist.c: Back out last change. Instead, do this...
4563 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
4564 member using the same `ignore'-testing code.
4565 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
4569 2000-05-29 Jim Meyering <meyering@lucent.com>
4571 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
4572 with the `ignore' attribute. Based on a patch from Mark D. Roth.
4574 2000-05-22 Jim Meyering <meyering@lucent.com>
4576 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
4578 2000-05-18 Jim Meyering <meyering@lucent.com>
4580 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
4581 back, too, since it may have been modified by allocate_entry.
4582 (hash_delete): Rewrite to use neither the assignment operator
4583 nor the comma operator in an if-expression.
4585 2000-05-15 Paul Eggert <eggert@twinsun.com>
4588 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
4589 Remove; no longer needed.
4590 "quotearg.h": Add include.
4591 (file_name): Do not bother to explicitly initialize to NULL; it's less
4592 efficient on some hosts.
4593 (close_stdout_status): Remove test as to whether stdout was already
4594 closed; it breaks for the case "echo x | sort >&-".
4595 Quote file name colons.
4596 Do not assume that _("write error") lacks format strings.
4598 2000-05-15 Jim Meyering <meyering@lucent.com>
4600 * version-etc.c (version_etc_copyright): Update the copyright string
4601 used in all --version output.
4603 2000-05-14 Jim Meyering <meyering@lucent.com>
4605 * closeout.c (close_stdout_set_file_name): New function.
4606 (close_stdout_status): Use new file-scoped global.
4607 Return right away if fstat says the stdout file descriptor is invalid.
4608 * closeout.h (close_stdout_set_file_name): Declare.
4610 2000-05-10 Jim Meyering <meyering@lucent.com>
4612 * closeout.c [default_exit_status]: New file-scoped variable.
4613 (close_stdout_set_status): New function.
4614 * closeout.h (close_stdout_set_status): Declare.
4616 2000-05-08 Jim Meyering <meyering@lucent.com>
4618 * long-options.c: Don't include closeout.h.
4619 (parse_long_options): Don't call close_stdout for --version.
4621 2000-05-06 Jim Meyering <meyering@lucent.com>
4623 * strnlen.c: Undefine __strnlen and strnlen.
4624 [!weak_alias]: Define __strnlen to strnlen.
4626 * atexit.c: New file, from libiberty.
4628 2000-05-06 Jim Meyering <meyering@lucent.com>
4630 * closeout.c (close_stdout_status): Also check for errors on the
4633 2000-05-05 Bruno Haible <haible@clisp.cons.org>
4635 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
4636 instead of xmalloc, xrealloc, path_concat.
4637 (locale_charset): Treat empty environment variables as absent.
4638 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
4640 2000-05-04 Jim Meyering <meyering@lucent.com>
4642 * getopt.c: Update from glibc.
4643 * obstack.c: Likewise.
4644 * obstack.h: Likewise.
4645 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
4647 * regex.h: Likewise.
4648 * strndup.c: Likewise.
4649 * strnlen.c: New file, from glibc.
4651 2000-05-01 Jim Meyering <meyering@lucent.com>
4653 * full-write.c (full_write): Remove `FIXME' part of comment.
4655 2000-04-29 Jim Meyering <meyering@lucent.com>
4657 * path-concat.c: Declare strdup only if it's not defined.
4658 * canon-host.c: Likewise.
4660 2000-04-28 Jim Meyering <meyering@lucent.com>
4662 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
4663 redefinition warning on some systems (HPUX). Otherwise, regex.h is
4664 included first, then limits.h is included by locale.h by libintl.h.
4665 From John David Anglin.
4667 2000-04-25 Jim Meyering <meyering@lucent.com>
4669 * makepath.c (S_IRWXUGO): Define.
4670 (make_path): Always perform explicit chmod if MODE specifies any
4671 of the `special' permission bits. Prompted by a bug report against
4672 install from Mate Wierdl and Joost van Baal.
4674 2000-04-18 Jim Meyering <meyering@lucent.com>
4678 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
4679 getpagesize. For BeOS. Based on a patch from Bruno Haible.
4681 2000-04-17 Jim Meyering <meyering@lucent.com>
4683 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
4684 the definition of it to rpl_strftime also defined-away the system's
4687 2000-04-15 Jim Meyering <meyering@lucent.com>
4689 Use `C' to denote so-called `contiguous' files, the same way
4691 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
4692 (ftypelet): Use S_ISCTG.
4693 From Michael Deutschmann.
4695 2000-04-14 Jim Meyering <meyering@lucent.com>
4697 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
4699 2000-04-08 Jim Meyering <meyering@lucent.com>
4701 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
4702 names don't conflict. Reported by Eli Zaretskii.
4704 2000-03-28 Bruno Haible <haible@clisp.cons.org>
4706 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
4707 bug. Deal with the different error behavior of Irix iconv.
4709 2000-04-07 Jim Meyering <meyering@lucent.com>
4711 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
4712 to work around system header problems on AIX 3.2.5. From Bruno Haible.
4714 2000-04-05 Jim Meyering <meyering@lucent.com>
4716 Portability tweaks required for ultrix4.3.
4717 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
4718 * readutmp.c: Include sys/types.h before sys/stat.h.
4719 * canon-host.c: Declare strdup.
4720 * path-concat.c: Likewise.
4721 From John David Anglin.
4723 2000-04-04 Jim Meyering <meyering@lucent.com>
4725 Be more DOS 8.3-friendly.
4726 * ref-add.sin: Renamed from ref-add.sed.in.
4727 * ref-del.sin: Renamed from ref-del.sed.in.
4728 * Makefile.am: Reflect renaming.
4729 Reported by Eli Zaretskii.
4731 Use a temporary file name that won't clash with `charset.alias'
4732 in the DOS 8.3 name space.
4733 * Makefile.am (charset_tmp): Define.
4734 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
4735 (uninstall-local): Likewise.
4736 Reported by Eli Zaretskii.
4738 2000-03-29 Paul Eggert <eggert@twinsun.com>
4740 * time/strftime.c (my_strftime): Make sure we call the system
4741 strftime, not ourselves, when invoking the underlying strftime.
4743 2000-03-24 Jim Meyering <meyering@lucent.com>
4745 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
4746 (charset_alias): Define.
4747 (install-exec-local): Factor out common code.
4748 (uninstall-local): Split lines longer than 80.
4749 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
4751 (.sed.in.sed): New rule. Don't redirect directly to $@.
4752 (CLEANFILES): Add ref-add.sed and ref-del.sed.
4754 2000-03-19 Bruno Haible <haible@clisp.cons.org>
4756 * config.charset: Output a line containing "Packages using this file".
4757 * ref-add.sed.in, ref-del.sed.in: New files.
4758 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
4759 ref-del.sed): New rules.
4761 2000-03-17 Jim Meyering <meyering@lucent.com>
4763 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
4764 Otherwise, include <strings.h>
4766 2000-03-17 Bruno Haible <haible@clisp.cons.org>
4768 * unicodeio.c (utf8_wctomb): New function.
4769 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
4770 format instead of in UCS-4 with platform dependent endianness.
4772 2000-03-07 Paul Eggert <eggert@twinsun.com>
4774 * savedir.c (savedir): Work even if directory size is
4775 negative; this can happen with some screwy NFS configurations.
4777 2000-03-06 Jim Meyering <meyering@lucent.com>
4779 * localcharset.c (get_charset_aliases): Don't try to free file_name
4780 if it's NULL (because we ran out of memory). From Bruno Haible.
4782 2000-03-05 Jim Meyering <meyering@lucent.com>
4784 * localcharset.c ("path-concat.h"): Include.
4785 (get_charset_aliases): Use path_concat instead of ANSI string
4788 * unicodeio.h (PARAMS): Define.
4789 Use it to guard prototype.
4791 2000-03-04 Jim Meyering <meyering@lucent.com>
4793 * Makefile.am (install-exec-local): Create $(libdir) before installing
4795 (uninstall-local): Uncomment this rule so `make distcheck' works
4798 * unicodeio.c (<errno.h>): Include it.
4799 (errno): Declare if not defined.
4801 * localcharset.c: Add Bruno's comment justifying use of volatile.
4803 * config.charset: New version, incorporating remarks from a linux
4804 i18n mailing list. From Bruno Haible.
4806 2000-03-02 Jim Meyering <meyering@lucent.com>
4808 * Makefile.am (EXTRA_DIST): Add config.charset.
4810 2000-03-01 Jim Meyering <meyering@lucent.com>
4812 * localcharset.c: Guard some #includes with `#if HAVE_...'.
4813 * unicodeio.c: Likewise.
4815 2000-02-02 Bruno Haible <haible@clisp.cons.org>
4817 * config.charset: New file.
4818 * localcharset.c: New file.
4819 * unicodeio.h, unicodeio.c: New files.
4820 * Makefile.am (DEFS): Add -DLIBDIR=...
4821 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
4822 (noinst_HEADERS): Add unicodeio.h.
4823 (all-local, install-exec-local, charset.alias): New targets.
4825 2000-02-28 Paul Eggert <eggert@twinsun.com>
4827 * quotearg.c (ALERT_CHAR): New macro.
4828 (quotearg_buffer_restyled): Use it.
4830 2000-02-27 Jim Meyering <meyering@lucent.com>
4832 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
4833 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
4835 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
4836 not `#if STDC_HEADERS'.
4837 Declare malloc if needed.
4839 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
4840 now that autoconf always defines the HAVE_DECL_ symbols.
4841 * human.c: Likewise.
4843 * strtoumax.c: Likewise.
4845 * backupfile.c: Arrange for cpp to fail if the configure-time
4846 declaration check was not run.
4848 * human.c: Likewise.
4850 * strtoumax.c: Likewise.
4852 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
4853 then first look up the entire `.'-containing string as a login name.
4855 2000-02-18 Paul Eggert <eggert@twinsun.com>
4857 * getdate.y: Handle two-digit years with leading zeros correctly.
4858 (textint): New typedef.
4859 (parser_control): Member year changed from int to textint.
4861 (YYSTYPE): Removed; replaced by %union with int and textint members.
4862 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
4863 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
4864 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
4865 (tSNUMBER, tUNUMBER): Now of type <textintval>.
4866 (date, number, to_year): Use width of number in digits, not its value,
4867 to determine whether it's a 2-digit year, or a 2-digit time.
4868 (yylex): Store number of digits of numeric tokens.
4869 Reported by John Kendall.
4871 (parser_control): Changed from struct parser_control to typedef (for
4872 consistency). All uses changed.
4874 (tID): Removed; not used.
4875 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
4877 2000-02-14 Paul Eggert <eggert@twinsun.com>
4879 * getpagesize.h (getpagesize): Port to VMS for Alpha;
4880 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
4882 2000-02-12 Jim Meyering <meyering@lucent.com>
4884 * userspec.c (ISDIGIT): Define it.
4885 (isdigit): Remove definition.
4886 (is_number): Use ISDIGIT, not isdigit.
4887 <libintl.h>: Include.
4889 (parse_user_spec): Mark translatable strings.
4891 2000-02-10 Jim Meyering <meyering@lucent.com>
4893 With these changes, nanosleep.[ch] are finally enough like the other
4894 lib/* replacement files to compile on a few more losing systems.
4896 * nanosleep.h: Don't include config.h.
4897 Remove prototype from declaration of nanosleep.
4898 (PARAMS): Remove now-unneeded definition.
4899 * nanosleep.c: #undef nanosleep.
4900 (rpl_nanosleep): Rename from nanosleep.
4902 2000-02-03 Jim Meyering <meyering@lucent.com>
4904 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
4905 rather than with `#if HAVE_UTMPNAME'.
4907 2000-02-01 Jim Meyering <meyering@lucent.com>
4909 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
4911 2000-01-31 Jim Meyering <meyering@lucent.com>
4913 * nanosleep.h (nanosleep): Guard declaration with
4914 `#if ! HAVE_DECL_NANOSLEEP'.
4915 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
4916 the declaration in that vendor's sys/timers.h.
4917 Reported by Christian Krackowizer.
4919 * quotearg.c (ISASCII): Add #undef and move definition to follow
4920 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
4921 (ISPRINT): Likewise.
4922 Reported by Tom Tromey.
4924 2000-01-30 Jim Meyering <meyering@lucent.com>
4926 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
4927 uses of ->ut_name. The latter doesn't work with new Linux header files
4928 where only utmpx.ut_user is declared.
4930 * readutmp.h (UT_USER): Define.
4932 2000-01-23 Jim Meyering <meyering@lucent.com>
4934 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
4937 2000-01-22 Jim Meyering <meyering@lucent.com>
4939 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
4940 [! HAVE_DECL_STRTOULL]: Declare strtoull.
4941 Required for some AIX systems. Reported by Christian Krackowizer.
4942 [TESTING] (main): New function.
4944 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
4945 * dirname.c (dir_name): Support for DOS-style file names with drive
4948 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
4950 * strverscmp.c (ISDIGIT): Define.
4951 (strverscmp): Use ISDIGIT, not isdigit.
4953 2000-01-17 Paul Eggert <eggert@twinsun.com>
4955 * nanosleep.c (nanosleep):
4956 Don't use SA_INTERRUPT to decide whether to call sigaction, as
4957 POSIX.1 doesn't require SA_INTERRUPT and some systems
4958 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
4959 it's been part of POSIX.1 since day 1 (in 1988).
4961 2000-01-17 Jim Meyering <meyering@lucent.com>
4963 * interlock: Remove unused file. Reported by François Pinard.
4965 2000-01-16 Paul Eggert <eggert@twinsun.com>
4967 * quotearg.c (quotearg_buffer_restyled): Do not quote
4968 alert, backslash, formfeed, and vertical tab unnecessarily in
4969 shell quoting style.
4972 version-control: never