1 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
6 (ENOSYS): Define if not defined.
7 (settime): Fall back on stime if it exists and settimeofday fails.
8 But don't bother with fallbacks if a method fails with errno == EPERM.
10 2004-05-11 Jim Meyering <jim@meyering.net>
12 Prior to this change, the save_cwd caller required read access to the
13 current directory on most systems (ones with the fchdir function).
15 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
16 fails, try write-only, and finally, resort to using xgetcwd.
18 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
20 * obstack.c, obstack.h: Import changes from libc.
22 2004-04-28 Bruno Haible <bruno@clisp.org>
24 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
25 implicitly appends .exe to executables.
26 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
27 accepts Windows pathnames.
28 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
29 Cygwin like Windows, since it now accepts Windows pathnames.
30 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
31 Cygwin like Windows, since it now accepts Windows pathnames.
32 Reported by Derek Robert Price <derek@ximbiot.com>.
34 2004-04-20 Jim Meyering <jim@meyering.net>
36 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
38 2004-04-20 Jim Meyering <jim@meyering.net>
39 Bruno Haible <bruno@clisp.org>
41 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
42 memory when realloc fails.
44 2004-04-18 Jim Meyering <jim@meyering.net>
46 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
47 don't leak memory and do call END_UTMP_ENT.
49 2004-04-11 Paul Eggert <eggert@twinsun.com>
51 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
52 (CHAR_BIT): Remove, since we assume C89.
53 Include <stdint.h> if available, as per current Autoconf CVS advice.
55 2004-03-30 Paul Eggert <eggert@twinsun.com>
57 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
58 not bool, to be more consistent with Unix conventions.
59 Suggested by Bruno Haible.
63 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
66 * getdate.h: Include stdbool.h, and timespec.h instead of
67 the usual <time.h> dance.
68 (get_date): Change signature to support fractional time stamps.
70 * getdate.y: Include "getdate.h" first, as we can now
71 assume C89 and don't need to worry about 'const'.
72 Similarly, include "unlocked-io.h" near start, not in middle.
74 (textint.value): Use long int rather than int.
75 (textint.digits): Use size_t rather than int.
76 (BILLION, LOG10_BILLION): New constants.
77 (parser_control): New member rel_ns. Members day_ordinal,
78 time_zone, month, day, hour, minutes, rel_year, rel_month,
79 rel_day, rel_hour, rel_minutes, rel_seconds
80 are now long int, not int. Member seconds is now struct timespec,
81 not int. New member timespec_seen. Members dates_seen, days_seen,
82 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
84 (%union.intval): Now long int, not int.
86 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
87 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
88 (spec): Now is a timespec or an item list.
89 (timespec, items): New nonterminals.
90 (time, rel, relunit, number, get_date):
91 Add support for fractional seconds.
92 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
93 (gmtime, localtime, mktime): Remove decls; not needed with C89.
94 (to_hour): First arg is now long int, not int.
95 (to_year): Returns long int, not int.
96 Don't treat year -70 like 70.
97 (tm_diff): Returns long int, not int.
98 (lookup_word): Use bool instead of int when appropriate.
99 (yylex): Use size_t for count, not int.
100 Detect overflow when parsing large integer constants.
101 Add support for fractions.
102 (get_date): Make pointers 'const' if possible.
103 Use more-portable code to detect integer overflow.
104 (main) [TEST]: Adjust to above changes. Test for localtime failure.
105 Don't use ctime; it's not reliable if the year has >4 digits.
107 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
108 This is for compatibility with BSD.
110 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
111 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
112 From coreutils' system.h.
114 * userspec.c: Don't include "posixver.h".
115 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
116 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
117 compatible extension. Simplify code by removing a boolean int
118 that was always nonzero if a string was nonnull.
120 2004-03-30 Jim Meyering <jim@meyering.net>
122 Merge from coreutils.
124 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
126 * readtokens.c (readtoken): Don't leak 64 bytes when reading
127 an empty input stream.
129 * readtokens.c: Include <stdbool.h>.
130 (readtoken): Use `size_t' rather than int/long.
131 All callers adjusted.
132 Use `bool' rather than `int' where appropriate.
133 Use memset rather than an explicit loop.
134 Use x2nrealloc rather than xrealloc.
135 Allow the use of `\0' as a delimiter.
136 (readtokens): Likewise.
137 * readtokens.h (readtoken, readtokens): Update prototypes.
139 2004-03-30 Bruno Haible <bruno@clisp.org>
141 * getloadavg.c (getloadavg): Don't assume setlocale returns
144 2004-03-29 Paul Eggert <eggert@twinsun.com>
146 Merge changes to getloadavg.c from coreutils and Emacs.
148 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
149 Define to an expression, not to the empty string.
150 Include cloexec.h and xalloc.h.
151 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
152 Use set_cloexec_flag rather than rolling our own.
153 * cloexec.c, cloexec.h: New files.
155 2004-03-18 Paul Eggert <eggert@twinsun.com>
157 * getopt.h: Sync with libc CVS.
159 2004-03-18 Paul Eggert <eggert@twinsun.com>
160 Bruno Haible <bruno@clisp.org>
162 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
163 not on all platforms that have <wchar.h>.
164 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
166 2004-03-09 Paul Eggert <eggert@twinsun.com>
168 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
170 * getopt_int.h: New file, also synced from libc.
172 2004-03-07 Paul Eggert <eggert@twinsun.com>
174 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
175 '#if' expressions. Unlike the code it replaces, it does not
176 depend on (defined _SC_PAGESIZE). However, it does depend on
177 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
178 first reported by Jason Andrade in
179 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
181 2004-01-18 Simon Josefsson <jas@extundo.com>
183 * strdup.h: New file.
184 * strdup.c: Include it.
185 * path-concat.c: Include strdup.h. Drop strdup declaration.
186 * userspec.c: Include strdup.h. Drop strdup declaration.
188 2004-02-06 Karl Berry <karl@gnu.org>
190 * config.charset: update from gettext 0.14.1.
192 2004-02-05 Paul Eggert <eggert@twinsun.com>
194 Add comments and code, prompted by suggestions from Bruno Haible
196 * quotearg.h (quotearg_alloc): New decl. Improve the comments
197 describing the enum quoting_style values.
198 * quotearg.c (quotearg_alloc): New function.
199 (quotearg_buffer_restyled): Treat lone { and } as special.
200 Treat = as special. Work around bug with older shells
201 that "see" a '\' that is really the 2nd byte of a multibyte char.
202 Quote empty string with shell_quoting_style.
204 2004-02-03 Bruno Haible <bruno@clisp.org>
206 * pipe.h: New file, from GNU gettext.
207 * pipe.c: New file, from GNU gettext.
209 2004-01-27 Bruno Haible <bruno@clisp.org>
211 * execute.h: New file, from GNU gettext.
212 * execute.c: New file, from GNU gettext.
213 * w32spawn.h: New file, from GNU gettext.
215 2004-01-23 Paul Eggert <eggert@twinsun.com>
217 Exit-status fix from coreutils.
219 Use exit_failure consistently in place of EXIT_FAILURE,
220 so that program exit statuses are consistent on failure.
222 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
223 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
224 * argmatch.h: Comment fix to match the above.
225 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
226 Now a macro referring to exit_failure, instead of a separate
227 variable. Include "exitfail.h" to get it.
228 * xstrtol.h: Include "exitfail.h".
229 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
231 * long-options.c (parse_long_options): Use prototype
232 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
235 2004-01-21 Jim Meyering <jim@meyering.net>
237 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
238 so as not to conflict with a different-sized __mktime_internal
239 function in GNU libc.
240 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
241 Problem building statically-linked `ls' reported by Michael Brunnbauer.
243 2004-01-18 Paul Eggert <eggert@twinsun.com>
245 Merge from diffutils.
247 * file-type.c (file_type): Add typed memory objects.
248 * file-type.h (S_TYPEISTMO): New macro.
250 * c-stack.h (c_stack_action): Remove argv argument.
251 * c-stack.c (c_stack_action): Likewise. All uses changed.
252 (die): Don't calculate message unless segv_action returns.
253 (get_stack_location, min_address_from_argv, max_address_from_argv,
254 volatile stack_base, volatile_stack_size): Remove.
255 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
256 that every segmentation violation is a stack overflow. (Ouch!)
257 See Debian bug 136249 (still outstanding) for more info about why
258 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
260 2003-11-30 Bruno Haible <bruno@clisp.org>
262 Safer stack allocation.
263 * setenv.c: Include allocsa.h.
264 (alloca): Remove fallback definition.
265 (freea): Remove macro.
266 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
269 2003-10-17 Bruno Haible <bruno@clisp.org>
271 * binary-io.h: Avoid warnings on Cygwin.
273 2003-12-28 Bruno Haible <bruno@clisp.org>
275 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
276 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
278 2003-11-28 Bruno Haible <bruno@clisp.org>
280 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
282 2003-11-27 Bruno Haible <bruno@clisp.org>
284 * wait-process.c: On Windows, include windows.h. Needed on mingw.
286 2003-11-17 Bruno Haible <bruno@clisp.org>
288 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
290 2003-11-24 Bruno Haible <bruno@clisp.org>
292 * xallocsa.h: New file, from GNU gettext.
293 * xallocsa.c: New file, from GNU gettext.
295 2003-11-24 Bruno Haible <bruno@clisp.org>
297 * allocsa.h: New file, from GNU gettext.
298 * allocsa.c: New file, from GNU gettext.
300 2003-11-24 Bruno Haible <bruno@clisp.org>
302 * eealloc.h: New file.
304 2004-01-15 Jim Meyering <jim@meyering.net>
306 Merge from coreutils.
308 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
309 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
310 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
312 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
313 optional configure-time default.
315 * version-etc.c (version_etc_copyright): Update copyright date.
317 * xreadlink.c (xreadlink): Correct outdated comment.
319 2004-01-15 Paul Eggert <eggert@twinsun.com>
321 Merge from coreutils.
323 * posixver.c: Include posixver.h.
325 * same.c: Include <stdbool.h>, <limits.h>.
326 (_POSIX_NAME_MAX): Define if not defined.
328 (same_name): If file names are silently truncated, report
329 that the file names are the same if they are the same after
330 the silent truncation.
332 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
334 * xstrtod.c (xstrtod): Likewise. All callers changed to
335 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
338 2004-01-14 Paul Eggert <eggert@twinsun.com>
340 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
341 with like-named macro in fnmatch.c.
342 (EXT): Use an internal constant instead.
344 Merge fnmatch patches from glibc.
345 * fnmatch.c (mbsinit): Remove define.
346 Add libc_hidden_ver (__fnmatch, fnmatch).
347 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
348 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
350 2003-12-14 Karl Berry <karl@gnu.org>
352 * config.charset: update from gettext-runtime.
354 2003-12-03 Paul Eggert <eggert@twinsun.com>
356 * getgroups.c (getgroups): xmalloc takes one argument, not two.
357 Bug reported by Alfred M. Szmidt.
359 2003-11-29 Karl Berry <karl@gnu.org>
361 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
363 2003-11-23 Paul Eggert <eggert@twinsun.com>
364 Bruno Haible <bruno@clisp.org>
366 * printf-parse.h: Don't include sys/types.h.
367 (ARG_NONE): New macro.
368 (char_directive): Change type of *arg_index fields to size_t.
369 * printf-parse.c: Don't include sys/types.h.
370 (SSIZE_MAX): Remove macro.
371 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
372 Remove unnecessary overflow check.
373 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
376 2003-11-24 Paul Eggert <eggert@twinsun.com>
378 * alloca.c: Remove dependency on xalloc module.
379 (xalloc_die): Remove.
380 (memory_full) [!defined emacs]: New macro.
381 [!defined emacs]: Don't include xalloc.h.
382 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
383 address arithmetic overflows. Change datatypes a bit to avoid
386 2003-11-22 Jim Meyering <jim@meyering.net>
388 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
390 2003-11-17 Bruno Haible <bruno@clisp.org>
392 * vasnprintf.c (alloca): Remove fallback definition.
393 (freea): Remove definition.
394 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
395 Reported by Paul Eggert.
397 2003-11-17 Jim Meyering <jim@meyering.net>
399 On systems without utime and without a utimes function capable of
400 dealing with a NULL struct utimbuf* argument, this utime replacement
401 could -- in unusual circumstances -- leak a file descriptor.
402 * utime.c: Include <unistd.h> and <errno.h>.
403 (utime_null): Be sure to close `fd' and to preserve errno.
404 Reported by Geoff Collyer via Arnold Robbins.
406 2003-11-16 Paul Eggert <eggert@twinsun.com>
407 Bruno Haible <bruno@clisp.org>
409 Protect against address arithmetic overflow.
410 * printf-args.h: Include stddef.h.
411 (arguments): Change type of field 'count' to size_t.
412 * printf-args.c (printf_fetchargs): Use size_t instead of
413 'unsigned int' where appropriate.
414 * printf-parse.h: Include sys/types.h.
415 (char_directive): Change type of *arg_index fields to ssize_t.
416 (char_directives): Change type of fields 'count', max_*_length to
418 * printf-parse.c: Include sys/types.h and xsize.h.
419 (SSIZE_MAX): Define fallback value.
420 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
421 instead of 'int' where appropriate. Check a_allocated, d_allocated
422 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
423 * vasnprintf.c: Include xsize.h.
424 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
425 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
426 overflow. Avoid wraparound when converting a width or precision from
429 2003-11-16 Bruno Haible <bruno@clisp.org>
431 Update from GNU gettext.
432 * printf-parse.c: Generalize to it can be compiled for wide strings.
433 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
434 * vasnprintf.c: Generalize to it can be compiled for wide strings.
435 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
436 SNPRINTF): New macros.
437 Don't include <alloca.h> if the file is used inside libintl.
438 (local_wcslen): New function, for Solaris 2.5.1.
439 (VASNPRINTF): Use it instead of wcslen.
441 2003-11-16 Bruno Haible <bruno@clisp.org>
443 * xsize.h (xmax): New function.
444 (xsum, xsum3, xsum4): Declare as "pure" functions.
446 2003-11-12 Paul Eggert <eggert@twinsun.com>
448 * xalloc.h: Do not include <limits.h> or <stdint.h>.
449 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
450 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
451 heuristic is just as accurate as far as we know, and it removes a
452 dependency on size_max.m4 and ptrdiff_max.m4.
454 2003-11-12 Paul Eggert <eggert@twinsun.com>
456 * xstrtol.c (__xstrtol): Remove "break" immediately after
457 "return", to pacify some unknown compiler. Problem reported
460 2003-11-11 Bruno Haible <bruno@clisp.org>
462 * xsize.h (SIZE_MAX): Remove fallback definition.
463 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
466 2003-11-10 Paul Eggert <eggert@twinsun.com>
468 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
469 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
470 rejected some allocations of exactly SIZE_MAX - 2 bytes.
472 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
473 not (size_t) -1, since it's defined here.
475 2003-11-06 Paul Eggert <eggert@twinsun.com>
477 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
478 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
479 Reject sizes of exactly SIZE_MAX bytes.
480 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
481 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
483 2003-11-05 Bruno Haible <bruno@clisp.org>
485 * xsize.h: Include limits.h, to avoid a possible collision with
486 SIZE_MAX defined in <limits.h> on Solaris.
488 2003-11-04 Bruno Haible <bruno@clisp.org>
491 * linebreak.c: Include xsize.h.
492 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
493 argument for overflow.
494 Suggested by Paul Eggert.
496 2003-10-31 Bruno Haible <bruno@clisp.org>
498 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
499 to avoid (extremely rare) race condition.
500 Suggested by Paul Eggert.
502 2003-11-03 Jim Meyering <jim@meyering.net>
504 * userspec.c: Include "userspec.h".
505 * userspec.h: New file.
507 2003-10-31 Paul Eggert <eggert@twinsun.com>
509 * mountlist.h (struct mount_entry.me_type_malloced): New member.
510 * mountlist.c (SIZE_MAX): Define if not defined already.
511 (read_filesystem_list): Set and use me_type_malloced.
512 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
513 whatever the type happens to be), for brevity and consistency.
514 Check for size calculation overflow on Alphas running OSF/1.
516 2003-10-31 Jim Meyering <jim@meyering.net>
518 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
520 * linebuffer.c: Include <string.h> for declaration of memset.
522 2003-10-30 Paul Eggert <eggert@twinsun.com>
523 Bruno Haible <bruno@clisp.org>
525 * vasprintf.c: Include <limits.h>, <stdlib.h>.
526 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
528 2003-10-29 Paul Eggert <eggert@twinsun.com>
530 * xalloc.h (xalloc_oversized): Now a macro, not a function,
531 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
533 * quotearg.c (quotearg_n_options): Use it.
534 * group-member.c: Include <stdbool.h>.
535 (free_group_info): Arg is now const *; don't free arg.
536 (get_group_info): Now returns bool and accepts struct group_info *,
537 rather than returning a malloc'ed struct group_info *.
538 All uses changed. Check for overflow in internal size calculation.
540 * getusershell.c (readname): Simplify the code by using x2nrealloc
541 rather than xmalloc/xrealloc.
542 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
543 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
544 conformance bug: the old code used a pointer after freeing the
545 storage that it addressed.
546 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
547 rather than doing it by hand.
548 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
549 the buffer preserved. Use free and xmalloc instead.
550 * quotearg.c (quotearg_n_options): Likewise.
551 Use a simpler test for size overflow. Don't use xalloc_oversized
552 because unsigned int might be wider than size_t (!); this suggests
553 that we should switch from unsigned int to size_t for slot numbers.
555 2003-10-27 Bruno Haible <bruno@clisp.org>
557 * stdbool_.h: Better support for BeOS.
559 2003-10-27 Paul Eggert <eggert@twinsun.com>
561 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
562 to allocate the returned structure. Do not allocate a subarray,
563 as x2nrealloc will do that.
564 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
565 instead of xnrealloc.
566 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
568 2003-10-26 Paul Eggert <eggert@twinsun.com>
570 * xalloc.h (xalloc_oversized): New static inline function, for
571 callers that want to do their own size-overflow checking. Include
572 <stdbool.h>, since xalloc_oversized returns bool.
573 * xalloc.c (array_size_overflow): Remove. All callers changed
574 to use xalloc_oversized.
576 Add two functions x2realloc, x2nrealloc, for programs that grow
577 arrays dynamically by doubling their sizes.
578 * xalloc.h (x2realloc, x2nrealloc): New decls.
579 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
582 Port to C99 semantics for 'inline' of external functions.
583 Bug reported by Bruno Haible.
584 * xmalloc.c (xnmalloc_inline): New static inline function,
585 with the old contents of xnmalloc.
586 (xnmalloc, xmalloc): Use it.
587 (xnrealloc_inline): New static inline function,
588 with the old contents of xnrealloc.
589 (xnrealloc, xrealloc): Use it.
591 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
593 2003-10-25 Paul Eggert <eggert@twinsun.com>
595 Fix several address-calculation bugs in the hash modules,
596 plus some minor code cleanup.
598 * hash.h: Include <stdbool.h>, for bool.
599 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
600 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
601 hash_get_n_entries, hash_get_max_bucket_length,
602 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
603 hash_rehash): Use size_t rather than unsigned.
604 * hash.c (struct hash_table, hash_get_n_buckets,
605 hash_get_n_buckets_used, hash_get_n_entries,
606 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
607 hash_get_entries, hash_do_for_each, hash_string, is_prime,
608 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
610 (SIZE_MAX): Define if not defined.
611 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
612 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
614 Use const * when possible.
615 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
616 (check_tuning): Fix bug: if tuning parameters were very close to
617 0 or 1, rounding errors could have caused subscript violations.
618 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
619 (hash_initialize): Add 'fail:' label
620 to free table and return NULL, and use it to simplify code.
621 Use calloc rather than clearing the storage ourself.
622 (hash_initialize, hash_rehash): Check for arithmetic overflow in
623 buffer size calculations.
624 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
625 Include <stddef.h>, for size_t.
626 * hash-pjw.c (hash_pjw): Likewise.
627 Switch to method described by Bruno Haible.
628 Include <limits.h>, for CHAR_BIT.
629 (SIZE_BITS): New macro.
631 2003-10-21 Paul Eggert <eggert@twinsun.com>
633 * getndelim2.c (getndelim2): When size calculation overflows,
634 ceiling the allocation at NMAX bytes rather than silently
635 discarding input bytes before NMAX is reached. This makes
636 a difference only if NMAX exceeds SIZE_MAX / 2.
638 * obstack.c: Merge from glibc.
639 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
640 Add libc_hidden_def (_obstack_newchunk).
641 (_obstack_free) [! defined _LIBC]: Remove.
642 [defined _LIBC]: Make a strong alias from obstack_free, rather than
643 a clone of the function body.
644 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
645 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
647 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
648 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
651 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
652 (obstack_ptr_grow_fast, obstack_int_grow_fast):
653 Don't use lvalue casts, as GCC plans to remove support for them
654 in GCC 3.5. Reported by Joseph S. Myers. This bug
655 was also present in the non-GCC version, indicating that this
656 code had always been buggy and had never been widely used.
657 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
658 Use the fast variant of each macro, rather than copying the
659 definiens of the fast variant; that way, we'll be more likely to
660 catch future bugs in the fast variants.
662 2003-10-20 Bruno Haible <bruno@clisp.org>
664 * wait-process.h: New file, from GNU gettext.
665 * wait-process.c: New file, from GNU gettext.
667 2003-10-19 Jim Meyering <jim@meyering.net>
669 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
671 2003-10-16 Paul Eggert <eggert@twinsun.com>
673 * getgroups.c: Include <errno.h>, <stdlib.h>.
674 (getgroups): First arg is int, not size_t.
675 Don't let 'free' mangle errno.
677 2003-10-16 Jim Meyering <jim@meyering.net>
679 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
681 2003-10-15 Paul Eggert <eggert@twinsun.com>
683 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
685 (new_exclude, add_exclude_file): Initial size no longer needs to
687 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
688 our own address arithmetic overflow checking.
690 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
691 (fnmatch): Do not alloca more than 2000 wide characters;
692 instead, use malloc for large buffers.
693 Check for address arithmetic overflow, and return -1
694 with errno set to ENOMEM in that case.
695 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
696 (NEW_PATTERN): Do not alloca more than 8000 bytes;
697 instead, return -1. Check for address arithmetic overflow.
699 2003-10-14 Paul Eggert <eggert@twinsun.com>
701 Handle invalid suffixes and overflow independently, so that
702 callers can treat them independently as needed. Fix some bugs in
703 suffix handling, e.g., "100k@" was not diagnosed as an invalid
704 suffix for a human-readable blocksize. The major caller-visible
705 change is the addition of a new
706 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
707 that both overflow and suffix chars were found.
709 * human.c (humblock): Don't check separately for invalid suffix
710 char; that is xstrtoumax's job (now that its bug is fixed).
711 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
712 INTMAX_MAX]: New macros.
713 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
714 TYPE_MAXIMUM): New macros.
715 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
716 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
717 if overflow occurs, as it's what __strtol does and it's more useful
719 (__xstrtol): If __strtol reports some error other than ERANGE,
720 reflect it to the caller as LONGINT_INVALID. If it reports
721 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
722 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
723 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
725 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
726 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
727 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
728 [defined UINTMAX_MAX]: New macros.
730 2003-10-14 Bruno Haible <bruno@clisp.org>
732 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
733 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
734 Also use volatile where needed.
736 2003-10-12 Paul Eggert <eggert@twinsun.com>
738 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
739 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
740 and define in terms of the other primitives.
741 * xmalloc.c: Include stdbool.h; do not include exit.h.
742 (SIZE_MAX): Define if not already defined.
743 (array_size_overflow): New function.
744 (xalloc_die): Abort instead of exiting if 'error' returns.
745 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
746 (xmalloc, xrealloc): Use them.
747 (xcalloc): Check for address arithmetic overflow.
748 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
749 a bit faster than strcpy.
751 2003-10-08 Paul Eggert <eggert@twinsun.com>
753 Merge getpass from libc, plus a few fixes.
755 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
757 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
758 __fsetlocking to empty.
759 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
760 do include <bits/libc-lock.h>.
761 Do not include <fcntl.h>; not needed.
762 [_LIBC]: Include <wchar.h>.
763 (NOTCANCEL_MODE): New macro.
764 (flockfile, funlockfile) [_LIBC]: New macros.
765 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
766 [!_LIBC]: New macros.
767 (call_fclose): New function.
768 (getpass): Use it. Save tty stream separately; this simplifies the
769 code and makes it more reliable if stdin happens to equal stdout.
770 Invoke __fsetlocking on tty.
771 Handle thread cancellation if needed.
772 Namespace cleanup (use __tcgetattr, __getline).
773 Use bool for Booleans.
774 [USE_IN_LIBIO]: Handle wide streams.
775 [!_LIBC]: Unconditionally do the fseek, since we don't know what
776 stream might go where.
778 * unlocked-io.h: Include <stdio.h>, so that the caller
779 doesn't have to include <stdio.h> before us.
780 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
781 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
782 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
783 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
784 if not declared, so that we can use getpass.c code from libc without
786 (flockfile, ftrylockfile, funlockfile): New macros.
788 2003-10-06 Bruno Haible <bruno@clisp.org>
790 * version-etc-2.h: Remove file.
791 * version-etc-2.c: Remove file.
793 2003-09-25 Jim Meyering <jim@meyering.net>
794 Bruno Haible <bruno@clisp.org>
796 This lets translators provide better translations for the
797 "Written by ..." part of --version output.
798 * version-etc.h: Include stdarg.h.
799 (version_etc_copyright): Declare as readonly.
800 (version_etc): Make this function variadic with a NULL-terminated list
801 of author name strings.
802 (version_etc_va): New declaration.
803 * version-etc.c: Include stdarg.h, stdlib.h.
804 (version_etc_copyright): Declare as readonly.
805 (version_etc_va): New function. Provide a different translatable string
806 for each possible number of authors < 10. Abbreviate when there are 10
808 (version_etc): Make this function variadic. Call version_etc_va.
809 Suggestion from Gary V. Vaughan.
811 * long-options.h (parse_long_options): Change prototype: the authors
812 string is moved to the end and becomes variadic.
813 * long-options.c: Include stdarg.h.
814 (parse_long_options): Make this function variadic, too.
815 Call version_etc_va, not version_etc.
817 2003-10-06 Bruno Haible <bruno@clisp.org>
819 * fatal-signal.h: New file, from GNU gettext.
820 * fatal-signal.c: New file, from GNU gettext.
822 2003-10-04 Karl Berry <karl@gnu.org>
824 * argp*: update from libc.
826 2003-10-01 Larry Jones <lawrence.jones@eds.com>
828 * getpass.c (getpass): Use a no-op fseek when switching from input to
829 output mode on the same stream.
831 2003-09-29 Paul Eggert <eggert@twinsun.com>
833 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
834 Fix arg typo in previous patch.
836 2003-09-28 Jim Meyering <jim@meyering.net>
838 * error.c: Correct cpp indentation.
840 2003-09-27 Paul Eggert <eggert@twinsun.com>
842 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
843 Omit the special code that used __typeof__, since we worry that
844 it could be more trouble than it's worth. See:
845 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
846 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
850 2003-09-26 Jim Meyering <jim@meyering.net>
852 * error.c (error_tail): Move some declarations
853 into inner scope where the local variables are used.
855 2003-09-26 Bruno Haible <bruno@clisp.org>
857 * stpncpy.h (gnu_stpncpy): New declaration.
858 (stpncpy): Define as alias for gnu_stpncpy.
859 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
861 2003-09-26 Paul Eggert <eggert@twinsun.com>
863 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
864 (error_tail): Do not loop, reallocating temporary buffer, since
865 the output cannot contain more wide characters than the input
866 contains bytes, the size must be big enough already. This avoids
867 one potential size overflow calculation. Check for size overflow
868 when calculating temporary buffer size. Free temporary buffer
869 when done, if it was allocated with malloc; this plugs a memory
870 leak. Remove casts from void * to pointers, that are no longer
871 needed now that we're assuming C89 or better.
873 Merge error changes from glibc.
875 * error.c, error.h: Update copyright notice header to match glibc.
876 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
877 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
878 Disable cancellation while printing error.
879 * error.h: Prepend __ to parameter names.
881 2003-09-25 Karl Berry <karl@gnu.org>
883 * argp-fmtstream.c, argp-help.c: update from libc.
885 2003-09-25 Bruno Haible <bruno@clisp.org>
887 * version-etc-2.h: New file, from version-etc.h with modifications.
888 * version-etc-2.c: New file, from version-etc.c with modifications.
890 2003-09-25 Simon Josefsson <jas@extundo.com>
892 * xgetdomainname.h: New file.
893 * xgetdomainname.c: New file.
895 2003-09-25 Simon Josefsson <jas@extundo.com>
896 Bruno Haible <bruno@clisp.org>
898 * getdomainname.h: New file.
899 * getdomainname.c: New file.
901 2003-09-24 Paul Eggert <eggert@twinsun.com>
903 * linebuffer.c (freebuffer): Don't free the argument, just
904 the buffer associated with the argument. Bug reported by
907 2003-09-19 Karl Berry <karl@gnu.org>
909 * argp.h: update from libc.
911 2003-09-16 Paul Eggert <eggert@twinsun.com>
913 * linebuffer.c (readlinebuffer): Return NULL immediately upon
914 input error, instead of returning NULL the next time we are called
915 (and therefore losing track of errno).
917 2003-09-15 Paul Eggert <eggert@twinsun.com>
919 * getndelim2.c (getndelim2): Don't trash errno when a read
920 fails, so that the caller gets the proper errno.
922 * readutmp.c (read_utmp): Likewise.
923 Check for fstat error. Close stream and free storage
926 2003-09-14 Bruno Haible <bruno@clisp.org>
928 * fwriteerror.h: New file.
929 * fwriteerror.c: New file.
931 2003-09-14 Jim Meyering <jim@meyering.net>
933 * getloadavg.c: Correct cpp indentation.
934 * strdup.c: Likewise.
935 * vasnprintf.c: Likewise.
937 2003-09-12 Paul Eggert <eggert@twinsun.com>
939 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
940 * obstack.c [!defined _LIBC]: Likewise.
941 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
942 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
943 * exitfail.c: Don't include stdlib.h; no longer needed.
945 More changes to assume C89 or better.
947 * error.c (error_tail): Assume vprintf.
949 * argmatch.c (getenv): Remove decl.
950 * progreloc.c (get_full_program_name): Define via prototype.
951 * setenv.c (clearenv): Likewise.
952 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
954 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
955 (malloc, memcpy): Remove decls.
956 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
957 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
958 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
959 (memcpy): Remove macro.
960 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
961 (__P): Remove. All uses removed.
962 (PTR): Remove. All uses changed to void *.
963 (CHAR_BIT, NULL): Remove.
964 (spaces, zeros, memset_space, memset_zero)
965 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
967 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
968 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
969 Define with prototype.
970 Remove now-unnecessary prototype decl.
971 (extra_args_spec): Assume ANSI C. All uses changed.
972 (extra_args_spec_iso): Remove.
973 (my_strftime, emacs_strftimeu): Define via prototype.
974 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
976 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
977 * strtoimax.c: Include <stdlib.h> unconditionally.
978 (strtoul, strtol): Remove decls.
979 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
981 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
982 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
983 (LOCALE_PARAM_PROTO): New macro.
984 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
985 (INTERNAL (strtol), strtol): Define with a prototype.
986 (PARAMS): Remove. All uses removed.
987 * tempname.c: Include <string.h> unconditionally.
988 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
989 * xgethostname.c (main): Define with a prototype.
990 * xmalloc.c: Include "xalloc.h" first, to check interface.
991 Include <stdlib.h> unconditionally.
992 (calloc, malloc, realloc, free): Remove decls.
993 * xstrtod.c: Include "xstrtod.h" first, to check interface.
994 Include <stdlib.h> unconditionally. Sort include file names.
996 (xstrtod): Define with a prototype.
997 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
998 (strtol, strtoul): Remove decls.
1000 2003-09-11 Paul Eggert <eggert@twinsun.com>
1002 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
1003 Include <stdlib.h>, <string.h> unconditionally.
1004 Remove now-unnecessary cast to char *.
1005 * strnlen.c: Include <string.h> unconditionally.
1006 * yesno.c (yesno): Define with a prototype.
1008 2003-09-10 Bruno Haible <bruno@clisp.org>
1010 * strcspn.c: Include <string.h> unconditionally.
1011 * strpbrk.c: Include <string.h> unconditionally.
1012 * strstr.c: Include <string.h> unconditionally.
1013 * unicodeio.c: Include <string.h> unconditionally.
1014 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
1015 * unsetenv.c: Likewise.
1016 * xreadlink.c: Include <stdlib.h> unconditionally.
1017 * yesno.c: Include <stdlib.h> unconditionally.
1018 (rpmatch): Add prototype.
1020 2003-09-10 Jim Meyering <jim@meyering.net>
1022 * error.c: Correct indentation of cpp directives.
1024 2003-09-09 Paul Eggert <eggert@twinsun.com>
1028 * acosl.c (main): Use a prototype.
1029 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
1032 * getloadavg.c (getloadavg, main): Define via prototypes.
1034 * getopt.h (struct option.name): Assume C89, and use 'const'.
1035 (getopt, etopt_long, getopt_long_only, _getopt_internal)
1036 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
1038 * getopt.c (const): Remove macro.
1039 Include <string.h> unconditionally.
1040 (my_index): Remove; all uses changed to strchr.
1041 (strlen): Remove decl.
1042 (exchange): Remove forward decl; no longer needed.
1043 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
1044 Define with prototype.
1045 * getopt1.c (const): Remove macro.
1046 (getopt_long, getopt_long_only, main): Define with prototype.
1048 * getugroups.c: Include <string.h> unconditionally.
1050 * getusershell.c: Include <stdlib.h> unconditionally.
1051 (getusershell, setusershell, endusershell, readname, main):
1052 Define with prototypes.
1054 * group-member.c: Include group-member.h first.
1055 Include <stdlib.h> unconditionally.
1057 * hard-locale.c: Include hard-locale.h first.
1058 Include <stdlib.h>, <string.h> unconditionally.
1060 * hash.c (free, malloc): Remove decls.
1061 Include <stdlib.h> unconditionally.
1063 * human.c: Include <stdlib.h>, <string.h> unconditionally.
1064 (getenv): Do not declare.
1066 * idcache.c: Include <string.h> unconditionally.
1068 * long-options.c: Include long-options.h first, to test interface.
1069 Include <stdlib.h> unconditionally.
1071 * makepath.c: Include makepath.h first, to test interface.
1072 Include <stdlib.h> and <string.h> unconditionally.
1074 * linebuffer.c: Include <stdlib.h>.
1075 (free): Remove decl.
1077 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
1078 rpl_malloc returns void *, not char *.
1079 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
1081 * md5.h: Include <limits.h> unconditionally.
1082 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
1083 (__P): Remove; all uses removed.
1084 * md5.c: Include "md5.h" first.
1085 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
1086 md5_buffer, md5_process_bytes, md5_process_block):
1087 Define with prototypes.
1088 * sha.h (__P): Remove all uses. (It wasn't defined??)
1089 * sha.c: Include "sha.h" first.
1090 Include <stdlib.h>, <string.h> unconditionally.
1092 * memchr.c (__ptr_t): Remove; all uses changed to void *.
1093 * memcmp.c (__ptr_t): Likewise.
1094 * memrchr.c (__ptr_t): Likewise.
1095 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
1096 Include <string.h> unconditionally.
1097 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
1098 * memchr.c: Include <stdlib.h> unconditionally.
1099 * memchr.c (LONG_MAX): Remove.
1100 * memrchr.c (LONG_MAX): Likewise.
1101 * memchr.c (__memchr): Define via a prototype.
1102 * memrchr.c (__memrchr): Likewise.
1103 * memcmp.c (__P): Remove, and remove all uses.
1104 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
1105 Remove forward decls; no longer needed.
1106 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
1107 Use types required by C89 in prototype.
1109 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
1110 * savedir.c: Likewise.
1111 * mkdir.c (free): Remove decl.
1112 * rmdir.c (rmdir): Define with a prototype.
1113 * savedir.c: Include savedir.h first, to test interface.
1115 * mktime.c (STDC_HEADERS): Remove.
1116 Include <stdlib.h>, <string.h> unconditionally.
1118 * modechange.c: Include <stdlib.h> unconditionally.
1119 (malloc): Remove decl.
1121 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
1122 (free): Remove decl.
1124 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
1125 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
1126 (This type really should be intptr_t, but that's a C99ism.)
1127 (_obstack_memcpy): Remove: all uses changed to memcpy.
1128 Include <string.h> unconditionally.
1129 (struct obstack): Assume __STDC__ for types of members
1130 chunkfun, freefun, extra_arg.
1131 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
1132 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
1133 obstack_begin, obstack_specify_allocation,
1134 obstack_specify_allocation_with_arg, obstack_chunkfun,
1135 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
1136 Remove unprototyped decls and the macros that use them.
1137 * obstack.c (POINTER): Remove. All uses changed to void *.
1138 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
1139 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
1140 (defined __STDC__ && __STDC__)]:
1141 Remove nonprototyped code.
1142 Include <stdlib.h> unconditionally.
1143 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
1144 _obstack_allocated_p, _obstack_free, obstack_free,
1145 _obstack_memory_used, print_and_abort):
1146 Define using prototypes.
1147 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
1148 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
1149 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
1150 obstack_next_free, obstack_object_size, obstack_room) [0]:
1151 Remove unused, unprototyped code.
1153 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
1155 * physmem.c (physmem_total, physmem_available, main): Define
1158 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
1159 (main): Define with a prototype.
1161 * posixver.c (getenv): Remove decl.
1163 * putenv.c (malloc): Returns void *, not char *.
1164 Include <string.h> unconditionally.
1165 (strchr, memcpy, NULL): Do not define.
1167 * readtokens.c: Include readtokens.h first, to test interface.
1168 Include <stdlib.h>, <string.h> unconditionally.
1169 (init_tokenbuffer): Define with a prototype.
1171 * regex.c (PARAMS): Remove. All uses removed.
1172 All uses of _RE_ARGS removed, too.
1173 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1175 (bzero): Assume memset exists.
1176 (memcmp, memcpy, NULL): Remove.
1177 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
1178 char, or assignments to local vars of type signed char.
1179 (init_syntax_once, PREFIX(extract_number_and_incr),
1180 PREFIX(print_partial_compiled_pattern),
1181 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
1182 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
1183 PREFIX(regex_grow_registers), PREFIX(regex_compile),
1184 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
1185 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
1186 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
1187 wcs_compile_range, byte_compile_range, truncate_wchar,
1188 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
1189 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
1190 count_mbs_length, wcs_re_match_2_internal,
1191 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
1192 PREFIX(alt_match_null_string_p),
1193 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
1194 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
1195 regfree, PREFIX(extract_number)): Define with prototype. Remove
1196 now-unnecessary declaration, if any.
1197 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
1199 Remove now-unnecessary casts among pointer types.
1200 * regex.h (_RE_ARGS): Remove. All uses removed.
1202 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
1203 (free): Remove decl.
1205 * rpmatch.c: Include <stdlib.h> unconditionally.
1207 * same.c: Include <stdlib.h>, <string.h> unconditionally.
1208 (free): Remove decl.
1210 * save-cwd.c: Include <stdlib.h> unconditionally.
1211 * xgetcwd.c: Likewise.
1213 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
1214 (free): Remove decl.
1216 * strchrnul.c (strchrnul): Define with a prototype.
1217 Fix bug: c_in was not converted to char before searching.
1219 The following changes are not K&R related:
1221 * group-member.h: Include <sys/types.h>, so that this file is
1223 * makepath.h: Likewise.
1225 * getusershell.c (readname, default_index, line_size, readname):
1226 Use size_t, not int, for sizes.
1227 (readname): If the size overflows, report an error instead of
1230 2003-09-09 Derek Robert Price <derek@ximbiot.com>
1232 * getndelim2.c: Assume stdlib.h per the C89 spec.
1234 2003-09-08 Paul Eggert <eggert@twinsun.com>
1236 Assume C89 or better; remove K&R cruft.
1237 A few of these changes were first proposed by Derek Robert Price
1238 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
1240 * addext.c: Include <string.h> unconditionally.
1241 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
1242 Don't declare getenv or malloc.
1244 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
1245 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
1247 (find_stack_direction, alloca): Use prototypes.
1249 * atexit.c (atexit): Define using a prototype.
1251 * basename.c, dirname.c, stripslash.c:
1252 Include <string.h> unconditionally.
1254 * bcopy.c: Include <stddef.h>.
1255 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
1257 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
1259 * error.h (error, error_at_line, error_print_progname)
1260 [! (defined (__STDC__) && __STDC__)]: Remove decls.
1261 * error.c: Include error.h first, to check interface.
1262 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1263 (VA_START): Remove; all uses changeed to va_start.
1264 (exit, strerror): Remove decls.
1265 (error_print_progname): Prototype uncondionally.
1266 Don't include <errno.h>; no longer needed.
1267 (private_strerror): Remove.
1268 (error_tail): Always define.
1269 (error, error_at_line): Assume C89 or better; always use prototypes.
1270 * fatal.c: Include "fatal.h" first, to test interface.
1271 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1272 (VA_START): Remove; all uses changed to va_start.
1273 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
1275 (exit): Remove decl.
1276 (fatal): Prototype unconditionally. Assume va_start works.
1277 Abort at end, to pacify gcc.
1279 * euidaccess.c (main): Define with a prototype.
1281 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
1283 * exitfail.c: Include <stdlib.h> unconditionally.
1285 * fnmatch_.h (__P): Remove. All uses changed to assume
1287 * fnmatch.c: Include fnmatch.h first, to test interface.
1288 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
1289 (getenv): Remove decl.
1290 (fnmatch): Define using a prototype.
1291 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
1292 (FCT): Define using a prototype.
1294 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
1296 * gethostname.c: Include <stddef.h>.
1297 (gethostname): Define with prototype. Length is size_t, not int.
1299 2003-09-08 Paul Eggert <eggert@twinsun.com>
1301 * getversion.c: Remove; was migrated to backupfile.c in 1997.
1302 getversion.c should have been removed then, but was accidentally
1305 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
1306 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
1308 2003-09-07 Paul Eggert <eggert@twinsun.com>
1310 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
1311 copy_tm_result. Bug reported by Simon Josefsson in
1312 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
1314 2003-09-06 Paul Eggert <eggert@twinsun.com>
1316 * time_r.c, time_r.h: New files.
1318 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
1320 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
1321 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
1323 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
1325 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
1326 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
1329 * timegm.c: Switch to glibc implementation, with the following changes:
1330 [defined HAVE_CONFIG_H]: Include <config.h>.
1331 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
1332 (__mktime_internal) [!defined _LIBC]: New decl.
1333 (__gmtime_r) [!defined _LIBC]: New macro and function.
1334 (timegm): Use a prototype, since gnulib assumes C89.
1335 Do not bother declaring tmp to be const, as it's not really usefu.
1336 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
1337 (timegm): Declare only if HAVE_DECL_TIMEGM.
1339 2003-09-03 Paul Eggert <eggert@twinsun.com>
1341 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
1342 Bug reported by Lute Kamstra in
1343 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
1345 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
1346 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
1347 course with correspondingly smaller numbers for tomorrow and
1348 yesterday. From Tadayoshi Funaba. Originally installed into
1349 sh-utils on 1999-08-07, but the patch got lost (I guess during the
1352 2003-08-31 Simon Josefsson <jas@extundo.com>
1354 * timegm.h: New file.
1355 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
1357 2003-08-31 Karl Berry <karl@gnu.org>
1359 * argp.h: update from libc.
1361 2003-08-28 Bruno Haible <bruno@clisp.org>
1363 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
1364 warning on QNX, which defines O_BINARY to 000000.
1366 2003-08-24 Bruno Haible <bruno@clisp.org>
1368 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
1369 MSVC7 <stdio.h> is included later.
1371 2003-08-20 Bruno Haible <bruno@clisp.org>
1373 * progname.h: New file, from GNU gettext.
1374 * progname.c: New file, from GNU gettext.
1375 * progreloc.c: New file, from GNU gettext.
1377 2003-08-19 Bruno Haible <bruno@clisp.org>
1379 * xstrdup.c: Assume <string.h> exists.
1381 2003-08-18 Jim Meyering <jim@meyering.net>
1383 * setenv.h: Indent nested cpp directive.
1384 * vasnprintf.c: Remove trailing blanks.
1386 2003-08-17 Simon Josefsson <jas@extundo.com>
1387 Bruno Haible <bruno@clisp.org>
1389 * xstrndup.h: New file.
1390 * xstrndup.c: New file.
1392 2003-08-17 Bruno Haible <bruno@clisp.org>
1394 * strndup.h: New file.
1396 2003-08-16 Paul Eggert <eggert@twinsun.com>
1398 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
1399 space, undoing this 2003-08-12 change:
1400 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
1402 2003-08-16 Jim Meyering <jim@meyering.net>
1404 Merge from coreutils.
1405 * xstrtoimax.c: #else #if -> #elif.
1406 * xstrtoumax.c: Likewise.
1408 2003-08-15 Paul Eggert <eggert@twinsun.com>
1410 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
1411 rather than tab, after '#' in shell-script copyright notices.
1412 Suggested by Bruno Haible.
1414 2003-08-15 Jim Meyering <jim@meyering.net>
1415 and Paul Eggert <eggert@twinsun.com>
1417 Merge from coreutils.
1418 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
1419 member but strut utmpx does not. Needed for AIX 4.3.3.
1420 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
1422 2003-08-15 Jim Meyering <jim@meyering.net>
1424 Merge from coreutils.
1425 * xgethostname.c: Include <stdlib.h>.
1426 (xghostname): Don't exit for anything other than memory-related
1427 failure; just return NULL.
1428 * userspec.c: Include "posixver.h".
1429 (parse_user_spec): Accept `.' as a separator only
1430 in pre-POSIX-200112 mode.
1431 * strtoimax.c: Use #elif rather than #else #if.
1432 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
1433 Remove function, now that we can rely on a working tzset function.
1434 [!_LIBC]: Ensure that the required autoconf test has been run.
1435 [!defined _NL_CURRENT && HAVE_STRFTIME]:
1436 Use underlying_strftime for %r.
1437 * sha.c: Merge in some clean-up and optimization changes from glibc.
1438 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
1439 Ensure that it is a multiple of 64.
1440 Rearrange loop exit tests so as to avoid performing an
1441 additional fread after encountering an error or EOF.
1442 * realloc.c: Update copyright date.
1444 2003-08-14 Jim Meyering <jim@meyering.net>
1446 Merge from coreutils.
1447 * obstack.h: Whitespace changes.
1448 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
1449 and xcalloc return values.
1450 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
1451 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
1452 hang on OSF/1 5.1 for DIR on both local and remote file systems.
1453 Reported by (and fix confirmed by) Nelson H. F. Beebe.
1454 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1456 Use mntctl's return value to drive the entry-processing loop, since
1457 we can't rely on the value of the vmt_length member in the last
1458 entry. On some systems doing so could result in exhausting
1459 virtual memory. Based in part on a patch from Mike Jetzer.
1461 2003-08-14 Jim Meyering <jim@meyering.net>
1462 and Paul Eggert <eggert@twinsun.com>
1464 Merges from coreutils, plus other fixes.
1465 * physmem.c: Merge in portability changes from gcc/libiberty
1466 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
1467 for credits and details. Thanks to Kaveh Ghazi for helping
1468 to keep these files in sync.
1469 (ARRAY_SIZE): Define it.
1470 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
1471 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
1472 (memcasecmp): Don't assume size_t fits in unsigned int.
1473 Remove casts and duplicate code.
1474 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
1475 (memcpy): Remove definition.
1476 Merge in some clean-up and optimization changes from glibc.
1477 [BLOCKSIZE]: Move definition to top of file.
1478 Ensure that it is a multiple of 64.
1479 Rearrange loop exit tests so as to avoid performing an
1480 additional fread after encountering an error or EOF.
1481 * md5.h (md5_uintptr): Define.
1482 * makepath.c (CLEANUP_CWD): Report an error if we failed to
1483 return to the initial working directory. Preserve errno
1485 * idcache.c: Include "xalloc.h".
1486 (xmalloc, xrealloc): Remove decls.
1487 (getuser): Remove casts no longer required in C89.
1488 * human.c: Include stdio.h, for sprintf.
1489 * group-member.c: Include "xalloc.h".
1490 (xmalloc, xrealloc): Remove decls.
1491 (get_group_info): Remove casts no longer required in C89.
1492 * getusershell.c (readname): Remove casts no longer required in C89.
1493 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
1494 * getline.c: Whitespace fix, from coreutils.
1496 2003-08-13 Paul Eggert <eggert@twinsun.com>
1498 * exclude.c: Include <ctype.h>
1499 (IN_CTYPE_DOMAIN): New macro.
1501 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
1504 * argp-help.c, argp-parse.c, config.charset, getopt.h:
1505 Undo previous (whitespace-only) change.
1507 2003-08-12 Paul Eggert <eggert@twinsun.com>
1509 * argp-help.c, argp-parse.c, config.charset, getopt.h:
1510 Normalize leading white space and remove trailing white space.
1511 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
1512 notice, as per ../config/srclist-update.
1514 Merge from coreutils.
1515 * euidaccess.h: New file.
1516 * euidaccess.c: Include it.
1517 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
1518 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
1519 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
1521 2003-08-11 Bruno Haible <bruno@clisp.org>
1523 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
1524 (vasnprintf): Use it instead of wcslen.
1526 2003-08-11 Bruno Haible <bruno@clisp.org>
1528 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
1529 value to ensure that _Bool promotes to int. Use #define for _Bool when
1530 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
1532 2003-08-10 Karl Berry <karl@gnu.org>
1534 * regex.h: update from libc (whitespace fix).
1536 2003-08-09 Paul Eggert <eggert@twinsun.com>
1538 Merge some files from coreutils. These changes were
1539 originally made by Jim Meyering.
1540 * acl.c: Include <sys/types.h> before <sys/stat.h>;
1541 many older Unixes require this.
1542 * alloca.c (alloca): Remove cast to argument of free;
1543 no longer needed in C89.
1544 * alloca_.h, regex.h: Fix white space to match
1545 what GNU indent does.
1547 2003-08-05 Paul Eggert <eggert@twinsun.com>
1549 * bumpalloc.h: Remove.
1551 2003-08-04 Paul Eggert <eggert@twinsun.com>
1553 * getloadavg.c: Change copyright notice and spacing to conform to
1556 Merge from coreutils.
1557 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
1559 * getdate.y (date): Also accept dates like May-23-2003; suggestion
1560 from Karl Berry, implemented by Jim Meyering.
1561 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
1562 from Dmitry V. Levin.
1563 Remove anachronistic cast of xrealloc.
1564 * fnmatch_.h (__const): Remove. Use 'const'.
1565 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
1566 type. Otherwise, it wouldn't compile with at least /bin/cc on
1567 ymp-cray-unicos9.0.2.X.
1568 Combine two mostly-identical uses of alloca into one.
1569 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
1571 2003-08-04 Dave Love <d.love@dl.ac.uk>
1575 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
1576 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
1577 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
1578 obsolete NLIST_NAME_UNION.
1579 [__GNU__]: Undef BSD and FSCALE.
1580 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
1582 2003-08-03 Paul Eggert <eggert@twinsun.com>
1584 * stdbool_.h (_Bool): Make it signed char, instead of
1585 an enum type, so that it's guaranteed to promote to int. See:
1586 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
1588 2003-07-31 Paul Eggert <eggert@twinsun.com>
1590 * strerror.c: Include config.h, limits.h. Declare sprintf.
1591 (strerror): Don't assume that a printable int fits in 14 bytes.
1593 2003-07-24 Derek Robert Price <derek@ximbiot.com>
1594 Bruno Haible <bruno@clisp.org>
1596 * getline.h (getline, getdelim): Change return type to ssize_t.
1597 * getline.c (getline, getdelim): Likewise.
1598 Remove _GNU_SOURCE define; now it's defined in config.h through
1601 2003-07-22 Paul Eggert <eggert@twinsun.com>
1603 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
1604 over-parenthesization in macros.
1606 Sync with coreutils.
1608 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
1611 Use `exit_failure' for xalloc and xmemcoll instead of their own
1612 private exit-failure variables.
1613 * xalloc.h (xalloc_exit_failure): Remove.
1614 * xmalloc.c: Likewise. Include exitfail.h.
1615 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
1616 * xmemcoll.h (xmemcoll_exit_failure): Remove.
1617 * xmemcoll.c: Likewise. Include exitfail.h.
1618 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
1620 2003-07-18 Paul Eggert <eggert@twinsun.com>
1622 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
1623 * closeout.c: Likewise. Include "closeout.h" right after config.h,
1624 to test that it can stand by itself. Include "exitfail.h".
1625 Clients should set exit_failure instead.
1626 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
1628 2003-07-18 Andreas Schwab <schwab@suse.de>
1630 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
1632 2003-07-18 Bruno Haible <bruno@clisp.org>
1634 * getndelim2.h: New file.
1635 * getndelim2.c: Make into a module of its own. Include config.h,
1637 (getndelim2): Make non-static. Change return type to ssize_t.
1638 * getline.h: Change argument names.
1639 * getline.c: Include getndelim2.h instead of getndelim2.c.
1640 * getnline.c: Include getndelim2.h.
1642 2003-07-17 Bruno Haible <bruno@clisp.org>
1644 * Makefile.am: Remove file.
1645 * Makefile.in: Remove file.
1647 2003-07-17 Bruno Haible <bruno@clisp.org>
1649 * getnline.h: New file.
1650 * getnline.c: New file.
1651 * getndelim2.c: New file, extracted from getline.c.
1652 (getndelim2): Renamed from getdelim2, with added nmax argument.
1653 * getline.c: Include getndelim2.c.
1654 (getdelim2): Moved out to getndelim2.c.
1655 (getline, getdelim): Update.
1657 2003-07-15 <karl@gnu.org>
1659 * vasnprintf.c: update from gettext.
1661 2003-07-15 Jim Meyering <jim@meyering.net>
1663 * makepath.c (make_path): Enclose diagnostic in _(...).
1665 2003-07-14 Paul Eggert <eggert@twinsun.com>
1667 * asnprintf.c, asprintf.c, config.charset, gettext.h,
1668 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
1669 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
1670 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
1671 vasprintf.c, vasprintf.h: Regenerate. These files are now being
1672 updated automatically by ../config/srclist-update. This changes
1673 their license from LPGL to GPL.
1675 2003-07-14 Jim Meyering <jim@meyering.net>
1677 Don't emit diagnostics. Let callers do that.
1678 * save-cwd.c: Don't include "error.h".
1679 (save_cwd): Don't call error. Ensure that errno is valid
1680 when returning nonzero.
1682 * save-cwd.h (restore_cwd): Update prototype.
1683 * save-cwd.c (restore_cwd): Remove two parameters.
1684 Simplify. Don't call error upon failure. Let callers do that.
1685 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
1686 when auditing is enabled. But don't bother updating the #if.
1688 2003-07-14 Simon Josefsson <jas@extundo.com>
1690 * mempcpy.h: New file.
1691 * mempcpy.c: New file.
1693 2003-07-14 Paul Eggert <eggert@twinsun.com>
1695 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
1696 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
1697 unicodeio.c, unicodeio.h, unlocked-io.h:
1698 Switch from LGPL to GPL.
1700 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
1702 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
1703 it breaks C++ compilation.
1704 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
1706 2003-07-10 Jim Meyering <jim@meyering.net>
1708 * vasnprintf.c: Remove trailing blanks.
1709 Make cpp indentation consistent.
1711 2003-07-09 Paul Eggert <eggert@twinsun.com>
1713 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
1714 posixver.c, strftime.c, strnlen.c, strverscmp.c:
1715 Switch from LGPL to GPL.
1717 2003-07-07 Paul Eggert <eggert@twinsun.com>
1719 * mktime.c: Fix some boundary cases and remove need for floating point.
1721 Issue a compile-time diagnostic if time_t is floating point, or if
1722 two's complement arithmetic is not in effect, or if arithmetic
1723 right shift does not propagate the sign. These assumptions were
1724 all in the original code but they weren't checked.
1726 (TIME_T_MIDPOINT, verify): New macros.
1727 (__isleap): Remove; it has integer overflow problems.
1728 (leapyear): New function, without those problems.
1729 (ydhms_tm_diff): Remove; splitting into two parts.
1730 (ydhms_diff): New function, containing the arithmetic part of
1731 the old ydhms_tm_diff function. Issue a compile-time
1732 diagnostic if we are not using C99 integer division.
1733 Avoid casts when possible.
1734 (guess_time_tm): New function, containing the checking part of
1735 the old ydhms_tm_diff function. Return the new value, rather than
1736 the difference between it and the old. Accept a new argument T
1737 so that *T specifies the old value. Check for overflow in the result.
1739 (__mktime_internal): Use a time_t offset, not a long int offset.
1740 This undoes the 2003-06-04 change, which is no longer needed now
1741 that we have better overflow checking.
1742 (localtime_offset): Likewise.
1744 (__mktime_internal): Avoid harmful overflow on hosts where time_t
1745 and long are 64-bit but int is only 32-bit.
1746 (ydhms_diff): Use long int to store year1 and yday1.
1747 Issue a compile-time diagnostic if long int is not wide enough.
1749 (__mktime_internal): Use long int to store adjusted year and yday.
1750 Use plain C rather than preprocessor commands, if that doesn't
1752 Check for overflow (and try to repair) after each probe
1753 rather than checking only at the very end. This avoids some bugs
1754 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
1755 does not equal GMT offset at maximum time).
1756 Use integer to check for overflow rather than floating point; this
1757 is more portable to non-IEEE hosts, and is a tad faster.
1758 When we detect that we are oscillating between two values,
1759 don't check whether tm_isdst has the requested value, since
1760 we already know the answer. When tm_isdst has the wrong value,
1761 use a different heuristic to find the right one, based on the
1762 extreme values actually observed in practice in tz2003a,
1763 rather than the (overly optimistic) "previous 3 calendar quarters".
1765 (not_equal_tm, print_tm, check_result): Use "const T" rather than
1766 "T const" to accommodate glibc style.
1767 (check_result): Use less-confusing report format. "long" -> "long int.
1769 Don't loop if the iteration overflows time_t.
1770 Allow a negative step in the iteration.
1772 2003-07-01 Paul Eggert <eggert@twinsun.com>
1774 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
1775 having it depend on HAVE_SYS_TYPES_H.
1777 2003-06-25 Bruno Haible <bruno@clisp.org>
1779 * readlink.c: New file.
1781 2003-06-20 Bruno Haible <bruno@clisp.org>
1783 Assume C89, so PARAMS isn't needed.
1784 * unicodeio.h (PARAMS): Remove.
1785 * unicodeio.c: Don't use PARAMS.
1787 2003-06-18 Jim Meyering <jim@meyering.net>
1789 Merge changes from coreutils.
1790 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
1791 Remove explicit declarations of xmalloc and realloc.
1793 (read_utmp): Remove anachronistic cast of xmalloc.
1795 2003-06-17 Paul Eggert <eggert@twinsun.com>
1797 Assume C89, so PARAMS isn't needed.
1798 * backupfile.h (PARAMS): Remove. All uses removed.
1799 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
1800 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
1801 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
1802 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
1803 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
1804 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
1805 xstrtol.h: Likewise.
1806 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
1807 same.h, strverscmp.h: Do not include config.h; no longer needed.
1808 Anyway, config.h should always be included before any other file.
1810 2003-06-11 Simon Josefsson <jas@extundo.com>
1812 * sysexit_.h: New file.
1814 2003-05-20 Derek Price <derek@ximbiot.com>
1816 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
1818 2003-06-10 Simon Josefsson <jas@extundo.com>
1820 * strchrnul.h: New file.
1821 * strchrnul.c: New file.
1823 2003-06-10 Simon Josefsson <jas@extundo.com>
1825 * argp.h: New file, from glibc.
1826 * argp-ba.c: New file, from glibc.
1827 * argp-eexst.c: New file, from glibc.
1828 * argp-fmtstream.c: New file, from glibc.
1829 * argp-fmtstream.h: New file, from glibc.
1830 * argp-fs-xinl.c: New file, from glibc.
1831 * argp-help.c: New file, from glibc.
1832 * argp-namefrob.h: New file, from glibc.
1833 * argp-parse.c: New file, from glibc.
1834 * argp-pv.c: New file, from glibc.
1835 * argp-pvh.c: New file, from glibc.
1836 * argp-xinl.c: New file, from glibc.
1838 2003-06-07 Jim Meyering <jim@meyering.net>
1840 * readtokens.h: Put `Free Software Foundation, Inc.'
1841 in place of my name in the copyright comment.
1842 Remove definition and uses of __P.
1845 * stat.c: Don't declare xmalloc explicitly.
1846 Instead, include "xalloc.h".
1847 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
1848 xrealloc, and xcalloc return values.
1849 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
1851 * xgetcwd.h: Remove definition/uses of PARAMS.
1853 2003-06-06 Jim Meyering <jim@meyering.net>
1855 * stdbool_.h: Renamed from stdbool.h.in.
1857 2003-06-06 Jim Meyering <jim@meyering.net>
1859 Merge from coreutils.
1860 * same.c: (same_name): Declare *_basename locals to be `const'.
1861 Consolidate declarations and initializations of *_base* locals.
1863 Merge from coreutils.
1864 This avoids a core dump on systems without GNU putenv,
1865 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
1866 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
1867 (unsetenv): New static function, from GNU libc.
1868 (rpl_putenv): Use it.
1870 * modechange.c: Remove trailing blanks.
1872 Merge from coreutils.
1873 * fsusage.c: Remove declaration of statfs.
1874 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
1876 * posixtm.c: Include <stdbool.h> unconditionally.
1878 2003-06-05 Paul Eggert <eggert@twinsun.com>
1880 * mktime.c (__mktime_internal): When resolving a tm_isdst
1881 mismatch, look in future quarters as well as past. This fixes a
1882 bug when processing fall-backwards gaps immediately after a long
1883 period of daylight-saving time.
1885 * mktime.c: Assume freestanding C89 or better.
1886 (HAVE_LIMITS_H): Remove. Assume it's 1.
1887 (__P): Remove; not used.
1888 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
1889 (mktime, not_equal_tm, print_tm, check_result,
1890 main): Use prototypes. Use const * where appropriate.
1891 (main): Fix typo in testing code that uncovered by above changes.
1892 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
1894 2003-06-04 Paul Eggert <eggert@twinsun.com>
1896 * mktime.c: Fix Debian bug 177940
1897 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
1898 (localtime_offset): Now long int, not time_t, because we want it
1899 to be guaranteed to be signed. All uses changed.
1900 (__mktime_internal): If overflow would occur when adding offset,
1903 Merge 'human' changes from coreutils. Rewrite to support
1904 locale-specific notations like thousands separators.
1905 * human.c: Simplify authorship notice.
1906 Include human.h immediately after config.h.
1907 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
1908 <limits.h>: Do not include, since human.h does.
1909 (SIZE_MAX, UINTMAX_MAX): New macros.
1910 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
1911 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
1912 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
1913 (power_letter): Renamed from suffixes.
1914 (generate_suffix_backwards): Remove.
1915 (adjust_value): Now takes int style (because of human.h changes)
1916 and long double value (for greater precision on some platforms).
1917 (group_number): New function.
1918 (human_readable): Use it. Use integer options, not enum.
1919 Put the options before the sizes in the arg list.
1920 Support all the new options.
1921 The old human_readable function has been removed;
1922 use inttostr.h instead.
1923 (human_readable, default_block_size, humblock):
1924 Use uintmax_t, not int, for block sizes.
1925 (human_readable_inexact, block_size_types): Remove.
1926 (block_size_opts): New constant.
1927 (human_options): Renamed from human_block_size, with new signature
1928 that allows block sizes up to UINTMAX_MAX. All callers changed.
1929 * human.h: Add copyright and authorship notice.
1930 Include <limits.h> and <stdbool.h> unconditionally.
1931 (PARAMS): Remove. All uses removed.
1932 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
1933 (enum human_inexact_style): Remove tag; now a nameless enum.
1934 (human_floor, human_ceiling, human_round_to_even): Now have
1935 values 2, 0, 1 rather than -1, 1, 0.
1936 (human_group_digits, human_suppress_point_zero, human_autoscale,
1937 human_base_1024, human_SI, human_B): New constants.
1938 (human_readable_inexact, human_block_size): Remove.
1939 (human_readable): Size args are now uintmax_t, not int.
1940 (human_options): New decl.
1942 * exclude.c: (new_exclude, add_exclude): Remove casts that are
1943 unnecessary now that we assume C89 or better. This change
1944 imported from coreutils.
1946 * mktime.c (__mktime_internal): Do not reject negative timestamps
1947 arbitrarily. This is the same patch as 2003-05-28, but it got lost
1948 in the 2003-05-30 sync from glibc.
1950 .h files should stand alone, but we shouldn't include <sys/types.h>
1951 if we can get away with just <stddef.h>.
1953 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
1954 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
1955 rather than <sys/types.h>, as we merely need size_t.
1956 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
1958 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
1959 Include <stdio.h>, to get FILE.
1960 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
1961 memcasecmp.h has included <stddef.h> and all we need is size_t.
1962 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
1963 our interface, instead of including <sys/types.h>
1965 2003-06-02 Paul Eggert <eggert@twinsun.com>
1968 Fix some minor time-related bugs with POSIX time arguments.
1969 Some valid time stamps were being rejected (notably -1, and
1970 time stamps before 1900 on 64-bit hosts). And some invalid
1971 time stamps were being accepted, e.g. September 31.
1973 * posixtm.h (posixtime): Return bool instead of time_t, so
1974 that we can return (time_t) -1 successfully.
1975 * posixtm.c: Likewise.
1976 [HAVE_STDBOOL_H]: Include <stdbool.h>.
1977 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
1978 (t): Remove static var.
1979 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
1980 of static var. All uses changed.
1981 (year): Do not reject years before 1900; they can occur with
1983 (posix_time_parse): Do not check for out-of-range components;
1984 that is now the caller's responsibility, since our checks were
1985 only approximations.
1986 (posixtime): Use mktime to check for out-of-range components,
1987 since it knows them exactly.
1988 If mktime returns (time_t) -1, check whether an error actually occurred
1989 by invoking localtime on -1.
1990 (main) [TEST_POSIXTIME]: Check for input data errors, and report
1991 posixtime failures better.
1992 Improve the test data (in comments only).
1994 2003-05-30 <karl@gnu.org>
1996 * mktime.c: update from libc.
1998 2003-05-30 Bruno Haible <bruno@clisp.org>
2000 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
2001 * localcharset.h: Likewise.
2002 * localcharset.c: Likewise.
2004 2003-05-28 Paul Eggert <eggert@twinsun.com>
2006 Assume the headers required for C89 freestanding compilers.
2007 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
2008 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
2009 without checking for HAVE_LIMITS_H.
2010 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
2011 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
2013 * fatal.c: Include <stdarg.h> without checking for __STDC__.
2014 * exclude.c: Include <stdbool.h> unconditionally.
2015 * tempname.c: Include <stddef.h> unconditionally.
2016 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
2017 * modechange.c, rpmatch.c (NULL): Don't define, since
2018 <stddef.h> does that.
2019 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
2020 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
2021 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
2022 * xstrtol.c: Likewise.
2023 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
2024 * savedir.c: Include <stddef.h> instead of defining NULL.
2026 * addext.c (addext): Use assignment rather than cast, to avoid
2027 warnings on some platforms.
2029 * mktime.c (__mktime_internal): Do not reject negative timestamps
2032 2003-05-10 Bruno Haible <bruno@clisp.org>
2034 * linebreak.c (iconv_string_length): Don't return -1 just because the
2035 string is longer than 4 KB.
2037 2003-05-12 Jim Meyering <jim@meyering.net>
2039 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
2040 the space-padded-by-default conversion specifiers, %e, %k, %l.
2042 2003-05-03 Bruno Haible <bruno@clisp.org>
2044 Upgrade to Unicode-4.0.
2045 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
2046 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
2047 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
2048 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
2049 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
2050 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
2051 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
2052 Change width of U+E0100..U+E01EF from 1 to 0.
2054 2003-04-25 Bruno Haible <bruno@clisp.org>
2056 * copy-file.c: Include <stddef.h>, for size_t.
2058 2003-04-25 Jim Meyering <jim@meyering.net>
2060 * copy-file.c (copy_file_preserving): Declare buf_size to be
2061 of type size_t, not int.
2063 2003-04-11 Jim Meyering <jim@meyering.net>
2065 Merge changes from Coreutils.
2067 2003-03-22 Jim Meyering <jim@meyering.net>
2069 * strftime.c (widen): Cast alloca return value to proper type.
2071 2003-01-19 Ulrich Drepper <drepper@redhat.com>
2074 * strftime.c (my_strftime): Handle very large width
2075 specifications for numeric values correctly. Improve checks for
2078 2003-01-19 Jim Meyering <jim@meyering.net>
2080 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
2081 (nl_get_alt_digit) [! defined my_strftime]: Define.
2082 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
2083 _nl_get_alt_digit and _nl_get_walt_digit.
2085 * strftime.c (my_strftime): Merge in locale-related changes from libc.
2086 These changes have no effect outside of _LIBC.
2088 2003-04-10 Bruno Haible <bruno@clisp.org>
2090 * findprog.h: New file, from GNU gettext.
2091 * findprog.c: New file, from GNU gettext.
2093 2003-04-05 Jim Meyering <jim@meyering.net>
2095 Merge changes from Coreutils.
2097 * exclude.h (PARAMS): Remove definition and uses.
2098 * exclude.c: Remove uses of `PARAMS'.
2100 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
2101 Add test-cases for DOS filenames. Declare program_name.
2102 (main): Set up program_name. Patch by Rich Dawe.
2104 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2106 Use mntctl's return value to drive the entry-processing loop, since
2107 we can't rely on the value of the vmt_length member in the last
2108 entry. On some systems doing so could result in exhausting
2109 virtual memory. Based in part on a patch from Mike Jetzer.
2111 2003-04-04 Bruno Haible <bruno@clisp.org>
2113 * linebreak.h: New file, from GNU gettext.
2114 * linebreak.c: New file, from GNU gettext with slight modifications.
2115 * lbrkprop.h: New file, from GNU gettext.
2117 2003-04-03 Bruno Haible <bruno@clisp.org>
2119 * utf8-ucs4.h: New file, from GNU gettext.
2120 * utf16-ucs4.h: New file, from GNU gettext.
2121 * ucs4-utf8.h: New file, from GNU gettext.
2122 * ucs4-utf16.h: New file, from GNU gettext.
2124 2003-04-02 Bruno Haible <bruno@clisp.org>
2126 * binary-io.h: New file, from GNU gettext.
2128 2003-04-01 Bruno Haible <bruno@clisp.org>
2130 * pathname.h: New file, from GNU gettext.
2131 * concatpath.c: New file, from GNU gettext.
2133 2003-03-30 Bruno Haible <bruno@clisp.org>
2135 * copy-file.c (copy_file_preserving): Don't set owner if the function
2136 chown() doesn't exist.
2138 2003-03-28 Bruno Haible <bruno@clisp.org>
2140 * copy-file.h: New file, from GNU gettext.
2141 * copy-file.c: New file, from GNU gettext.
2143 2003-03-18 Jim Meyering <jim@meyering.net>
2145 * quote.c (quote_n): Fix typo in comment.
2147 2003-03-14 Jim Meyering <jim@meyering.net>
2149 Merge changes from Coreutils.
2150 * obstack.h (obstack_object_size): Declare temporary, __o,
2151 to be const, in order to avoid warnings.
2152 (obstack_room): Likewise.
2153 (obstack_empty_p): Likewise.
2155 2003-03-13 Paul Eggert <eggert@twinsun.com>
2157 Merge changes from Bison.
2158 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
2159 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
2160 when compiling Bison 1.875's `bitset bset = obstack_alloc
2161 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
2162 * hash.c: Include <stdbool.h> unconditionally.
2164 2003-03-09 Paul Eggert <eggert@twinsun.com>
2166 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
2167 Reported by Bruce Becker; see:
2168 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
2170 2003-03-03 Paul Eggert <eggert@twinsun.com>
2171 Bruno Haible <bruno@clisp.org>
2173 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
2174 Reported by John Hughes, see
2175 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
2177 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
2179 * poll_.h: New file.
2182 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
2184 * mathl.h: New file.
2185 * acosl.c: New file.
2186 * asinl.c: New file.
2187 * atanl.c: New file.
2188 * ceill.c: New file.
2191 * floorl.c: New file.
2192 * frexpl.c: New file.
2193 * ldexpl.c: New file.
2195 * sincosl.c: New file.
2197 * sqrtl.c: New file.
2199 * trigl.c: New file.
2200 * trigl.h: New file.
2202 2003-02-17 Bruno Haible <bruno@clisp.org>
2204 * mkdtemp.h: New file, from GNU gettext.
2205 * mkdtemp.c: New file, from GNU gettext.
2207 2003-01-31 Bruno Haible <bruno@clisp.org>
2209 * rename.c: #undef rename before defining rpl_rename.
2210 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
2212 2003-01-30 Bruno Haible <bruno@clisp.org>
2214 * printf-args.h: New file, from GNU gettext.
2215 * printf-args.c: New file, from GNU gettext.
2216 * printf-parse.h: New file, from GNU gettext.
2217 * printf-parse.c: New file, from GNU gettext.
2218 * vasnprintf.h: New file, from GNU gettext.
2219 * vasnprintf.c: New file, from GNU gettext.
2220 * asnprintf.c: New file, from GNU gettext.
2221 * vasprintf.h: New file, from GNU gettext with modifications.
2222 * vasprintf.c: New file, from GNU gettext.
2223 * asprintf.c: New file, from GNU gettext.
2225 2003-01-29 Bruno Haible <bruno@clisp.org>
2227 * stpncpy.h: New file, from GNU gettext with modifications.
2228 * stpncpy.c: New file, from GNU gettext with modifications.
2230 2003-01-28 Bruno Haible <bruno@clisp.org>
2232 * c-ctype.h: New file, from GNU gettext, with changes suggested by
2234 * c-ctype.c: New file, from GNU gettext, with changes suggested by
2237 2003-01-27 Bruno Haible <bruno@clisp.org>
2239 * xsetenv.h: New file, from GNU gettext.
2240 * xsetenv.c: New file, from GNU gettext.
2242 2003-01-23 Bruno Haible <bruno@clisp.org>
2244 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
2246 2003-01-22 Bruno Haible <bruno@clisp.org>
2248 * exit.h: New file, from GNU gettext.
2250 2003-01-11 Bruno Haible <bruno@clisp.org>
2252 * stpcpy.h (stpcpy): Use ANSI C function declarations.
2253 * strcase.h (strcasecmp, strncasecmp): Likewise.
2255 2003-01-14 Jim Meyering <jim@meyering.net>
2257 * same.c (same_name): Tweak a comment.
2259 2003-01-11 Bruno Haible <bruno@clisp.org>
2261 * same.c (same_name): Reorder tests so as to avoid calling stat()
2262 when a string comparison is sufficient.
2264 2003-01-11 Bruno Haible <bruno@clisp.org>
2266 * readtokens.c (readtoken): Cast character to 'unsigned char', not
2269 2003-01-11 Bruno Haible <bruno@clisp.org>
2271 * hash-pjw.c: Add comment about low quality of this function.
2273 2003-01-12 Paul Eggert <eggert@twinsun.com>
2275 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
2276 to avoid collisions with libcurses and libreadline.
2278 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
2279 * getstr.h, getstr.c: Remove.
2280 * getline.c: Include "getline.h", to check interface.
2281 Move body of old getstr.c here: this defines MIN_CHUNK and
2282 declares getdelim2, which is renamed from getstr.
2283 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
2285 * linebuffer.c (readlinebuffer): Renamed from readline.
2287 * linebuffer.h: Likewise.
2288 (readline): Remove backward-compatibility macro.
2290 2003-01-12 Jim Meyering <jim@meyering.net>
2292 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
2294 2003-01-10 Bruno Haible <bruno@clisp.org>
2296 * alloca_.h: New file.
2297 * getdate.y: Unconditionally include alloca.h.
2298 * makepath.c: Likewise.
2299 * setenv.c: Likewise.
2300 * userspec.c: Likewise.
2302 2003-01-09 Bruno Haible <bruno@clisp.org>
2304 * stdbool.h.in: New file.
2306 2003-01-08 Bruno Haible <bruno@clisp.org>
2308 * safe-read.c: Include specification header first, to ensure its
2310 * full-write.c: Likewise.
2312 2003-01-08 Jim Meyering <jim@meyering.net>
2314 * full-write.c: Undefine and define-away `const' after inclusion
2315 of errno.h, not before. Suggestion from Bruno Haible.
2317 2003-01-07 Jim Meyering <jim@meyering.net>
2319 * full-write.c: Rework so that it may serve to define full_read, too.
2320 * full-read.c: Simply #define FULL_READ and include full-write.c.
2322 2003-01-06 Jim Meyering <jim@meyering.net>
2324 * version-etc.c: Update year in translatable copyright string.
2326 2002-12-25 Bruno Haible <bruno@clisp.org>
2328 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
2329 * xstrtol.h: Likewise.
2330 * xstrtoimax.c: Likewise.
2331 * xstrtoumax.c: Likewise.
2332 * human.h: Likewise.
2334 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
2335 on systems that have <inttypes.h> but not <stdint.h>.
2337 2002-12-31 Paul Eggert <eggert@twinsun.com>
2339 * memcoll.c (memcoll): Fall back on a simple algorithm using
2340 memcmp if strcoll doesn't work.
2342 2002-12-23 Bruno Haible <bruno@clisp.org>
2344 * localcharset.h: New file.
2345 * localcharset.c: Include it.
2346 * unicodeio.c: Likewise.
2348 2002-12-22 Bruno Haible <bruno@clisp.org>
2350 * utime.c (utime_null): No need to call ftruncate if the file was
2353 2002-12-23 Bruno Haible <bruno@clisp.org>
2355 * memcoll.c (STRCOLL): New macro.
2358 2002-12-22 Bruno Haible <bruno@clisp.org>
2360 * getstr.h (getstr): Define, to avoid clash with libcurses.
2361 * linebuffer.h (readline): Define, to avoid clash with libreadline.
2363 2002-12-22 Bruno Haible <bruno@clisp.org>
2365 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
2367 2002-12-23 Bruno Haible <bruno@clisp.org>
2369 * getline.h: Include <stddef.h>, for size_t.
2371 * unicodeio.h: Include <stddef.h>, for size_t.
2372 * unicodeio.c: Don't include <stddef.h>.
2374 2002-12-17 Bruno Haible <bruno@clisp.org>
2376 * canon-host.c (strdup): Remove unused declaration.
2378 * fsusage.c: Include full_read.h.
2379 (get_fs_usage): Use full_read instead of safe_read.
2381 * utime.c (utime_null): Use SAFE_READ_ERROR.
2383 2002-12-11 Bruno Haible <bruno@clisp.org>
2385 * setenv.h: Rewritten to cope with systems that have setenv() but not
2387 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
2390 2002-12-11 Bruno Haible <bruno@clisp.org>
2392 * setenv.c (alloca): Fall back to malloc.
2394 (setenv): Use freea() to free memory allocated with alloca().
2396 2002-11-13 Bruno Haible <bruno@clisp.org>
2398 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
2399 function declarations.
2400 * unsetenv.c (unsetenv): Likewise.
2402 2002-03-04 Bruno Haible <bruno@clisp.org>
2404 Portability to AIX 4.3.3.
2405 * unsetenv.c: New file, extracted from setenv.c.
2406 * setenv.c: Move the unsetenv() function to unsetenv.c.
2408 2001-12-20 Bruno Haible <bruno@clisp.org>
2410 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
2411 use malloc instead. For SunOS 4.
2413 2001-12-11 Bruno Haible <bruno@clisp.org>
2415 * setenv.c: Declare alloca.
2416 (compar_fn_t): New typedef.
2417 (KNOWN_VALUE, STORE_VALUE): Use it.
2419 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
2422 2002-12-10 Paul Eggert <eggert@twinsun.com>
2424 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
2425 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
2426 Choose values that are less likely to collide with system fnmatch
2428 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
2429 defined (e.g., a pure POSIX system).
2430 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
2431 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
2433 2002-12-06 Jim Meyering <jim@meyering.net>
2435 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
2437 Merge in changes from libc's misc/error.c, in preparation
2438 for the merge of gnulib's changes back into libc.
2440 * error.c (_): Define only if not already defined.
2441 Move definition to follow all #include directives.
2442 Include unlocked-io.h only if !_LIBC.
2443 [_LIBC]: Include <libio/libioP.h>.
2444 [USE_IN_LIBIO]: Include <libio/iolibio.h>
2445 (fflush): Tweak definition to use INTUSE.
2448 2002-12-05 Paul Eggert <eggert@twinsun.com>
2450 * alloca.c [defined emacs]: Include "lisp.h".
2451 (xalloc_die) [defined emacs]: New macro.
2452 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
2453 [! defined emacs]: Include <xalloc.h>.
2454 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
2455 (pointer): Typedef to POINTER_TYPE *.
2456 (malloc): Remove decl; we now always use xmalloc.
2457 (alloca): Use old-style definition, since Emacs needs this.
2458 Check for arithmetic overflow when computing combined size.
2460 2002-12-04 Paul Eggert <eggert@twinsun.com>
2462 Do not generate unlocked-io.h automatically, since it's easier to
2463 maintain it by hand.
2465 * unlocked-io.h: New file, from GNU diffutils,
2466 but with proper copyright notice and attribution.
2468 * Makefile.am: Add copyright notice.
2469 (libfetish_a_SOURCES): Add unlocked-io.h.
2470 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
2471 (DISTCLEANFILES, io_functions): Remove macros.
2472 (EXTRA_DIST): Remove gen_uio.
2473 (unlocked-io.h): Remove rule.
2475 2002-12-04 Jim Meyering <jim@meyering.net>
2477 Reflect the fact that stat.c and lstat.c are no longer generated.
2478 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
2479 (DISTCLEANFILES): Likewise.
2480 (EXTRA_DIST): Likewise.
2481 (all_local): Don't depend on stat.c or lstat.c.
2482 (stat.c, lstat.c): Remove rules.
2483 (EXTRA_DIST): Remove xstat.in.
2485 * xstat.in: Remove file. Contents moved into stat.c.
2486 * stat.c: New file. Contents mostly from xstat.in.
2487 * stat.c: Rework so that it may serve to define rpl_lstat, too.
2488 * lstat.c: New file. Simply #define LSTAT and include stat.c.
2490 * safe-read.c: Rework so that it may serve to define safe_write, too.
2491 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
2493 2002-12-03 Jim Meyering <jim@meyering.net>
2495 * safe-read.c, safe-write.c: Change variable names and comments, but
2496 not semantics, to minimize the differences between these two files.
2497 (safe_read): Change comment to mention SAFE_READ_ERROR.
2499 * safe-read.c (IS_EINTR): Define.
2500 (safe_read): Use IS_EINTR in place of in-function cpp directives.
2502 2002-12-02 Bruno Haible <bruno@clisp.org>
2504 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
2505 Define, taken from safe-read.c.
2506 (INT_MAX): Provide fallback.
2507 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
2508 * safe-write.h (SAFE_WRITE_ERROR): Define.
2510 * safe-read.c (EINTR): Remove definition.
2511 (safe_read): Don't use EINTR if it is absent.
2513 2002-12-02 Jim Meyering <jim@meyering.net>
2515 * safe-read.c (EINTR): Define.
2516 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
2517 (INT_MAX): Provide fallback.
2518 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
2520 * safe-read.h (SAFE_READ_ERROR): Define.
2522 2002-12-01 Jim Meyering <jim@meyering.net>
2524 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
2525 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
2527 2002-11-27 Paul Eggert <eggert@twinsun.com>
2529 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2530 hash_rehash): Replace `if (limit <= value) abort ();' with
2531 `if (! (value < limit)) abort ();', for readability.
2533 2002-11-26 <karl@gnu.org>
2535 * strdup.c: copy from libc again, with jim's ok.
2536 * .cppi-disable: re-add strdup.c
2538 2002-11-25 <karl@gnu.org>
2540 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
2541 instead of "strtol.c".
2543 2002-11-25 Jim Meyering <jim@meyering.net>
2545 * mktime.c: Sync from libc, now that it has the latest fix.
2547 2002-11-24 <karl@gnu.org>
2549 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
2550 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
2552 2002-11-24 Jim Meyering <jim@meyering.net>
2554 Update from coreutils:
2556 * mktime.c: Merge in changes from libc.
2558 Avoid a link-time failure on some Linux systems.
2559 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
2560 (__mon_yday): Declare with the STATIC attribute.
2561 (__mktime_internal): Likewise.
2562 Based on a report from Greg Schafer.
2564 2002-11-23 Jim Meyering <jim@meyering.net>
2566 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
2567 Use `unsigned', not `int', as type of index.
2569 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
2571 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
2573 2002-11-22 Paul Eggert <eggert@twinsun.com>
2575 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
2576 hint that one should use `if (! x) abort ();' rather than `assert
2577 (x);', and anyway it's one less thing to worry about configuring.
2578 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2579 hash_rehash, hash_insert): Use abort rather than assert.
2581 2002-11-22 Paul Eggert <eggert@twinsun.com>
2583 * quotearg.h: Allow multiple inclusion by surrounding with
2584 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
2585 so that we can be included first.
2586 (PARAMS): Remove; we now assume C89 or later. All uses removed.
2587 * quotearg.c: Include quotearg.h immediately after config.h.
2588 No need to include stddef.h or sys/types.h any more.
2589 Surround local include files with "", not "<>".
2590 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
2591 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
2592 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
2593 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
2594 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
2595 (ISPRINT): Remove; no longer needed now that we assume C89.
2597 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
2600 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
2601 quotearg_char): Use SIZE_MAX rather than
2602 (size_t) -1 when we are talking about "infinity".
2604 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
2606 2002-11-22 Bruno Haible <bruno@clisp.org>
2608 * safe-read.h: Assume C89. Add comments.
2609 (safe_read): Change return type to size_t.
2610 * safe-read.c (safe_read): Change return type to size_t. Handle byte
2611 counts > SSIZE_MAX correctly.
2612 * safe-write.h: New file.
2613 * safe-write.c: New file.
2614 * full-read.h: New file.
2615 * full-read.c: New file.
2616 * full-write.h: Assume C89. Add comments.
2617 * full-write.c: Include safe-write.h.
2618 (full_write): Rewritten to use safe_write.
2619 Suggested by Jim Meyering and Paul Eggert.
2621 2002-11-21 Bruno Haible <bruno@clisp.org>
2623 Remove case insensitive option matching.
2624 * argmatch.h (argcasematch): Remove declaration.
2625 (ARGCASEMATCH): Remove macro.
2626 (__xargmatch_internal): Remove case_sensitive argument.
2627 (XARGMATCH): Update.
2628 (XARGCASEMATCH): Remove macro.
2629 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
2630 case_sensitive argument.
2631 (argcasematch): Remove function.
2632 (__xargmatch_internal): Remove case_sensitive argument.
2633 (main): Use XARGMATCH instead of XARGCASEMATCH.
2635 * xmalloc.c: Change compile-time error message. Add comment about
2636 required autoconf version.
2638 2002-11-21 Jim Meyering <jim@meyering.net>
2640 * strdup.c (strdup): Tweak comment and initial #if/#include.
2642 Merge in changes from the coreutils.
2644 2002-09-25 Paul Eggert <eggert@twinsun.com>
2645 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
2646 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
2647 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
2648 int. Work more efficiently if X is the same width as uintmax_t.
2649 Do not compare X to -1, to avoid bogus compiler warning.
2650 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
2651 Don't assume that f_frsize and f_bsize are the same type.
2653 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
2656 * makepath.c (make_path): Restore umask *before* creating the final
2658 (make_path): Minor reformatting.
2660 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
2661 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
2663 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
2664 ones. At least on GNU/Linux systems, `auto' means something else.
2667 2002-11-20 Paul Eggert <eggert@twinsun.com>
2669 Merge argmatch cleanups from Bison. Assume C89.
2671 * argmatch.c: Include config.h here, not in argmatch.h.
2672 Include stdlib.h, for EXIT_FAILURE.
2673 Always include <string.h>, since we assume C89.
2674 (EXIT_FAILURE): Remove pre-C89 bug workaround.
2675 * argmatch.h: Do not include <config.h> or <sys/types.h>.
2676 Include <stddef.h> instead, since it's all we need for size_t.
2677 (PARAMS): Remove. All uses removed.
2678 (ARRAY_CARDINALITY): Do not bother to #undef.
2679 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
2680 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2681 Remove unnecessary parentheses.
2682 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2683 Insert necessary parentheses.
2684 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
2685 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
2687 2002-11-19 Bruno Haible <bruno@clisp.org>
2689 * mbswidth.c: Include mbswidth.h right at the beginning.
2690 * mbswidth.h: Include <stddef.h>, for size_t.
2692 * mbswidth.h (PARAMS): Remove macro.
2693 (mbswidth, mbsnwidth): Use ANSI C function declarations.
2694 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
2696 * gcd.h (PARAMS): Remove macro.
2697 (gcd): Use ANSI C function declarations.
2698 * gcd.c (gcd): Likewise.
2700 2002-11-15 Bruno Haible <bruno@clisp.org>
2702 * strcspn.c: Include <stddef.h>.
2703 (strcspn): Use ANSI C function declaration. Change return type to
2705 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
2706 (strpbrk): Use NULL.
2707 * strpbrk.h (PARAMS): Remove macro.
2708 (strpbrk): Use ANSI C function declaration.
2709 * strstr.c: Don't include <sys/types.h>.
2710 * strstr.h (PARAMS): Remove macro.
2711 (strstr): Use ANSI C function declarations.
2713 2002-11-06 Bruno Haible <bruno@clisp.org>
2715 * gcd.h (gcd): Change argument type to 'unsigned long'.
2716 * gcd.c (gcd): Likewise.
2718 2002-11-05 Bruno Haible <bruno@clisp.org>
2720 * gcd.h: New file, from gettext-0.11.5.
2721 * gcd.c: New file, from gettext-0.11.5.
2723 2002-11-05 Bruno Haible <bruno@clisp.org>
2725 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2726 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2727 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2728 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2730 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2731 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2733 * closeout.c: Include gettext.h instead of <libintl.h>.
2734 * human.c: Include gettext.h instead of <libintl.h>.
2735 * quotearg.c: Include gettext.h instead of <libintl.h>.
2736 * rpmatch.c: Include gettext.h instead of <libintl.h>.
2737 * unicodeio.c: Include gettext.h instead of <libintl.h>.
2738 * userspec.c: Include gettext.h instead of <libintl.h>.
2739 * version-etc.c: Include gettext.h instead of <libintl.h>.
2740 * xmalloc.c: Include gettext.h instead of <libintl.h>.
2741 (textdomain): Remove definition.
2742 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
2744 * long-options.c: Remove include of <libintl.h> and definition of _.
2745 * same.c: Remove include of <libintl.h> and definition of _.
2747 2002-11-04 Bruno Haible <bruno@clisp.org>
2749 * stpcpy.h: New file, from GNU gettext-0.11.5.
2750 * strcase.h: New file, from GNU gettext-0.11.5.
2751 * strpbrk.h: New file, from GNU gettext-0.11.5.
2752 * strstr.h: New file, from GNU gettext-0.11.5.
2753 * xgetcwd.h: New file, from GNU gettext-0.11.5.
2755 2002-05-09 Bruno Haible <bruno@clisp.org>
2757 * config.charset: Update for newest glibc. Add canonical names
2758 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
2760 2002-05-09 Bruno Haible <bruno@clisp.org>
2762 * localcharset.c (get_charset_aliases): Add more Windows specific
2765 2002-05-08 Owen Taylor <otaylor@redhat.com>
2767 * config.charset: A few additions for Solaris.
2769 2001-12-05 Bruno Haible <bruno@clisp.org>
2771 * localcharset.c (locale_charset): Don't return an empty string.
2773 2001-10-23 Bruno Haible <haible@clisp.cons.org>
2775 * config.charset: msdos in uk_UA uses CP1125.
2777 2001-08-05 Bruno Haible <haible@clisp.cons.org>
2779 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
2780 * localcharset.c (locale_charset): Declare as extern "C".
2782 2002-02-15 Bruno Haible <bruno@clisp.org>
2784 * config.charset [msdosdjgpp]: For Russian, use CP866.
2786 2002-02-11 Bruno Haible <bruno@clisp.org>
2788 * config.charset: Add support for NetBSD.
2790 2002-09-25 <karl@gnu.org>
2792 * strdup.c: copy from libc/string (via ../config/srclist*).
2793 * getopt*: copy from libc/posix.
2794 * gettext.h: copy from gettext.
2795 * .cppi-disable: add strdup.c, gettext.h.
2797 2002-07-01 Jim Meyering <meyering@lucent.com>
2799 * c-stack.c: Include sys/time.h.
2800 From Volker Borchert.
2802 2002-06-11 Paul Eggert <eggert@twinsun.com>
2804 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
2805 New macro. Use it uniformly instead of
2806 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
2807 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
2808 reported by Vin Shelton.
2810 2002-06-22 Jim Meyering <meyering@lucent.com>
2812 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
2813 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
2815 2002-06-22 Paul Eggert <eggert@twinsun.com>
2817 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
2818 Do not assume SA_SIGINFO behavior.
2819 Bug reported by Jim Meyering on NetBSD 1.5.2.
2821 2002-06-22 Jim Meyering <meyering@lucent.com>
2823 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
2825 * exitfail.c, exitfail.h: Likewise.
2826 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
2828 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
2830 (EXTRA_DIST): Add fnmatch_loop.c.
2831 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
2833 * fnmatch_loop.c: New file, from diffutils-2.8.2.
2834 * fnmatch.c: Update from diffutils-2.8.2.
2835 * fnmatch_.h: New file. From diffutils-2.8.2.
2836 * fnmatch.h: Remove file.
2838 2002-06-18 Paul Eggert <eggert@twinsun.com>
2840 * file-type.h: Report an error if neither S_ISREG nor
2841 S_IFREG is defined, instead of using a test specific to glibc
2842 2.2. This should be safe, since POSIX requires S_ISREG and
2843 Unix Version 7 had S_IFREG. We don't need to check for
2844 <sys/types.h> since we don't use any symbols that it defines.
2846 2002-06-15 Jim Meyering <meyering@lucent.com>
2848 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
2849 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
2850 have been included before this file.
2852 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
2854 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
2855 so that each temporary file name is unique and valid in the first
2856 8 characters, for operation under DOS.
2858 2002-06-15 Jim Meyering <meyering@lucent.com>
2860 Work even with DJGPP 2.03, which lacks support for symlinks.
2862 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
2864 * lchown.c (S_ISLNK): Likewise.
2866 2002-06-14 Jim Meyering <meyering@lucent.com>
2868 * file-type.h: Use the version from diffutils-2.8.2.
2869 * file-type.c: Likewise.
2871 2002-05-27 Jim Meyering <meyering@lucent.com>
2873 Fix a problem seen only on nonconforming systems whereby ls.c's
2874 use of localtime, and then of gettimeofday would cause trouble:
2875 the localtime call used to initialize rpl_gettimeofday's save
2876 mechanism would clobber ls's current local time information so
2877 that in any long listing the first file would always be listed
2878 with date 1970-01-01. Analysis by Volker Borchert.
2880 * gettimeofday.c (localtime): Undefine.
2881 (rpl_localtime): New function.
2883 2002-05-22 Jim Meyering <meyering@lucent.com>
2885 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
2886 * file-type.h: New file.
2887 * file-type.c (file_type): New file/function. Extracted from diffutils.
2889 2002-04-29 Paul Eggert <eggert@twinsun.com>
2891 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
2893 2002-04-28 Paul Eggert <eggert@twinsun.com>
2895 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
2896 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
2897 of 127, since 64 is the largest conceivable number for ancient
2899 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
2901 2002-04-28 Jim Meyering <meyering@lucent.com>
2903 * sig2str.c (WTERMSIG): Remove definition (unused).
2905 2002-04-28 Paul Eggert <eggert@twinsun.com>
2907 * sig2str.h, sig2str.c: New files.
2908 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
2910 2002-04-24 Jim Meyering <meyering@lucent.com>
2912 * gettext.h: New file, from Gettext.
2913 * Makefile.am (INCLUDES): Remove -I../intl.
2914 (libfetish_a_SOURCES): Add gettext.h.
2916 2002-04-16 Jim Meyering <meyering@lucent.com>
2918 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
2919 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
2920 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
2922 2002-04-12 Jim Meyering <meyering@lucent.com>
2924 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
2926 2002-03-10 Jim Meyering <meyering@lucent.com>
2928 * makepath.c (make_path): Remove a comma from a diagnostic.
2929 Suggestion from Santiago Vila.
2931 2002-03-08 Jim Meyering <meyering@lucent.com>
2933 * rename.c: Mention that this wrapper is needed also on
2934 mips-dec-ultrix4.4 systems.
2936 2002-03-02 Jim Meyering <meyering@lucent.com>
2938 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
2939 not HAVE_CLOCK_SETTIME.
2941 2002-02-27 Paul Eggert <eggert@twinsun.com>
2943 * nanosleep.h: Rename to....
2944 * timespec.h: New name for nanosleep.h. All uses changed.
2946 * gettime.c: New file.
2947 * settime.c: New file.
2950 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
2951 timespec.h. Remove nanosleep.h.
2953 2002-02-25 Paul Eggert <eggert@twinsun.com>
2955 * acl.c, acl.h: New files.
2956 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
2958 2002-02-24 Jim Meyering <meyering@lucent.com>
2960 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
2961 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
2962 cause trouble. Reported by Nelson Beebe.
2964 2002-02-23 Paul Eggert <eggert@twinsun.com>
2966 * path-concat.c (xpath_concat): Reorder code to pacify
2967 compilers that don't know that xalloc_die never returns.
2969 2002-02-20 Jim Meyering <meyering@lucent.com>
2971 * getdate.c: Regenerate using bison-1.33.
2973 2002-02-15 Paul Eggert <eggert@twinsun.com>
2975 * posixver.c, posixver.h: New files.
2976 * Makefile.am (libfetish_a_SOURCES): Add them.
2978 2002-02-02 Paul Eggert <eggert@twinsun.com>
2979 Bruno Haible <bruno@clisp.org>
2981 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
2982 (fwrite_success_callback): New declaration.
2983 * unicodeio.c (unicode_to_mb): New function, extracted from
2984 print_unicode_char. Call failure callback instead of error.
2985 (fwrite_success_callback): New function.
2986 (exit_failure_callback): New function.
2987 (fallback_failure_callback): New function.
2988 (print_unicode_char): Call unicode_to_mb.
2990 2002-01-26 Jim Meyering <meyering@lucent.com>
2992 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
2994 2002-01-22 Jim Meyering <meyering@lucent.com>
2996 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
2997 Otherwise, some versions of automake would omit the rule that makes
2998 Makefile from Makefile.in.
3000 2001-01-21 Paul Eggert <eggert@twinsun.com>
3002 * xmemcoll.h, xmemcoll.c: New files.
3003 * Makefile.am (libfetish_a_SOURCES): Add them.
3004 * memcoll.c: Include errno.h, and declare errno if not defined.
3005 (memcoll): Set errno to zero if there is no error.
3007 * quotearg.c (quotearg_buffer_restyled):
3008 Fix bug with quoting buffers containing NUL when backslashing escapes.
3009 This bug was exposed by the other changes in this patch.
3010 (quotearg_n_options): New arg ARGSIZE.
3011 All callers changed.
3012 (quoting_options_from_style): New function.
3013 (quotearg_n_style): Use it.
3014 (quotearg_n_style_mem): New function.
3016 * quotearg.h (quotearg_n_style_mem): New function.
3018 2002-01-16 Jim Meyering <meyering@lucent.com>
3020 * getdate.y: Add three semicolons, each just before a closing brace.
3021 Bison (as of version 1.31) no longer papers over that mistake.
3023 2002-02-14 Paul Eggert <eggert@twinsun.com>
3025 * backupfile.c (ISDIGIT): Comment fix.
3026 * getdate.y (ISDIGIT): Likewise.
3027 * posixtm.c (ISDIGIT, year): Likewise.
3028 * strverscmp.c (ISDIGIT): Likewise.
3029 * userspec.c (ISDIGIT): Likewise.
3031 2002-01-05 Jim Meyering <meyering@lucent.com>
3033 * version-etc.c (version_etc_copyright): Update copyright year.
3035 2001-01-19 Paul Eggert <eggert@twinsun.com>
3037 * closeout.c (close_stdout_status): If ferror (stdout), do
3038 not silently exit merely because the output buffer happens to
3039 have nothing pending.
3041 2001-12-18 Paul Eggert <eggert@twinsun.com>
3043 See the big note in ../ChangeLog.
3044 * human.c (suffixes): Prefer K to k for 1024.
3045 (generate_suffix_backwards): New function.
3046 (human_readable_inexact): Use it.
3047 * xstrtol.c (__xstrtol): If there is no number but there
3048 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
3049 Accept 'K' as well as 'k'.
3051 2001-12-15 Jim Meyering <meyering@lucent.com>
3053 * regex.h (__restrict_arr): Update from libc.
3055 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
3056 as `remote' if the name starts with `//'. Suggested by Michael Stone.
3059 2001-12-10 Jim Meyering <meyering@lucent.com>
3061 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
3062 Instead, include "xalloc.h".
3063 (initbuffer): Don't cast xmalloc return value to char*.
3064 (readline): Reword comment.
3065 Don't cast xrealloc return value to char*
3068 2001-12-09 Jim Meyering <meyering@lucent.com>
3070 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
3071 `signed and unsigned type in conditional expression'.
3072 * posixtm.c (posix_time_parse): Likewise.
3074 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
3076 * readtokens.c (readtoken): Declare an index to be of type unsigned
3077 to avoid a pedantic warning.
3079 * getstr.c: Don't include assert.h.
3080 (getstr): Remove warning-evoking assertions.
3081 Return -1 if offset parameter is out of bounds.
3082 Change the type of a local from int to size_t.
3084 * strftime.c (my_strftime_localtime_r): Include this function
3085 definition in the `#if ! HAVE_TM_GMTOFF' block.
3087 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
3088 Include xalloc.h instead.
3090 2001-12-02 Jim Meyering <meyering@lucent.com>
3092 * tempname.c: Don't declare getenv, thus reverting the change of
3093 2001-11-18. It's no longer necessary, now that stdlib.h is always
3096 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
3097 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
3099 2001-11-30 Akim Demaille <akim@epita.fr>
3101 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
3102 before being defined.
3104 2001-11-27 Paul Eggert <eggert@twinsun.com>
3106 * quotearg.h (quotearg_n, quotearg_n_style):
3107 First arg is int, not unsigned.
3108 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
3109 (SIZE_MAX, UINT_MAX): New macros.
3110 (quotearg_n_options): Abort if N is negative.
3111 Avoid overflow check on hosts where size_t is 64 bits and int
3112 is 32 bits, as overflow is impossible there.
3113 Fix off-by-one typo that caused unnecessary reallocation.
3115 2001-11-27 Jim Meyering <meyering@lucent.com>
3117 * tempname.c: Merge with version from libc.
3118 * regex.c: Likewise.
3120 * tempname.c: Include stdlib.h unconditionally. On some old systems
3121 for which STDC_HEADERS is 0, it was not included, resulting in a
3122 warning about an integer-to-pointer conversion problem with getenv.
3123 Reported by Volker Borchert.
3125 2001-11-26 Jim Meyering <meyering@lucent.com>
3127 * gtod.h: Remove file.
3128 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
3129 * gettimeofday.c: Don't include gtod.h.
3130 (GTOD_init): Remove function.
3131 (rpl_gettimeofday): Do its job here instead, rather than aborting.
3132 Suggestion from Volker Borchert.
3134 2001-11-23 Jim Meyering <meyering@lucent.com>
3136 * hash.h (struct hash_table): Don't define here. Merely declare it.
3137 * hash.c (struct hash_table): Define it here instead.
3139 2001-11-22 Jim Meyering <meyering@lucent.com>
3141 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
3143 2001-11-18 Paul Eggert <eggert@twinsun.com>
3145 * tempname.c (TMP_MAX): Remove; no longer needed.
3146 (TEMPORARIES): New macro.
3147 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
3148 removes an artificial limitation (e.g. HP-UX 10.20, where
3151 2001-11-18 Jim Meyering <meyering@lucent.com>
3153 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
3156 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
3157 files will be created before anything else.
3159 2001-11-17 Jim Meyering <meyering@lucent.com>
3161 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
3162 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
3163 rather than group writable. Patch by Juan F. Codagnone.
3165 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
3166 Instead, include "xalloc.h".
3168 * mountlist.c: Include unlocked-io.h after all system headers.
3169 Remove explicit declarations of xmalloc, xrealloc,
3170 and xstrdup. Instead, include "xalloc.h".
3172 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
3173 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
3174 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
3176 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
3177 Reported by Padraig Brady.
3179 * mkstemp.c: #undef mkstemp.
3181 (rpl_mkstemp): Rename from mkstemp.
3184 2001-11-16 Jim Meyering <meyering@lucent.com>
3186 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
3187 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
3188 determine the amount of total physical memory, use pstat_getstatic.
3189 HPUX-11 doesn't define _SC_PHYS_PAGES.
3190 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
3191 If sysconf couldn't be used to determine the amount of available
3192 physical memory, use both pstat_getstatic and pstat_getdynamic.
3193 Based on a patch from Bob Proulx.
3195 2001-11-05 Jim Meyering <meyering@lucent.com>
3197 * xstat.in (slash_aware_lstat): Correct a misleading comment.
3199 2001-11-03 Jim Meyering <meyering@lucent.com>
3201 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
3202 in argmatch_to_argument call.
3204 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
3207 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
3208 e.g., a fault due to an attempt to free a NULL pointer.
3210 2001-11-01 Jim Meyering <meyering@lucent.com>
3212 * dirfd.c, dirfd.h: New files.
3213 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
3215 * hash.c (hash_print) [TESTING]: Clean up.
3217 2001-10-22 Paul Eggert <eggert@twinsun.com>
3219 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
3220 to avoid a warning if -Wall.
3222 2001-10-21 Paul Eggert <eggert@twinsun.com>
3224 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
3226 2001-10-21 Jim Meyering <meyering@lucent.com>
3228 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
3229 this code would end up calling gettext even in packages built
3231 * getopt.c (_): Likewise.
3232 * regex.c (_): Likewise.
3234 2001-10-20 Paul Eggert <eggert@twinsun.com>
3236 * error.c (strerror_r): Do not declare unless !_LIBC.
3237 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
3238 Use strerror_r that is only a macro, even if it is not a function.
3239 (strerror): Check for HAVE_DECL_STRERROR before declaring.
3240 (private_strerror): Use prototypes, not old-style function definition.
3241 (print_errno_message): New function.
3242 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
3244 (error_tail, error, error_at_line): Use it.
3246 2001-10-11 Jim Meyering <meyering@lucent.com>
3248 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
3249 and quote_n (1, ... to avoid clobbering a buffer.
3251 2001-10-05 Jim Meyering <meyering@lucent.com>
3253 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
3254 * hash-pjw.c: New file (factored out of fileutils' remove.c).
3255 * hash-pjw.h: New file.
3257 2001-09-30 Jim Meyering <meyering@lucent.com>
3259 * mountlist.c [MOUNTED_GETFSSTAT]:
3260 Include <sys/ucred.h>, for Apple Darwin.
3261 Include sys/mount.h and sys/fs_types.h only if available.
3263 (read_filesystem_list): Use FS_TYPE.
3265 2001-09-29 Paul Eggert <eggert@twinsun.com>
3267 * exclude.c (excluded_filename): 0 -> false, since it's
3270 2001-09-28 Paul Eggert <eggert@twinsun.com>
3272 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
3273 #defines strtoimax. Also treat the other strto* functions
3276 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
3277 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
3278 (strtoimax, strtoumax): Do not declare if already defined as a macro.
3280 2001-09-26 Jim Meyering <meyering@lucent.com>
3282 Most macros in unlocked-io.h had the wrong number of arguments.
3283 * gen-uio: New script.
3284 (USE_UNLOCKED_IO): Define to 1 if not already defined.
3285 * unlocked-io.hin: Remove file.
3286 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
3287 rather than trying to embed it here.
3288 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
3289 Reported by Padraig Brady.
3291 2001-09-25 Volker Borchert <bt@teknon.de>
3293 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
3295 2001-09-23 Jim Meyering <meyering@lucent.com>
3297 * mountlist.c: Remove useless parentheses in #if directives.
3298 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
3299 the deprecated MOUNTED symbol is no longer defined in mntent.h.
3301 2001-09-22 Jim Meyering <meyering@lucent.com>
3303 * localcharset.c: Update from latest gettext.
3304 * config.charset: Likewise.
3306 2001-09-20 Jim Meyering <meyering@lucent.com>
3308 * xstrtol.c (strtoimax): Guard declaration with
3309 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
3310 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
3311 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
3312 (strtoumax): Likewise, for completeness (it wasn't necessary).
3314 2001-09-06 Paul Eggert <eggert@twinsun.com>
3316 * strtoimax.c (HAVE_LONG_LONG):
3317 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
3318 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
3319 to work around bug in IBM C compiler.
3321 2001-09-16 Jim Meyering <meyering@lucent.com>
3323 * mkdir.c: New file.
3325 2001-09-04 Paul Eggert <eggert@twinsun.com>
3327 * xgetcwd.c: Revert some of the previous change; intead,
3328 fix the HAVE_GETCWD_NULL code to behave more like the
3329 !HAVE_GETCWD_NULL code used to.
3332 (xgetcwd): Do not return NULL when memory is exhausted; instead,
3335 2001-09-04 Paul Eggert <eggert@twinsun.com>
3337 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
3338 Use ssize_t, not int, to store result of readlink.
3339 Check for ssize_t overflow as well as size_t overflow,
3340 as POSIX says the result of readlink is implementation-defined
3341 when ssize_t overflows.
3342 Remove unnecessary cast to char*.
3343 Use free+malloc instead of realloc, as the storage doesn't need
3344 to be preserved and it's clearer and can be more efficient that way.
3345 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
3346 * xreadlink.h (xreadlink): Update prototype.
3348 2001-09-03 Paul Eggert <eggert@twinsun.com>
3350 * exclude.c (fnmatch_no_wildcards): Fix confusion between
3351 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
3352 spotted by Jim Meyering.
3354 2001-09-03 Jim Meyering <meyering@lucent.com>
3356 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
3358 2001-09-03 Paul Eggert <eggert@twinsun.com>
3360 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
3361 like the HAVE_GETCWD_NULL code.
3362 Include pathmax.h if not HAVE_GETCWD.
3363 Do not include xalloc.h.
3364 (INITIAL_BUFFER_SIZE): New symbol.
3365 Do not use xmalloc / xrealloc, since the caller is responsible for
3366 handling errors. Preserve errno around `free' during failure.
3367 Do not overrun buffer when using getwd.
3369 2001-09-03 Paul Eggert <eggert@twinsun.com>
3371 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
3372 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
3374 2001-09-02 Jim Meyering <meyering@lucent.com>
3376 * error.c: Update from GNU libc.
3378 2001-09-01 Jim Meyering <meyering@lucent.com>
3380 * xreadlink.c: New file.
3381 * xreadlink.h: New file.
3382 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
3384 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
3385 doesn't conflict with sparc Solaris 7's definition in
3386 /usr/include/sys/int_types.h.
3388 * exclude.c: Use `""', not `<>' to #include non-system header files.
3389 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
3390 and strncasecmp as r-values. Unixware didn't have declarations.
3392 2001-08-31 Jim Meyering <meyering@lucent.com>
3394 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
3395 Use an initial, malloc'd, buffer of length 128 rather than
3396 a statically allocated one of length 1024.
3398 2001-08-30 Paul Eggert <eggert@twinsun.com>
3400 * xgetcwd.c: Don't include pathmax.h.
3401 Include stdlib.h and unistd.h if available.
3403 (xmalloc, xstrdup, free): Remove decls.
3404 (xgetcwd): Don't assume sizes fit in unsigned.
3405 Check for overflow when computing sizes.
3406 Simplify reallocation code.
3408 2001-08-28 Paul Eggert <eggert@twinsun.com>
3410 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
3412 * strtoimax.c: Renamed from strtoxmax.c, removing the
3415 Also, make the following further changes to make this file's
3416 configuration more similar to that of strtol.c:
3417 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
3418 (strtoumax, uintmax_t, strtoull, strtol): Remove.
3419 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
3420 (strtoimax): Renamed from strtoumax. All uses of unsigned values
3421 changed to signed values.
3423 And make the following changes as well:
3424 Fix copyright notice, as 1999 was missing.
3425 (verify): New macro.
3426 (strtoimax): Check sizes at compile-time, not run-time.
3427 Prefer strtol to strtoll if both work.
3428 (main): Remove; it was not that useful and was a pain to maintain.
3430 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
3432 2001-08-30 Paul Eggert <eggert@twinsun.com>
3434 * savedir.c (savedir): Remove size parameter, as POSIX says that
3435 a directory's st_size can have an arbitrary value, so the old
3436 usage could waste an arbitrary amount of memory. All uses
3438 * savedir.h: Update prototype.
3440 2001-08-30 Paul Eggert <eggert@twinsun.com>
3442 * xstrtol.c (strtoimax): New decl.
3444 2001-08-28 Paul Eggert <eggert@twinsun.com>
3446 * xstrtol.h: Add copyright notice.
3447 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
3448 LONGINT_INVALID_SUFFIX_CHAR.
3450 2001-08-30 Paul Eggert <eggert@twinsun.com>
3452 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
3455 2001-08-30 Paul Eggert <eggert@twinsun.com>
3457 * hash.c: Remove '2001' from copyright notice.
3459 2001-08-30 Paul Eggert <eggert@twinsun.com>
3461 * full-write.h: New file.
3462 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
3463 * full-write.c: Correct credits, as cccp.c no longer
3464 exists and anyway it was so heavily changed from the old cccp
3465 code as to be unrecognizable. Include full-write.h.
3466 (full_write) Return size_t, with short writes meaning failure.
3467 All callers changed. This fixes a bug with large buffers
3469 * utime.c: Include full-write.h.
3471 2001-08-30 Paul Eggert <eggert@twinsun.com>
3473 Merge 'exclude' changes from tar 1.13.22.
3474 This fixes one or two unlikely storage allocation overflow bugs,
3475 but doesn't change user-visible behavior otherwise.
3477 2001-08-30 Paul Eggert <eggert@twinsun.com>
3479 * exclude.c (bool): Declare, perhaps by including stdbool.h.
3480 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
3481 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
3482 Include if available.
3483 (<xalloc.h>): Include
3484 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
3485 (verify): New macro. Use it to verify that EXCLUDE macros do not
3486 collide with FNM macros.
3487 (struct patopts): New struct.
3488 (struct exclude): Use it, as exclude patterns now come with options.
3489 (new_exclude): Support above changes.
3490 (new_exclude, add_exclude_file):
3491 Initial size must now be a power of two to simplify overflow checking.
3492 (free_exclude, fnmatch_no_wildcards): New function.
3493 (excluded_filename): No longer requires options arg, as the options
3494 are determined by add_exclude. Now returns bool, not int.
3495 (excluded_filename, add_exclude):
3496 Add support for the fancy new exclusion options.
3497 (add_exclude, add_exclude_file): Now takes int options arg.
3498 Check for arithmetic overflow when computing sizes.
3499 (add_exclude_file): xrealloc might modify errno, so don't
3500 realloc until after errno might be used.
3502 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
3504 (free_exclude): New decl.
3505 (add_exclude, add_exclude_file): Now takes int options arg.
3506 (excluded_filename): No longer requires options arg, as the options
3507 are determined by add_exclude. Now returns bool, not int.
3509 2001-08-30 Paul Eggert <eggert@twinsun.com>
3511 * alloca.c (alloca): Arg is of type size_t, not unsigned.
3513 2001-08-27 Jim Meyering <meyering@lucent.com>
3515 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
3517 * version-etc.c (N_): Remove definition.
3518 Revert most of last change.
3519 Instead, simply don't mark the `Copyright...' string for translation.
3520 Based on advice from Paul Eggert.
3522 * strtoxmax.c: Tweak comment.
3524 2001-08-26 Jim Meyering <meyering@lucent.com>
3526 * version-etc.c (version_etc_copyright_fmt): Replace literal year
3527 of copyright with `%s' so translators don't get an untranslated
3529 (COPYRIGHT_YEAR): Define.
3530 (version_etc): Use fprintf rather than fputs.
3531 Suggestion from Ulrich Drepper.
3533 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
3535 * strtoll.c: New file, from GNU libc.
3536 * xstrtoimax.c: New file.
3538 * xstrtol.h: Add xstrtoimax.
3539 * strtoumax.c: New file. Simply include "strtoumax.c".
3540 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
3542 * strtoumax.c: Factor to work both for unsigned and signed types, ...
3543 * strtoxmax.c: ... then renamed to this.
3545 2001-08-13 Paul Eggert <eggert@twinsun.com>
3547 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
3548 Port to Solaris 8, where 'sed' requires a space after the 'r'
3549 command, and where sh dislikes "$/". Clean up the spacing a bit.
3550 Redirect output to $tmp just once.
3552 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
3554 * addext.c (<errno.h>): Include.
3555 (errno): Declare if not defined.
3556 (addext): Work correctly when pathconf returns -1 and leaves
3557 errno alone because there is no limit. Also, work even if
3558 pathconf returns a value greater than SIZE_MAX.
3560 2001-08-12 Jim Meyering <meyering@lucent.com>
3562 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
3563 Simply `return getcwd (NULL, 0);'.
3564 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
3565 Use 1300 as initial value for length, not PATH_MAX.
3567 * pathmax.h: Clean up cpp syntax.
3569 2001-08-12 Jim Meyering <meyering@lucent.com>
3571 * gettimeofday.c: New file.
3573 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
3575 2001-08-04 Jim Meyering <meyering@lucent.com>
3577 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
3578 to get in sync with glibc.
3580 2001-08-03 Paul Eggert <eggert@twinsun.com>
3582 The following changes are from gettext 0.10.39 as maintained by
3585 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
3586 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
3587 with inverted sense. All uses changed.
3589 * mbswidth.c: Don't include <limits.h>.
3590 Include <stdlib.h> and <string.h> unconditionally.
3591 (iswcntrl, mbsinit, ISCNTRL): New macros.
3592 (mbsnwidth): Use K&R style function declarations.
3593 Don't bother checking for MB_LEN_MAX == 1, since the compiler
3594 can optimize it when MB_CUR_MAX == 1.
3595 The width of control characters is zero, not 1.
3597 2001-07-15 Jim Meyering <meyering@lucent.com>
3599 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
3600 (BUILT_SOURCES): Add unlocked-io.h.
3601 (io_functions): Define.
3602 (unlocked-io.h): New rule.
3603 (DISTCLEANFILES): Add unlocked-io.h.
3604 (all-local): Depend on unlocked-io.h, to ensure it is created.
3606 * unlocked-io.hin: New file
3608 * regex.c: Update from glibc.
3610 2001-07-05 Jim Meyering <meyering@lucent.com>
3612 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
3614 (libfetish_a_SOURCES): Put all .h files here instead.
3615 Remove a thus-exposed (better checks in automake) duplicate and
3616 two unnecessary .h files.
3618 2001-06-11 Jim Meyering <meyering@lucent.com>
3620 * regex.c: Update from GNU libc.
3622 2001-05-27 Jim Meyering <meyering@lucent.com>
3624 * readutmp.h (UT_TYPE): Define.
3626 2001-05-24 Jim Meyering <meyering@lucent.com>
3628 * argmatch.c: Include "quote.h".
3629 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
3630 quote function. Reported by Göran Uddeborg.
3632 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
3634 * dirname.c (dir_name): Compute append_dot using path, not newpath
3635 which is not yet declared.
3637 2001-05-11 Paul Eggert <eggert@twinsun.com>
3639 * Makefile.am (libfetish_a_SOURCES):
3640 Add strftime.c, since we now compile it on all hosts.
3642 * strftime.c (my_strftime):
3643 Define to nstrftime if emacs, but only if my_strftime is not defined.
3644 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
3645 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
3646 Add one more extra argument: a nanoseconds value.
3649 (my_strftime function): Add %N format.
3650 (emacs_strftimeu): Renamed from emacs_strftime,
3651 with extra ut argument.
3653 2001-05-11 Paul Eggert <eggert@twinsun.com>
3655 dirname code cleanup. base_name now behaves more compatibly
3656 with POSIX basename when given file names that have trailing
3657 slashes, and similarly for dir_name. Add new primitives
3658 base_len and dir_len. Put the directory-name-related decls
3661 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
3662 * backupfile.c (base_name): Likewise.
3663 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
3664 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
3665 * makepath.c (strip_trailing_slashes): Likewise.
3666 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
3668 * rename.c (strip_trailing_slashes): Likewise.
3669 * same.c (base_name): Likewise.
3670 * stripslash.c (ISSLASH): Likewise.
3672 * addext.c: Include <dirname.h> after size_t is defined.
3673 * backupfile.c: Likewise.
3675 * addext.c (addext): Use base_len to trim redundant
3676 trailing slashes instead of doing it ourselves.
3677 But do not trim the last slash if it is not redundant.
3679 * backupfile.c (find_backup_file_name,
3680 max_backup_version): Use base_len instead of rolling it ourselves.
3681 Handle the case of "" and (on DOS) "C:" correctly.
3683 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
3684 Include <string.h>, <dirname.h>.
3685 (base_name): Allow file names ending in slashes, other than names
3686 that are all slashes. In this case, return the basename followed
3687 by the slashes. This is more general, and can be used in places
3688 where the original base_name purposely had an assertion failure.
3689 (base_len): New function.
3691 * dirname.c: Include <string.h> instead of <stdlib.h>.
3692 Do not include <assert.h>; no longer needed.
3694 (memrchr): Remove decl.
3695 (dir_name_r): Remove.
3696 (dir_len): Renamed from dirlen. All callers changed.
3697 Rewrite in terms of base_name, for simplicity and consistency.
3698 (dir_name): Never return NULL. All callers changed.
3699 Do not include <stdlib.h> in test program; no longer needed.
3700 return 0; is fine for test program.
3702 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
3704 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
3706 * path-concat.c (path_concat): Use base_len to compute
3707 base length, not strlen; this means we cannot rely on memcpy
3710 * same.c (STREQ): Remove.
3711 (same_name): Handle the case where the basename ends in trailing '/'.
3713 * stripslash.c (strip_trailing_slashes): Return nonzero if
3714 a slash was stripped. Do not strip the last slash after a
3717 2001-04-08 Jim Meyering <meyering@lucent.com>
3719 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
3720 recomputed; that's necessary when the offset spans a DST transition.
3721 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
3723 2001-04-02 Jim Meyering <meyering@lucent.com>
3725 * regex.h, regex.c: Update from GNU libc.
3727 2001-03-19 Paul Eggert <eggert@twinsun.com>
3729 * version-etc.c (version_etc_copyright): Update to 2001.
3731 2001-03-16 Paul Eggert <eggert@twinsun.com>
3733 * tempname.c (uint64_t): Define to uintmax_t if
3734 not defined, and if UINT64_MAX is not defined.
3735 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
3736 Reported by John David Anglin.
3738 2001-03-10 Bruno Haible <haible@clisp.cons.org>
3740 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
3741 alias if codeset is empty.
3742 * config.charset (BeOS): Use wildcard syntax.
3744 2001-03-13 Jim Meyering <meyering@lucent.com>
3746 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
3747 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
3750 2001-03-06 Bruno Haible <haible@clisp.cons.org>
3752 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
3754 * unicodeio.c (print_unicode_char): Simplify accordingly.
3756 2001-03-06 Bruno Haible <haible@clisp.cons.org>
3758 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
3759 support for DOS/DJGPP.
3761 2001-02-28 Paul Eggert <eggert@twinsun.com>
3763 * Makefile.am (libfetish_a_SOURCES):
3764 Add dup-safer.c, fopen-safer.c.
3765 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
3767 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
3769 2001-02-25 Paul Eggert <eggert@twinsun.com>
3771 The mkstemp replacement is taken from glibc 2.2.2, with some
3772 portability fixes for use outside glibc, as follows:
3774 * tempname.c (struct_stat64): New macro.
3775 (direxists, __gen_tempname): Use it.
3776 This avoids a portability problem with Solaris 8.
3778 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
3779 (<stddef.h>, <stdint.h>, <string.h>):
3780 Include only if STDC_HEADERS || _LIBC.
3781 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
3782 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
3783 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
3784 (__set_errno): Define this macro if <errno.h> doesn't.
3785 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
3786 Define these macros if <stdio.h> doesn't.
3787 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
3788 Define these macros if <sys/stat.h>
3789 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
3790 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
3791 __xstat64): Define if not _LIBC.
3792 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
3793 (__gen_tempname): Invoke gettimeofday only if
3794 HAVE_GETTIMEOFDAY || _LIBC;
3795 otherwise, fall back on plain "time".
3796 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
3798 * mkstemp.c (__GT_FILE): Define to zero if not defined.
3800 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
3802 2001-02-17 Jim Meyering <meyering@lucent.com>
3804 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
3805 around included file name.
3807 * strnlen.c (__strnlen): Merge in a change from GNU libc.
3809 * strftime.c: Update from GNU libc (the only changes were to comments).
3811 2001-02-13 Bruno Haible <haible@clisp.cons.org>
3813 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
3815 2001-02-17 Paul Eggert <eggert@twinsun.com>
3817 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
3818 Remove workaround macros for hosts that have mbrtowc but not
3819 mbstate_t, as we now insist on proper declarations for both
3820 before using mbrtowc.
3822 2001-02-17 Jim Meyering <meyering@lucent.com>
3824 * regex.c: Update from libc.
3826 2001-02-16 Paul Eggert <eggert@twinsun.com>
3828 * alloca.c (malloc): Undef before defining, since stdlib.h
3829 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
3830 Reported by Mark Hounschell via Paul Eggert.
3832 2001-01-30 Bruno Haible <haible@clisp.cons.org>
3834 * config.charset: Update for FreeBSD 4.2.
3836 2001-01-26 Jim Meyering <meyering@lucent.com>
3838 * quotearg.c: Include stddef.h.
3839 * quote.c: Include stddef.h.
3840 Reported by Axel Kittenberger.
3842 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
3843 line in double quotes so that it evokes a better diagnostic.
3844 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
3845 Reported by Axel Kittenberger.
3847 2001-01-15 Bruno Haible <haible@clisp.cons.org>
3849 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
3850 to avoid a warning. Add back 'const' to inptr.
3852 2001-01-16 Jim Meyering <meyering@lucent.com>
3854 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
3857 2001-01-14 Jim Meyering <meyering@lucent.com>
3859 * rename.c: New file. From Volker Borchert.
3860 Include stdlib.h, string.h or strings.h, and xalloc.h.
3861 Use strip_trailing_slashes rather than open-coding it.
3863 2001-01-03 Paul Eggert <eggert@twinsun.com>
3865 * strftime.c: Sync with glibc time/strftime.c 1.81.
3867 2001-01-03 Jim Meyering <meyering@lucent.com>
3869 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
3870 local `inptr' to avoid warning with some system declarations of iconv.
3872 2000-12-29 Paul Eggert <eggert@twinsun.com>
3874 * modechange.c: Do not assume that mode_t uses the
3875 traditional octal encoding. E.g. "chmod 1 FOO" should set
3876 the other-execute bit of FOO even if S_IXOTH != 1.
3878 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
3879 WOTH, XOTH, ALLM): New macros.
3880 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
3881 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
3883 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
3884 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
3886 No need to use uintmax_t; unsigned long is long enough.
3887 Don't bother to get suffix since we don't use it.
3889 2000-12-24 Jim Meyering <meyering@lucent.com>
3891 * hash.c (is_prime): Return explicit boolean values.
3892 (hash_get_first): Return NULL to appease Irix5.6's 89.
3893 Reported by Nelson Beebe.
3895 2000-10-31 Bruno Haible <haible@clisp.cons.org>
3897 * localcharset.c (locale_charset): Add support for Win32.
3899 2000-12-18 Paul Eggert <eggert@twinsun.com>
3901 * physmem.h, physmem.c: New files.
3903 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
3904 (noinst_HEADERS): Add physmem.h.
3906 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
3907 't' for compatibility with Solaris 8 sort.
3909 2000-12-18 Bruno Haible <haible@clisp.cons.org>
3911 * config.charset: Add support for BeOS.
3913 2000-12-16 Jim Meyering <meyering@lucent.com>
3915 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
3916 SHELLS_FILE to a file name that's useful on djgpp systems.
3918 (ADDITIONAL_DEFAULT_SHELLS): Define.
3919 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
3920 Based mostly on a patch from Prashant TR.
3922 2000-12-16 Jim Meyering <meyering@lucent.com>
3924 This bug had a serious impact on chown: `chown N:M FILE' (for integer
3925 N and M) would have treated it like `chown N:N FILE'.
3927 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
3929 2000-10-31 Bruno Haible <haible@clisp.cons.org>
3931 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
3932 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
3933 to the list of canonical encodings. Rename EUC-CN to GB2312.
3935 2000-12-08 Andreas Schwab <schwab@suse.de>
3937 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
3938 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
3940 2000-12-07 Jim Meyering <meyering@lucent.com>
3942 * stripslash.c (ISSLASH): Define.
3943 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
3946 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
3947 (dir_name_r): Declare this function as static.
3948 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
3949 manifest itself on a name containing a mix of slashes and
3951 Make this function work with names starting with a DOS-style
3952 drive letter and colon prefix.
3953 (dir_name): Append `.' if necessary.
3954 Based mostly on patches from Prashant TR and Eli Zaretskii.
3956 * dirname.h (dir_name_r): Remove prototype.
3958 2000-12-05 Jim Meyering <meyering@lucent.com>
3960 * dirname.c (dir_name_r): Add `const' in a few local declarations.
3962 2000-12-04 Jim Meyering <meyering@lucent.com>
3964 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
3965 Also include memory.h, stdlib.h, unistd.h if appropriate.
3966 Reported by Andreas Jaeger (conflicting declaration of malloc).
3968 2000-12-02 Jim Meyering <meyering@lucent.com>
3970 * closeout.h: Make idempotent, to avoid some obscure warnings.
3972 2000-12-01 Paul Eggert <eggert@twinsun.com>
3974 * memrchr.c: Include <config.h> before any system include file.
3976 2000-11-29 Paul Eggert <eggert@twinsun.com>
3978 * dirname.c (dir_name_r): Fix typo: int -> size_t.
3980 2000-11-26 Jim Meyering <meyering@lucent.com>
3982 * memcoll.c: Include sys/types.h. From Werner Almesberger.
3984 2000-11-22 Paul Eggert <eggert@twinsun.com>
3986 * strftime.c (my_strftime): Do not invoke mbrlen with a
3987 size of (size_t) -1; it's not portable.
3989 2000-11-17 Akim Demaille <akim@epita.fr>
3991 * obstack.h: Formatting changes.
3992 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
3993 prevent type checking.
3994 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
3995 cast the value to (void *): assigning a `foo *' to a `void *'
3997 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
3999 2000-11-17 Jim Meyering <meyering@lucent.com>
4001 * strstr.c: Update from GNU libc.
4003 2000-11-16 Jim Meyering <meyering@lucent.com>
4005 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
4007 2000-11-11 Jim Meyering <meyering@lucent.com>
4009 * error.c: Add a couple #includes, merging from GNU libc version.
4011 2000-11-10 Jim Meyering <meyering@lucent.com>
4013 * obstack.h: Update from GNU libc.
4014 * obstack.c: Likewise.
4016 2000-11-06 Paul Eggert <eggert@twinsun.com>
4018 * getusershell.c (setusershell): Use rewind rather than
4019 fseek/fseeko, to avoid configuration hassles with fseeko.
4020 Don't bother opening SHELLS_FILE if shellstream is NULL;
4023 2000-11-05 Jim Meyering <meyering@lucent.com>
4025 * makepath.h (make_dir): Declare.
4026 * makepath.c (make_dir): Remove `static' attribute.
4029 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
4031 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
4032 last one in a bucket, advance to the next bucket.
4034 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
4036 * fnmatch.c: Do not comment out all the code if we are using
4037 the GNU C library, because in some cases we are replacing buggy
4038 code in the GNU C library itself.
4040 2000-10-30 Paul Eggert <eggert@twinsun.com>
4042 * error.h, getline.h, modechange.h:
4043 Remove "2000" from Copyright line, as the file hasn't been
4044 changed this year other than in the copyright notice.
4046 * xalloc.h: Add "2000" to Copyright line, as this file
4047 was changed this year.
4049 2000-10-30 Paul Eggert <eggert@twinsun.com>
4051 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
4052 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
4053 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4055 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
4057 * regex.h (__restrict_arr): Move definition out of #ifndef block.
4058 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
4059 doesn't define __restrict_arr.
4061 2000-10-29 Jim Meyering <meyering@lucent.com>
4063 * xstat.in: Fix grammar in comment.
4065 2000-10-28 Jim Meyering <meyering@lucent.com>
4067 * memchr.c: Update from libc.
4068 Adjust for portability:
4069 [HAVE_STDLIB_H]: Include stdlib.h.
4070 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
4071 Undef __memchr, too.
4072 [!weak_alias]: Define __memchr to memchr.
4074 * regex.c: Update from libc.
4075 * regex.h: Likewise.
4076 * getopt1.c: Likewise.
4077 * memcmp.c: Likewise.
4079 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
4080 Avoid using fseek, when possible -- it's broken by design.
4081 Patch by Ulrich Drepper.
4083 2000-10-26 Jim Meyering <meyering@lucent.com>
4085 * strftime.c: Update from libc.
4087 2000-10-25 Jim Meyering <meyering@lucent.com>
4089 * obstack.c: Update from libc.
4091 2000-10-23 Jim Meyering <meyering@lucent.com>
4093 * hard-locale.c (hard_locale): Revert last change -- it was simply
4094 wrong. That set_locale call must not have any side effects.
4097 2000-10-22 Jim Meyering <meyering@lucent.com>
4099 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
4100 [CYCLIC]: Remove now-unused definition.
4102 * save-cwd.c (O_DIRECTORY): Define, if needed.
4103 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
4104 Suggestion from Ulrich Drepper.
4106 2000-10-21 Jim Meyering <meyering@lucent.com>
4108 * dirname.c (dir_name_r): New function, factored out of dir_name.
4109 (dir_name): Use dir_name_r.
4110 * dirname.h (dir_name_r): Declare it.
4112 2000-10-21 Jim Meyering <meyering@lucent.com>
4114 * dirname.c (memrchr): Declare if necessary.
4115 (dir_name): Remove the restriction that there be no
4116 trailing slashes. Now, this code skips past them, effectively
4118 [TEST_DIRNAME] (main): New unit tests.
4120 * memrchr.c: New file from GNU libc.
4121 Undef __memrchr, too.
4122 [!weak_alias]: Define __memrchr to memrchr.
4123 Guard weak_alias use with `#ifdef weak_alias'.
4125 2000-10-17 Jim Meyering <meyering@lucent.com>
4127 * quote.h (PARAMS): Define and use.
4128 Reported by Akim Demaille.
4130 * getopt.c: Update from libc.
4132 2000-10-16 Jim Meyering <meyering@lucent.com>
4134 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
4137 2000-09-25 Jim Meyering <meyering@lucent.com>
4139 * md5.h (rol): Define (from GnuPG).
4141 * sha.c: Give credit (GnuPG) where due.
4142 (M): Use rol rather than open-coding it.
4143 Add a FIXME comment.
4145 2000-09-21 Jim Meyering <meyering@lucent.com>
4147 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
4148 Reported by Michael Stone.
4150 2000-09-20 Jim Meyering <meyering@lucent.com>
4152 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
4153 (noinst_HEADERS): Add sha.h.
4154 Based on code from Scott G. Miller and from GnuPG.
4156 2000-09-15 Jim Meyering <meyering@lucent.com>
4158 * regex.c: Update from libc.
4160 2000-09-10 Jim Meyering <meyering@lucent.com>
4162 * getopt.c (_getopt_internal): Update from glibc.
4164 2000-09-09 Jim Meyering <meyering@lucent.com>
4166 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
4167 think it should be used as a general replacement for isascii.
4168 * fnmatch.c: Likewise.
4169 * mbswidth.c: Likewise
4170 * regex.c: Likewise.
4173 * userspec.c: Include sys/param.h and limits.h.
4175 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4176 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
4177 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
4178 UID, GID. Check range.
4180 2000-09-06 Jim Meyering <meyering@lucent.com>
4182 * getopt.c (_getopt_internal): Update from glibc.
4184 2000-08-30 Jim Meyering <meyering@lucent.com>
4186 * strftime.c: Merge in changes from GNU libc.
4188 2000-08-26 Jim Meyering <meyering@lucent.com>
4190 * closeout.c: Include "__fpending.h".
4191 (close_stdout_status): Return right away if there's nothing to flush.
4193 * Makefile.am (noinst_HEADERS): Add __fpending.h.
4194 * __fpending.c: New file.
4195 * __fpending.h: New file.
4197 2000-08-07 Paul Eggert <eggert@twinsun.com>
4199 Standardize on "memory exhausted" instead of "Memory exhausted"
4200 or "virtual memory exhausted".
4201 * obstack.c (print_and_abort): Use "memory exhausted", not
4202 "virtual memory exhausted".
4203 * same.c (same_name): Invoke xalloc_die instead of printing
4205 * userspec.c (parse_user_spec): Likewise.
4206 * bumpalloc.h: comment fix
4207 * same.c, userspec.c: Include xalloc.h.
4209 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
4210 not char *const and pointing to a constant array.
4211 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
4212 (xrealloc): Comment fix.
4214 * userspec.c (parse_user_spec):
4215 Don't translate a message until just before returning,
4216 to avoid unnecessary translation.
4218 2000-08-07 Jim Meyering <meyering@lucent.com>
4220 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
4221 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
4222 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
4223 getgroups.c, gethostname.c, getopt.h, group-member.c,
4224 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
4225 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
4226 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
4227 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
4228 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
4229 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
4230 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
4231 yesno.c: Back out Copyright date changes for each file with no change
4232 this year. This eases coordination with other programs using the same
4233 source code modules. From Paul Eggert.
4235 2000-08-03 Greg McGary <greg@mcgary.org>
4237 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
4238 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
4239 (EXTEND_BUFFER): Use them.
4241 2000-08-01 Jim Meyering <meyering@lucent.com>
4243 * dirname.c (ISSLASH): Define.
4244 (BACKSLASH_IS_PATH_SEPARATOR): Define.
4245 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
4246 both `\' and `/' may be use as path separators.
4247 Based on a patch from Prashant TR.
4249 2000-07-31 Paul Eggert <eggert@twinsun.com>
4251 * quotearg.c (quotearg_n_options): Don't make the initial
4252 slot vector a constant, since it might get modified.
4254 2000-07-31 Jim Meyering <meyering@lucent.com>
4256 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
4257 * obstack.c (print_and_abort): Likewise.
4259 2000-07-30 Paul Eggert <eggert@twinsun.com>
4261 * quotearg.c (quotearg_n_options): Preallocate a slot 0
4262 buffer, so that the caller can always quote one small
4263 component of a "memory exhausted" message in slot 0.
4264 From a suggestion by Jim Meyering.
4266 2000-07-30 Jim Meyering <meyering@lucent.com>
4268 * makepath.c (make_path): Quote the other instance, too.
4270 * quotearg.c (N_STATIC_SLOTVECS): Define.
4271 (STATIC_BUF_SIZE): Define.
4272 (quotearg_n_options): Use only statically allocated storage when
4273 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
4274 than STATIC_BUF_SIZE.
4276 2000-07-29 Jim Meyering <meyering@lucent.com>
4278 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
4279 * dirname.c (dir_name): Likewise.
4281 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
4283 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
4284 (dir_name): Assert that there are no trailing slashes.
4286 2000-07-18 Bruno Haible <haible@clisp.cons.org>
4288 * mbswidth.h (mbswidth): Add a flags argument.
4289 (mbswidth): New declaration.
4290 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
4291 * mbswidth.c (mbswidth): Add a flags argument.
4292 (mbsnwidth): New function.
4294 2000-07-24 Jim Meyering <meyering@lucent.com>
4296 * mbswidth.c: Remove useless #else. From Bruno Haible.
4298 2000-07-23 Paul Eggert <eggert@twinsun.com>
4300 * mbswidth.c (_XOPEN_SOURCE):
4301 Don't define; this causes problems on Solaris 7.
4302 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
4304 2000-07-23 Paul Eggert <eggert@twinsun.com>
4307 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
4308 so that mbstate_t is always defined.
4310 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
4311 be 1 in at least one GCC installation, and this configuration
4312 error is likely to be common. Ignoring MB_LEN_MAX hurts
4313 performance on hosts that have mbrtowc but have only unibyte
4314 locales, but I assume these hosts are rare.
4316 2000-07-23 Paul Eggert <eggert@twinsun.com>
4318 * quotearg.c: Streamline by invoking multibyte code only if needed.
4319 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
4320 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
4321 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
4322 invoke multibyte primitives.
4324 2000-07-23 Jim Meyering <meyering@lucent.com>
4326 * basename.c (base_name): Add an assertion.
4328 2000-07-15 Bruno Haible <clisp.cons.org>
4330 * quotearg.c: When the system forces us to redefine mbstate_t,
4331 shadow its mbsinit function.
4333 2000-07-16 Bruno Haible <haible@clisp.cons.org>
4335 * mbswidth.h: New file.
4336 * mbswidth.c: New file.
4337 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
4338 (noinst_HEADERS): Add mbswidth.h.
4340 2000-07-17 Bruno Haible <haible@clisp.cons.org>
4342 * config.charset: Add support for FreeBSD. Improve support for HP-UX
4345 2000-07-15 Jim Meyering <meyering@lucent.com>
4347 * makepath.c: Include quote.h.
4348 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
4349 corresponding argument in a `quote (...)' call.
4350 Give better diagnostics.
4352 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
4353 (noinst_HEADERS): Add quote.h.
4355 * quote.c (quote, quote_n): New file. Two functions taken verbatim
4356 from tar's src/misc.c.
4357 * quote.h: New file. Prototypes for same.
4359 2000-07-10 Paul Eggert <eggert@twinsun.com>
4361 From a suggestion by Bruno Haible.
4362 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
4363 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
4364 to decide whether to define the BeOS workaround macro;
4365 this adjusts to the change to AC_MBSTATE_T.
4367 2000-07-13 Paul Eggert <eggert@twinsun.com>
4369 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
4371 * quotearg.c (quoting_style_args, quoting_style_vals,
4372 quotearg_buffer_restyled): Add support for
4373 clocale_quoting_style. Undo previous change to
4374 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
4375 and "{RIGHT QUOTATION MARK}" msgids.
4377 2000-07-05 Paul Eggert <eggert@twinsun.com>
4379 The old behavior of quoting `like this' doesn't look good with
4380 newer, ISO-style fonts. See:
4381 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
4383 Instead, quote "like this" by default. Let the translator
4384 tailor the locale-specific quoting behavior by providing
4385 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
4387 * quotearg.c (N_): New macro.
4388 (gettext_default): New function.
4389 (quotearg_buffer_restyled): Use
4390 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
4391 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
4393 2000-07-09 Jim Meyering <meyering@lucent.com>
4395 * Most files: Update copyright dates to include 2000.
4397 2000-07-08 Jim Meyering <meyering@lucent.com>
4399 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
4401 (xgethostname): Remove now-unnecessary #ifdef.
4402 Move declaration of `err' into loop where it's used.
4404 2000-07-05 Bruno Haible <haible@clisp.cons.org>
4406 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
4407 by allocating a larger buffer. Test the gethostname return value for
4408 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
4409 returns an error and ENAMETOOLONG isn't defined.
4411 2000-07-05 Paul Eggert <eggert@twinsun.com>
4412 and Bruno Haible <haible@clisp.cons.org>
4414 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
4416 2000-07-05 Bruno Haible <haible@clisp.cons.org>
4418 * quotearg.c (struct quoting_options): Simplify quote_these_too
4421 2000-07-03 Jim Meyering <meyering@lucent.com>
4423 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
4424 Reported by Bruno Haible.
4426 2000-07-04 Jim Meyering <meyering@lucent.com>
4428 * quotearg.c: Make inclusion of <wchar.h> independent of whether
4429 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
4432 2000-07-03 Paul Eggert <eggert@twinsun.com>
4433 and Bruno Haible <haible@clisp.cons.org>
4435 * quotearg.c (mbrtowc):
4436 Assign to *pwc, and return 1 only if result is nonzero.
4437 (iswprint): Use ISPRINT when substituting our own mbrtowc.
4439 2000-07-03 Jim Meyering <meyering@lucent.com>
4441 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
4442 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
4445 2000-07-02 Jim Meyering <meyering@lucent.com>
4447 * quotearg.c (mbstate_t): Don't define here.
4449 2000-07-02 Jim Meyering <meyering@lucent.com>
4451 * nanosleep.c (SIGCONT): Define if not already defined.
4453 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4455 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
4456 per change in ../m4/ls-mntd-fs.m4.
4457 (read_filesystem_list): Ignore symbolic links.
4459 2000-06-29 Jim Meyering <meyering@lucent.com>
4461 * same.c: Include <string.h> or <strings.h>, as appropriate,
4462 for declaration of strcmp.
4464 * long-options.c: Include <stdlib.h>, for declaration of exit.
4466 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
4467 Avoid warning by casting result to `char *' to remove `const'.
4469 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4471 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
4473 2000-06-26 Paul Eggert <eggert@twinsun.com>
4475 savedir now sets errno on failure and invokes xmalloc to get memory.
4476 Fix a couple of other minor bugs while we're at it.
4478 * savedir.c (<unistd.h>): Do not include; there's no need.
4479 (NAMLEN): Remove macro.
4480 (malloc, realloc): Remove decls.
4482 ("xalloc.h"): Include.
4483 (NAME_SIZE_DEFAULT): New macro.
4484 (savedir): Use xmalloc / xrealloc to allocate memory.
4485 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
4486 Skip "" directory entries.
4487 Use strlen to calculate directory entry length, since the old method
4488 is rarely used these days and isn't worth supporting.
4489 Don't use a pointer after freeing it.
4490 Check for integer overflow when calculating allocation size.
4491 Use memcpy to copy entries, instead of stpcpy.
4492 Set errno properly when returning NULL.
4493 Check for readdir error.
4495 2000-06-26 Jim Meyering <meyering@lucent.com>
4497 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
4499 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4501 * getusershell.c (xmalloc, xrealloc): Remove functions.
4503 Don't include <stdlib.h>. Don't declare malloc, realloc.
4505 2000-06-23 Bruno Haible <haible@clisp.cons.org>
4507 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
4509 2000-06-24 Jim Meyering <meyering@lucent.com>
4511 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
4513 2000-06-21 Jim Meyering <meyering@lucent.com>
4515 * getpass.c: New file, from Bruno Haible. Required for BeOS.
4517 2000-06-19 Paul Eggert <eggert@twinsun.com>
4519 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
4520 (mbrtowc, mbstate_t): Define substitutes if
4521 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
4522 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
4523 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
4525 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4527 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
4528 than 1024, return a memory chunk of least possible size, instead
4529 of size PATH_MAX + 2. In the loop, increment the size proportionally.
4530 Use free/xmalloc instead of xrealloc to avoid copying for very long
4533 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4535 * canon-host.c (canon_host): Use malloc and memcpy to copy an
4536 address, not strdup. Include <stdlib.h> and don't declare free().
4538 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4540 * path-concat.c (path_concat): Don't access dir[-1] if dir is
4543 2000-06-21 Jim Meyering <meyering@lucent.com>
4545 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
4546 (noinst_HEADERS): Add getstr.h.
4548 * getline.c (getstr): Move into a separate file.
4549 * getstr.c (getstr): New file, extracted from getline.c, with
4550 the following changes: new parameter, delim2; both delim[12]
4551 parameters have type `int', not `char'. The latter would lose
4552 with 8-bit delimiters.
4553 * getstr.h: New file.
4555 2000-06-19 Jim Meyering <meyering@lucent.com>
4557 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
4559 2000-06-18 Jim Meyering <meyering@lucent.com>
4561 * mkdir.c: Remove file, due mainly to copyright incompatibility.
4562 Besides, these days every porting target provides a mkdir function.
4564 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
4565 (this snippet comes from src/system.h).
4567 2000-06-15 Paul Eggert <eggert@twinsun.com>
4569 * human.c (adjust_value): New function.
4570 (human_readable_inexact): Apply rounding style even when
4571 printing approximate values.
4573 2000-06-14 Paul Eggert <eggert@twinsun.com>
4575 * human.c (human_readable_inexact): Allow an input block
4576 size that is not a multiple of the output block size, and vice versa.
4577 Reported by Piergiorgio Sartor.
4579 2000-06-14 Paul Eggert <eggert@twinsun.com>
4581 * getdate.y (get_date): Apply relative times after time
4582 zone indicator, not before. Reported by Todd A. Jacobs.
4584 2000-06-13 Jim Meyering <meyering@lucent.com>
4586 * Makefile.am (all-local): Depend on lstat.c and stat.c.
4588 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
4590 2000-06-12 Paul Eggert <eggert@twinsun.com>
4592 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
4594 2000-06-04 Paul Eggert <eggert@twinsun.com>
4596 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
4598 2000-06-04 Jim Meyering <meyering@lucent.com>
4600 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
4601 SunOS 4.1.4 for which gid_t is an unsigned type.
4603 2000-06-03 Jim Meyering <meyering@lucent.com>
4605 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
4607 2000-05-26 Bruno Haible <haible@clisp.cons.org>
4609 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
4610 newer, don't install charset.alias.
4611 * config.charset: Change the Linux/glibc rules so they become empty
4612 on glibc-2.1 or newer.
4614 2000-06-02 Jim Meyering <meyering@lucent.com>
4616 * mountlist.c: Back out last change. Instead, do this...
4617 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
4618 member using the same `ignore'-testing code.
4619 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
4623 2000-05-29 Jim Meyering <meyering@lucent.com>
4625 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
4626 with the `ignore' attribute. Based on a patch from Mark D. Roth.
4628 2000-05-22 Jim Meyering <meyering@lucent.com>
4630 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
4632 2000-05-18 Jim Meyering <meyering@lucent.com>
4634 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
4635 back, too, since it may have been modified by allocate_entry.
4636 (hash_delete): Rewrite to use neither the assignment operator
4637 nor the comma operator in an if-expression.
4639 2000-05-15 Paul Eggert <eggert@twinsun.com>
4642 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
4643 Remove; no longer needed.
4644 "quotearg.h": Add include.
4645 (file_name): Do not bother to explicitly initialize to NULL; it's less
4646 efficient on some hosts.
4647 (close_stdout_status): Remove test as to whether stdout was already
4648 closed; it breaks for the case "echo x | sort >&-".
4649 Quote file name colons.
4650 Do not assume that _("write error") lacks format strings.
4652 2000-05-15 Jim Meyering <meyering@lucent.com>
4654 * version-etc.c (version_etc_copyright): Update the copyright string
4655 used in all --version output.
4657 2000-05-14 Jim Meyering <meyering@lucent.com>
4659 * closeout.c (close_stdout_set_file_name): New function.
4660 (close_stdout_status): Use new file-scoped global.
4661 Return right away if fstat says the stdout file descriptor is invalid.
4662 * closeout.h (close_stdout_set_file_name): Declare.
4664 2000-05-10 Jim Meyering <meyering@lucent.com>
4666 * closeout.c [default_exit_status]: New file-scoped variable.
4667 (close_stdout_set_status): New function.
4668 * closeout.h (close_stdout_set_status): Declare.
4670 2000-05-08 Jim Meyering <meyering@lucent.com>
4672 * long-options.c: Don't include closeout.h.
4673 (parse_long_options): Don't call close_stdout for --version.
4675 2000-05-06 Jim Meyering <meyering@lucent.com>
4677 * strnlen.c: Undefine __strnlen and strnlen.
4678 [!weak_alias]: Define __strnlen to strnlen.
4680 * atexit.c: New file, from libiberty.
4682 2000-05-06 Jim Meyering <meyering@lucent.com>
4684 * closeout.c (close_stdout_status): Also check for errors on the
4687 2000-05-05 Bruno Haible <haible@clisp.cons.org>
4689 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
4690 instead of xmalloc, xrealloc, path_concat.
4691 (locale_charset): Treat empty environment variables as absent.
4692 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
4694 2000-05-04 Jim Meyering <meyering@lucent.com>
4696 * getopt.c: Update from glibc.
4697 * obstack.c: Likewise.
4698 * obstack.h: Likewise.
4699 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
4701 * regex.h: Likewise.
4702 * strndup.c: Likewise.
4703 * strnlen.c: New file, from glibc.
4705 2000-05-01 Jim Meyering <meyering@lucent.com>
4707 * full-write.c (full_write): Remove `FIXME' part of comment.
4709 2000-04-29 Jim Meyering <meyering@lucent.com>
4711 * path-concat.c: Declare strdup only if it's not defined.
4712 * canon-host.c: Likewise.
4714 2000-04-28 Jim Meyering <meyering@lucent.com>
4716 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
4717 redefinition warning on some systems (HPUX). Otherwise, regex.h is
4718 included first, then limits.h is included by locale.h by libintl.h.
4719 From John David Anglin.
4721 2000-04-25 Jim Meyering <meyering@lucent.com>
4723 * makepath.c (S_IRWXUGO): Define.
4724 (make_path): Always perform explicit chmod if MODE specifies any
4725 of the `special' permission bits. Prompted by a bug report against
4726 install from Mate Wierdl and Joost van Baal.
4728 2000-04-18 Jim Meyering <meyering@lucent.com>
4732 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
4733 getpagesize. For BeOS. Based on a patch from Bruno Haible.
4735 2000-04-17 Jim Meyering <meyering@lucent.com>
4737 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
4738 the definition of it to rpl_strftime also defined-away the system's
4741 2000-04-15 Jim Meyering <meyering@lucent.com>
4743 Use `C' to denote so-called `contiguous' files, the same way
4745 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
4746 (ftypelet): Use S_ISCTG.
4747 From Michael Deutschmann.
4749 2000-04-14 Jim Meyering <meyering@lucent.com>
4751 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
4753 2000-04-08 Jim Meyering <meyering@lucent.com>
4755 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
4756 names don't conflict. Reported by Eli Zaretskii.
4758 2000-03-28 Bruno Haible <haible@clisp.cons.org>
4760 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
4761 bug. Deal with the different error behavior of Irix iconv.
4763 2000-04-07 Jim Meyering <meyering@lucent.com>
4765 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
4766 to work around system header problems on AIX 3.2.5. From Bruno Haible.
4768 2000-04-05 Jim Meyering <meyering@lucent.com>
4770 Portability tweaks required for ultrix4.3.
4771 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
4772 * readutmp.c: Include sys/types.h before sys/stat.h.
4773 * canon-host.c: Declare strdup.
4774 * path-concat.c: Likewise.
4775 From John David Anglin.
4777 2000-04-04 Jim Meyering <meyering@lucent.com>
4779 Be more DOS 8.3-friendly.
4780 * ref-add.sin: Renamed from ref-add.sed.in.
4781 * ref-del.sin: Renamed from ref-del.sed.in.
4782 * Makefile.am: Reflect renaming.
4783 Reported by Eli Zaretskii.
4785 Use a temporary file name that won't clash with `charset.alias'
4786 in the DOS 8.3 name space.
4787 * Makefile.am (charset_tmp): Define.
4788 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
4789 (uninstall-local): Likewise.
4790 Reported by Eli Zaretskii.
4792 2000-03-29 Paul Eggert <eggert@twinsun.com>
4794 * time/strftime.c (my_strftime): Make sure we call the system
4795 strftime, not ourselves, when invoking the underlying strftime.
4797 2000-03-24 Jim Meyering <meyering@lucent.com>
4799 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
4800 (charset_alias): Define.
4801 (install-exec-local): Factor out common code.
4802 (uninstall-local): Split lines longer than 80.
4803 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
4805 (.sed.in.sed): New rule. Don't redirect directly to $@.
4806 (CLEANFILES): Add ref-add.sed and ref-del.sed.
4808 2000-03-19 Bruno Haible <haible@clisp.cons.org>
4810 * config.charset: Output a line containing "Packages using this file".
4811 * ref-add.sed.in, ref-del.sed.in: New files.
4812 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
4813 ref-del.sed): New rules.
4815 2000-03-17 Jim Meyering <meyering@lucent.com>
4817 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
4818 Otherwise, include <strings.h>
4820 2000-03-17 Bruno Haible <haible@clisp.cons.org>
4822 * unicodeio.c (utf8_wctomb): New function.
4823 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
4824 format instead of in UCS-4 with platform dependent endianness.
4826 2000-03-07 Paul Eggert <eggert@twinsun.com>
4828 * savedir.c (savedir): Work even if directory size is
4829 negative; this can happen with some screwy NFS configurations.
4831 2000-03-06 Jim Meyering <meyering@lucent.com>
4833 * localcharset.c (get_charset_aliases): Don't try to free file_name
4834 if it's NULL (because we ran out of memory). From Bruno Haible.
4836 2000-03-05 Jim Meyering <meyering@lucent.com>
4838 * localcharset.c ("path-concat.h"): Include.
4839 (get_charset_aliases): Use path_concat instead of ANSI string
4842 * unicodeio.h (PARAMS): Define.
4843 Use it to guard prototype.
4845 2000-03-04 Jim Meyering <meyering@lucent.com>
4847 * Makefile.am (install-exec-local): Create $(libdir) before installing
4849 (uninstall-local): Uncomment this rule so `make distcheck' works
4852 * unicodeio.c (<errno.h>): Include it.
4853 (errno): Declare if not defined.
4855 * localcharset.c: Add Bruno's comment justifying use of volatile.
4857 * config.charset: New version, incorporating remarks from a linux
4858 i18n mailing list. From Bruno Haible.
4860 2000-03-02 Jim Meyering <meyering@lucent.com>
4862 * Makefile.am (EXTRA_DIST): Add config.charset.
4864 2000-03-01 Jim Meyering <meyering@lucent.com>
4866 * localcharset.c: Guard some #includes with `#if HAVE_...'.
4867 * unicodeio.c: Likewise.
4869 2000-02-02 Bruno Haible <haible@clisp.cons.org>
4871 * config.charset: New file.
4872 * localcharset.c: New file.
4873 * unicodeio.h, unicodeio.c: New files.
4874 * Makefile.am (DEFS): Add -DLIBDIR=...
4875 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
4876 (noinst_HEADERS): Add unicodeio.h.
4877 (all-local, install-exec-local, charset.alias): New targets.
4879 2000-02-28 Paul Eggert <eggert@twinsun.com>
4881 * quotearg.c (ALERT_CHAR): New macro.
4882 (quotearg_buffer_restyled): Use it.
4884 2000-02-27 Jim Meyering <meyering@lucent.com>
4886 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
4887 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
4889 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
4890 not `#if STDC_HEADERS'.
4891 Declare malloc if needed.
4893 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
4894 now that autoconf always defines the HAVE_DECL_ symbols.
4895 * human.c: Likewise.
4897 * strtoumax.c: Likewise.
4899 * backupfile.c: Arrange for cpp to fail if the configure-time
4900 declaration check was not run.
4902 * human.c: Likewise.
4904 * strtoumax.c: Likewise.
4906 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
4907 then first look up the entire `.'-containing string as a login name.
4909 2000-02-18 Paul Eggert <eggert@twinsun.com>
4911 * getdate.y: Handle two-digit years with leading zeros correctly.
4912 (textint): New typedef.
4913 (parser_control): Member year changed from int to textint.
4915 (YYSTYPE): Removed; replaced by %union with int and textint members.
4916 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
4917 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
4918 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
4919 (tSNUMBER, tUNUMBER): Now of type <textintval>.
4920 (date, number, to_year): Use width of number in digits, not its value,
4921 to determine whether it's a 2-digit year, or a 2-digit time.
4922 (yylex): Store number of digits of numeric tokens.
4923 Reported by John Kendall.
4925 (parser_control): Changed from struct parser_control to typedef (for
4926 consistency). All uses changed.
4928 (tID): Removed; not used.
4929 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
4931 2000-02-14 Paul Eggert <eggert@twinsun.com>
4933 * getpagesize.h (getpagesize): Port to VMS for Alpha;
4934 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
4936 2000-02-12 Jim Meyering <meyering@lucent.com>
4938 * userspec.c (ISDIGIT): Define it.
4939 (isdigit): Remove definition.
4940 (is_number): Use ISDIGIT, not isdigit.
4941 <libintl.h>: Include.
4943 (parse_user_spec): Mark translatable strings.
4945 2000-02-10 Jim Meyering <meyering@lucent.com>
4947 With these changes, nanosleep.[ch] are finally enough like the other
4948 lib/* replacement files to compile on a few more losing systems.
4950 * nanosleep.h: Don't include config.h.
4951 Remove prototype from declaration of nanosleep.
4952 (PARAMS): Remove now-unneeded definition.
4953 * nanosleep.c: #undef nanosleep.
4954 (rpl_nanosleep): Rename from nanosleep.
4956 2000-02-03 Jim Meyering <meyering@lucent.com>
4958 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
4959 rather than with `#if HAVE_UTMPNAME'.
4961 2000-02-01 Jim Meyering <meyering@lucent.com>
4963 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
4965 2000-01-31 Jim Meyering <meyering@lucent.com>
4967 * nanosleep.h (nanosleep): Guard declaration with
4968 `#if ! HAVE_DECL_NANOSLEEP'.
4969 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
4970 the declaration in that vendor's sys/timers.h.
4971 Reported by Christian Krackowizer.
4973 * quotearg.c (ISASCII): Add #undef and move definition to follow
4974 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
4975 (ISPRINT): Likewise.
4976 Reported by Tom Tromey.
4978 2000-01-30 Jim Meyering <meyering@lucent.com>
4980 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
4981 uses of ->ut_name. The latter doesn't work with new Linux header files
4982 where only utmpx.ut_user is declared.
4984 * readutmp.h (UT_USER): Define.
4986 2000-01-23 Jim Meyering <meyering@lucent.com>
4988 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
4991 2000-01-22 Jim Meyering <meyering@lucent.com>
4993 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
4994 [! HAVE_DECL_STRTOULL]: Declare strtoull.
4995 Required for some AIX systems. Reported by Christian Krackowizer.
4996 [TESTING] (main): New function.
4998 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
4999 * dirname.c (dir_name): Support for DOS-style file names with drive
5002 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
5004 * strverscmp.c (ISDIGIT): Define.
5005 (strverscmp): Use ISDIGIT, not isdigit.
5007 2000-01-17 Paul Eggert <eggert@twinsun.com>
5009 * nanosleep.c (nanosleep):
5010 Don't use SA_INTERRUPT to decide whether to call sigaction, as
5011 POSIX.1 doesn't require SA_INTERRUPT and some systems
5012 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
5013 it's been part of POSIX.1 since day 1 (in 1988).
5015 2000-01-17 Jim Meyering <meyering@lucent.com>
5017 * interlock: Remove unused file. Reported by François Pinard.
5019 2000-01-16 Paul Eggert <eggert@twinsun.com>
5021 * quotearg.c (quotearg_buffer_restyled): Do not quote
5022 alert, backslash, formfeed, and vertical tab unnecessarily in
5023 shell quoting style.
5026 version-control: never