1 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3 * fchown-stub.c: New file.
5 2004-06-24 Jim Meyering <jim@meyering.net>
7 * obstack.h (obstack_base): Cast to (void *), per documentation.
9 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
11 * argz.c, argz_.h: New files, which are autoupdated from libtool.
13 2004-06-01 Jim Meyering <jim@meyering.net>
17 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
19 * getdate.y (yylex): Allow space between sign and number.
20 Problem reported by Dan Jacobson.
22 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
23 and Jim Meyering <jim@meyering.net>
25 Merge from coreutils CVS.
27 * stat-macros.h: New file, with contents from file-type.h
28 and coreutils' system.h.
29 * file-type.c: Include "stat-macros.h".
30 * file-type.h (file_type): Move all macro definitions to new file,
33 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
34 Wrap old code with this conditional.
35 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
36 function that does not dereference symlinks.
37 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
39 * xreadlink.c: Include xreadlink.h first, to catch .h file
41 (xreadlink): Accept new arg SIZE, for efficiency.
42 All decls and uses changed.
43 * xreadlink.h: Include <stddef.h>, for size_t.
45 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
46 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
48 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
50 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
52 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
54 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
55 the allocator returns NULL because the requested size is zero.
57 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
59 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
60 var. Add comment explaining why libc still defines it. This
61 merges the following patch from glibc:
62 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
64 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
66 * obstack.c (_obstack): Remove unused variable. It hasn't been
67 present in glibc since revision 1.1 of this file.
68 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
69 obstack_alignment_mask, obstack_alloc, obstack_base,
70 obstack_blank, obstack_blank_fast, obstack_chunk_size,
71 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
72 obstack_grow0, obstack_init, obstack_int_grow,
73 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
74 obstack_next_free, obstack_object_size, obstack_ptr_grow,
75 obstack_ptr_grow_fast, obstack_room): Remove declarations of
76 nonexistent functions.
78 2004-05-17 Derek R. Price <derek@ximbiot.com>
79 Paul Eggert <eggert@cs.ucla.edu>
81 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
83 2004-05-14 Bruno Haible <bruno@clisp.org>
85 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
86 that consists of a '.' followed by an empty digit string.
87 Patch by Tor Lillqvist <tml@iki.fi>.
89 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
91 Port obstack to the AS/400, where pointers are 16 bytes wide and
92 you cannot cast an integer to a valid pointer. This patch is
93 currently waiting to be integrated into glibc; see
94 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
96 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
97 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
98 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
99 (struct obstack): temp member is now a union of a pointer and
100 an integer, instead of an integer. All integer uses changed.
101 This does not affect the physical layout of struct obstack,
102 except on hosts (like the AS/400) where the size or alignment of
103 void * is greater than that of ptrdiff_t.
104 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
105 __STDC__)]: Store temporary in pointer member of union, not
107 * obstack.c: Include <stddef.h>, for offsetof.
108 (struct fooalign): Remove; it doesn't need a name.
109 (union fooround): Change double to long double, and add void *.
110 (DEFAULT_ALIGNMENT): Use offsetof to compute.
111 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
112 not a macro. Hence the values are always int; so remove all
113 casts-to-int in uses.
115 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
116 Derek Price <derek@ximbiot.com>
118 * alloca.c: Include <alloca.h>, to get our interface.
119 * alloca_.h: Use __alloca on AIX, so that we don't have to
120 include <alloca.h> first. Use C89 prototype for alloca; this
121 requires including <stddef.h> for size_t. Use extern "C" if C++.
122 Use #elif for simplicity, since we can assume C89 now.
123 Don't try to source the system alloca.h since it will not be found
124 and to prevent recursively including its replacement.
125 * fnmatch.c: Include <alloca.h> instead of opencoding.
126 * lib/regex.c: Likewise.
128 2004-05-16 Derek Price <derek@ximbiot.com>
129 Paul Eggert <eggert@cs.ucla.edu>
131 getline cleanup. This changes the getndelim2 API: both order of
132 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
135 * getline.c: Don't include stddef.h or stdio.h, since our
137 (getline): Always use getdelim, so that we don't have two
139 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
141 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
142 (GETNDELIM2_MAXIMUM): New macro.
143 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
144 instead of the old practice of delim2==0. All callers changed.
145 Return -1 on overflow, instead of returning junk.
146 Do not set *linesize unless allocation succeeds.
147 * getndelim2.h: Do not include stddef.h; no longer needed, now
148 that we include sys/types.h.
149 * getnline.h: Likewise.
150 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
151 (getndelim2): Reorder arguments.
152 * getnline.c (getnline, getndelim):
153 Don't discard the NMAX argument.
154 (getnline): Invoke getndelim, to avoid code duplication.
155 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
156 of (size_t) -1 by callers of the getnline family.
158 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
160 * nanosleep.c (suspended): Change its type from int to
161 sig_atomic_t volatile.
162 (first_call): Make it private to rpl_nanosleep, and have it
163 be zero initially as that's a bit faster.
164 (my_usleep): Round up fractional times instead of truncating them,
165 as this is the usual meaning for 'sleep'.
167 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
169 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
170 (ENOSYS): Define if not defined.
171 (settime): Fall back on stime if it exists and settimeofday fails.
172 But don't bother with fallbacks if a method fails with errno == EPERM.
174 2004-05-11 Jim Meyering <jim@meyering.net>
176 Prior to this change, the save_cwd caller required read access to the
177 current directory on most systems (ones with the fchdir function).
179 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
180 fails, try write-only, and finally, resort to using xgetcwd.
182 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
184 * obstack.c, obstack.h: Import changes from libc.
186 2004-04-28 Bruno Haible <bruno@clisp.org>
188 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
189 implicitly appends .exe to executables.
190 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
191 accepts Windows pathnames.
192 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
193 Cygwin like Windows, since it now accepts Windows pathnames.
194 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
195 Cygwin like Windows, since it now accepts Windows pathnames.
196 Reported by Derek Robert Price <derek@ximbiot.com>.
198 2004-04-20 Jim Meyering <jim@meyering.net>
200 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
202 2004-04-20 Jim Meyering <jim@meyering.net>
203 Bruno Haible <bruno@clisp.org>
205 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
206 memory when realloc fails.
208 2004-04-18 Jim Meyering <jim@meyering.net>
210 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
211 don't leak memory and do call END_UTMP_ENT.
213 2004-04-11 Paul Eggert <eggert@twinsun.com>
215 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
216 (CHAR_BIT): Remove, since we assume C89.
217 Include <stdint.h> if available, as per current Autoconf CVS advice.
219 2004-03-30 Paul Eggert <eggert@twinsun.com>
221 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
222 not bool, to be more consistent with Unix conventions.
223 Suggested by Bruno Haible.
225 Merge from coreutils.
227 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
230 * getdate.h: Include stdbool.h, and timespec.h instead of
231 the usual <time.h> dance.
232 (get_date): Change signature to support fractional time stamps.
234 * getdate.y: Include "getdate.h" first, as we can now
235 assume C89 and don't need to worry about 'const'.
236 Similarly, include "unlocked-io.h" near start, not in middle.
238 (textint.value): Use long int rather than int.
239 (textint.digits): Use size_t rather than int.
240 (BILLION, LOG10_BILLION): New constants.
241 (parser_control): New member rel_ns. Members day_ordinal,
242 time_zone, month, day, hour, minutes, rel_year, rel_month,
243 rel_day, rel_hour, rel_minutes, rel_seconds
244 are now long int, not int. Member seconds is now struct timespec,
245 not int. New member timespec_seen. Members dates_seen, days_seen,
246 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
248 (%union.intval): Now long int, not int.
250 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
251 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
252 (spec): Now is a timespec or an item list.
253 (timespec, items): New nonterminals.
254 (time, rel, relunit, number, get_date):
255 Add support for fractional seconds.
256 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
257 (gmtime, localtime, mktime): Remove decls; not needed with C89.
258 (to_hour): First arg is now long int, not int.
259 (to_year): Returns long int, not int.
260 Don't treat year -70 like 70.
261 (tm_diff): Returns long int, not int.
262 (lookup_word): Use bool instead of int when appropriate.
263 (yylex): Use size_t for count, not int.
264 Detect overflow when parsing large integer constants.
265 Add support for fractions.
266 (get_date): Make pointers 'const' if possible.
267 Use more-portable code to detect integer overflow.
268 (main) [TEST]: Adjust to above changes. Test for localtime failure.
269 Don't use ctime; it's not reliable if the year has >4 digits.
271 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
272 This is for compatibility with BSD.
274 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
275 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
276 From coreutils' system.h.
278 * userspec.c: Don't include "posixver.h".
279 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
280 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
281 compatible extension. Simplify code by removing a boolean int
282 that was always nonzero if a string was nonnull.
284 2004-03-30 Jim Meyering <jim@meyering.net>
286 Merge from coreutils.
288 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
290 * readtokens.c (readtoken): Don't leak 64 bytes when reading
291 an empty input stream.
293 * readtokens.c: Include <stdbool.h>.
294 (readtoken): Use `size_t' rather than int/long.
295 All callers adjusted.
296 Use `bool' rather than `int' where appropriate.
297 Use memset rather than an explicit loop.
298 Use x2nrealloc rather than xrealloc.
299 Allow the use of `\0' as a delimiter.
300 (readtokens): Likewise.
301 * readtokens.h (readtoken, readtokens): Update prototypes.
303 2004-03-30 Bruno Haible <bruno@clisp.org>
305 * getloadavg.c (getloadavg): Don't assume setlocale returns
308 2004-03-29 Paul Eggert <eggert@twinsun.com>
310 Merge changes to getloadavg.c from coreutils and Emacs.
312 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
313 Define to an expression, not to the empty string.
314 Include cloexec.h and xalloc.h.
315 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
316 Use set_cloexec_flag rather than rolling our own.
317 * cloexec.c, cloexec.h: New files.
319 2004-03-18 Paul Eggert <eggert@twinsun.com>
321 * getopt.h: Sync with libc CVS.
323 2004-03-18 Paul Eggert <eggert@twinsun.com>
324 Bruno Haible <bruno@clisp.org>
326 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
327 not on all platforms that have <wchar.h>.
328 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
330 2004-03-09 Paul Eggert <eggert@twinsun.com>
332 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
334 * getopt_int.h: New file, also synced from libc.
336 2004-03-07 Paul Eggert <eggert@twinsun.com>
338 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
339 '#if' expressions. Unlike the code it replaces, it does not
340 depend on (defined _SC_PAGESIZE). However, it does depend on
341 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
342 first reported by Jason Andrade in
343 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
345 2004-01-18 Simon Josefsson <jas@extundo.com>
347 * strdup.h: New file.
348 * strdup.c: Include it.
349 * path-concat.c: Include strdup.h. Drop strdup declaration.
350 * userspec.c: Include strdup.h. Drop strdup declaration.
352 2004-02-06 Karl Berry <karl@gnu.org>
354 * config.charset: update from gettext 0.14.1.
356 2004-02-05 Paul Eggert <eggert@twinsun.com>
358 Add comments and code, prompted by suggestions from Bruno Haible
360 * quotearg.h (quotearg_alloc): New decl. Improve the comments
361 describing the enum quoting_style values.
362 * quotearg.c (quotearg_alloc): New function.
363 (quotearg_buffer_restyled): Treat lone { and } as special.
364 Treat = as special. Work around bug with older shells
365 that "see" a '\' that is really the 2nd byte of a multibyte char.
366 Quote empty string with shell_quoting_style.
368 2004-02-03 Bruno Haible <bruno@clisp.org>
370 * pipe.h: New file, from GNU gettext.
371 * pipe.c: New file, from GNU gettext.
373 2004-01-27 Bruno Haible <bruno@clisp.org>
375 * execute.h: New file, from GNU gettext.
376 * execute.c: New file, from GNU gettext.
377 * w32spawn.h: New file, from GNU gettext.
379 2004-01-23 Paul Eggert <eggert@twinsun.com>
381 Exit-status fix from coreutils.
383 Use exit_failure consistently in place of EXIT_FAILURE,
384 so that program exit statuses are consistent on failure.
386 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
387 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
388 * argmatch.h: Comment fix to match the above.
389 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
390 Now a macro referring to exit_failure, instead of a separate
391 variable. Include "exitfail.h" to get it.
392 * xstrtol.h: Include "exitfail.h".
393 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
395 * long-options.c (parse_long_options): Use prototype
396 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
399 2004-01-21 Jim Meyering <jim@meyering.net>
401 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
402 so as not to conflict with a different-sized __mktime_internal
403 function in GNU libc.
404 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
405 Problem building statically-linked `ls' reported by Michael Brunnbauer.
407 2004-01-18 Paul Eggert <eggert@twinsun.com>
409 Merge from diffutils.
411 * file-type.c (file_type): Add typed memory objects.
412 * file-type.h (S_TYPEISTMO): New macro.
414 * c-stack.h (c_stack_action): Remove argv argument.
415 * c-stack.c (c_stack_action): Likewise. All uses changed.
416 (die): Don't calculate message unless segv_action returns.
417 (get_stack_location, min_address_from_argv, max_address_from_argv,
418 volatile stack_base, volatile_stack_size): Remove.
419 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
420 that every segmentation violation is a stack overflow. (Ouch!)
421 See Debian bug 136249 (still outstanding) for more info about why
422 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
424 2003-11-30 Bruno Haible <bruno@clisp.org>
426 Safer stack allocation.
427 * setenv.c: Include allocsa.h.
428 (alloca): Remove fallback definition.
429 (freea): Remove macro.
430 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
433 2003-10-17 Bruno Haible <bruno@clisp.org>
435 * binary-io.h: Avoid warnings on Cygwin.
437 2003-12-28 Bruno Haible <bruno@clisp.org>
439 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
440 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
442 2003-11-28 Bruno Haible <bruno@clisp.org>
444 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
446 2003-11-27 Bruno Haible <bruno@clisp.org>
448 * wait-process.c: On Windows, include windows.h. Needed on mingw.
450 2003-11-17 Bruno Haible <bruno@clisp.org>
452 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
454 2003-11-24 Bruno Haible <bruno@clisp.org>
456 * xallocsa.h: New file, from GNU gettext.
457 * xallocsa.c: New file, from GNU gettext.
459 2003-11-24 Bruno Haible <bruno@clisp.org>
461 * allocsa.h: New file, from GNU gettext.
462 * allocsa.c: New file, from GNU gettext.
464 2003-11-24 Bruno Haible <bruno@clisp.org>
466 * eealloc.h: New file.
468 2004-01-15 Jim Meyering <jim@meyering.net>
470 Merge from coreutils.
472 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
473 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
474 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
476 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
477 optional configure-time default.
479 * version-etc.c (version_etc_copyright): Update copyright date.
481 * xreadlink.c (xreadlink): Correct outdated comment.
483 2004-01-15 Paul Eggert <eggert@twinsun.com>
485 Merge from coreutils.
487 * posixver.c: Include posixver.h.
489 * same.c: Include <stdbool.h>, <limits.h>.
490 (_POSIX_NAME_MAX): Define if not defined.
492 (same_name): If file names are silently truncated, report
493 that the file names are the same if they are the same after
494 the silent truncation.
496 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
498 * xstrtod.c (xstrtod): Likewise. All callers changed to
499 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
502 2004-01-14 Paul Eggert <eggert@twinsun.com>
504 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
505 with like-named macro in fnmatch.c.
506 (EXT): Use an internal constant instead.
508 Merge fnmatch patches from glibc.
509 * fnmatch.c (mbsinit): Remove define.
510 Add libc_hidden_ver (__fnmatch, fnmatch).
511 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
512 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
514 2003-12-14 Karl Berry <karl@gnu.org>
516 * config.charset: update from gettext-runtime.
518 2003-12-03 Paul Eggert <eggert@twinsun.com>
520 * getgroups.c (getgroups): xmalloc takes one argument, not two.
521 Bug reported by Alfred M. Szmidt.
523 2003-11-29 Karl Berry <karl@gnu.org>
525 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
527 2003-11-23 Paul Eggert <eggert@twinsun.com>
528 Bruno Haible <bruno@clisp.org>
530 * printf-parse.h: Don't include sys/types.h.
531 (ARG_NONE): New macro.
532 (char_directive): Change type of *arg_index fields to size_t.
533 * printf-parse.c: Don't include sys/types.h.
534 (SSIZE_MAX): Remove macro.
535 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
536 Remove unnecessary overflow check.
537 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
540 2003-11-24 Paul Eggert <eggert@twinsun.com>
542 * alloca.c: Remove dependency on xalloc module.
543 (xalloc_die): Remove.
544 (memory_full) [!defined emacs]: New macro.
545 [!defined emacs]: Don't include xalloc.h.
546 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
547 address arithmetic overflows. Change datatypes a bit to avoid
550 2003-11-22 Jim Meyering <jim@meyering.net>
552 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
554 2003-11-17 Bruno Haible <bruno@clisp.org>
556 * vasnprintf.c (alloca): Remove fallback definition.
557 (freea): Remove definition.
558 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
559 Reported by Paul Eggert.
561 2003-11-17 Jim Meyering <jim@meyering.net>
563 On systems without utime and without a utimes function capable of
564 dealing with a NULL struct utimbuf* argument, this utime replacement
565 could -- in unusual circumstances -- leak a file descriptor.
566 * utime.c: Include <unistd.h> and <errno.h>.
567 (utime_null): Be sure to close `fd' and to preserve errno.
568 Reported by Geoff Collyer via Arnold Robbins.
570 2003-11-16 Paul Eggert <eggert@twinsun.com>
571 Bruno Haible <bruno@clisp.org>
573 Protect against address arithmetic overflow.
574 * printf-args.h: Include stddef.h.
575 (arguments): Change type of field 'count' to size_t.
576 * printf-args.c (printf_fetchargs): Use size_t instead of
577 'unsigned int' where appropriate.
578 * printf-parse.h: Include sys/types.h.
579 (char_directive): Change type of *arg_index fields to ssize_t.
580 (char_directives): Change type of fields 'count', max_*_length to
582 * printf-parse.c: Include sys/types.h and xsize.h.
583 (SSIZE_MAX): Define fallback value.
584 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
585 instead of 'int' where appropriate. Check a_allocated, d_allocated
586 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
587 * vasnprintf.c: Include xsize.h.
588 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
589 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
590 overflow. Avoid wraparound when converting a width or precision from
593 2003-11-16 Bruno Haible <bruno@clisp.org>
595 Update from GNU gettext.
596 * printf-parse.c: Generalize to it can be compiled for wide strings.
597 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
598 * vasnprintf.c: Generalize to it can be compiled for wide strings.
599 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
600 SNPRINTF): New macros.
601 Don't include <alloca.h> if the file is used inside libintl.
602 (local_wcslen): New function, for Solaris 2.5.1.
603 (VASNPRINTF): Use it instead of wcslen.
605 2003-11-16 Bruno Haible <bruno@clisp.org>
607 * xsize.h (xmax): New function.
608 (xsum, xsum3, xsum4): Declare as "pure" functions.
610 2003-11-12 Paul Eggert <eggert@twinsun.com>
612 * xalloc.h: Do not include <limits.h> or <stdint.h>.
613 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
614 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
615 heuristic is just as accurate as far as we know, and it removes a
616 dependency on size_max.m4 and ptrdiff_max.m4.
618 2003-11-12 Paul Eggert <eggert@twinsun.com>
620 * xstrtol.c (__xstrtol): Remove "break" immediately after
621 "return", to pacify some unknown compiler. Problem reported
624 2003-11-11 Bruno Haible <bruno@clisp.org>
626 * xsize.h (SIZE_MAX): Remove fallback definition.
627 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
630 2003-11-10 Paul Eggert <eggert@twinsun.com>
632 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
633 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
634 rejected some allocations of exactly SIZE_MAX - 2 bytes.
636 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
637 not (size_t) -1, since it's defined here.
639 2003-11-06 Paul Eggert <eggert@twinsun.com>
641 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
642 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
643 Reject sizes of exactly SIZE_MAX bytes.
644 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
645 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
647 2003-11-05 Bruno Haible <bruno@clisp.org>
649 * xsize.h: Include limits.h, to avoid a possible collision with
650 SIZE_MAX defined in <limits.h> on Solaris.
652 2003-11-04 Bruno Haible <bruno@clisp.org>
655 * linebreak.c: Include xsize.h.
656 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
657 argument for overflow.
658 Suggested by Paul Eggert.
660 2003-10-31 Bruno Haible <bruno@clisp.org>
662 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
663 to avoid (extremely rare) race condition.
664 Suggested by Paul Eggert.
666 2003-11-03 Jim Meyering <jim@meyering.net>
668 * userspec.c: Include "userspec.h".
669 * userspec.h: New file.
671 2003-10-31 Paul Eggert <eggert@twinsun.com>
673 * mountlist.h (struct mount_entry.me_type_malloced): New member.
674 * mountlist.c (SIZE_MAX): Define if not defined already.
675 (read_filesystem_list): Set and use me_type_malloced.
676 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
677 whatever the type happens to be), for brevity and consistency.
678 Check for size calculation overflow on Alphas running OSF/1.
680 2003-10-31 Jim Meyering <jim@meyering.net>
682 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
684 * linebuffer.c: Include <string.h> for declaration of memset.
686 2003-10-30 Paul Eggert <eggert@twinsun.com>
687 Bruno Haible <bruno@clisp.org>
689 * vasprintf.c: Include <limits.h>, <stdlib.h>.
690 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
692 2003-10-29 Paul Eggert <eggert@twinsun.com>
694 * xalloc.h (xalloc_oversized): Now a macro, not a function,
695 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
697 * quotearg.c (quotearg_n_options): Use it.
698 * group-member.c: Include <stdbool.h>.
699 (free_group_info): Arg is now const *; don't free arg.
700 (get_group_info): Now returns bool and accepts struct group_info *,
701 rather than returning a malloc'ed struct group_info *.
702 All uses changed. Check for overflow in internal size calculation.
704 * getusershell.c (readname): Simplify the code by using x2nrealloc
705 rather than xmalloc/xrealloc.
706 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
707 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
708 conformance bug: the old code used a pointer after freeing the
709 storage that it addressed.
710 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
711 rather than doing it by hand.
712 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
713 the buffer preserved. Use free and xmalloc instead.
714 * quotearg.c (quotearg_n_options): Likewise.
715 Use a simpler test for size overflow. Don't use xalloc_oversized
716 because unsigned int might be wider than size_t (!); this suggests
717 that we should switch from unsigned int to size_t for slot numbers.
719 2003-10-27 Bruno Haible <bruno@clisp.org>
721 * stdbool_.h: Better support for BeOS.
723 2003-10-27 Paul Eggert <eggert@twinsun.com>
725 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
726 to allocate the returned structure. Do not allocate a subarray,
727 as x2nrealloc will do that.
728 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
729 instead of xnrealloc.
730 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
732 2003-10-26 Paul Eggert <eggert@twinsun.com>
734 * xalloc.h (xalloc_oversized): New static inline function, for
735 callers that want to do their own size-overflow checking. Include
736 <stdbool.h>, since xalloc_oversized returns bool.
737 * xalloc.c (array_size_overflow): Remove. All callers changed
738 to use xalloc_oversized.
740 Add two functions x2realloc, x2nrealloc, for programs that grow
741 arrays dynamically by doubling their sizes.
742 * xalloc.h (x2realloc, x2nrealloc): New decls.
743 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
746 Port to C99 semantics for 'inline' of external functions.
747 Bug reported by Bruno Haible.
748 * xmalloc.c (xnmalloc_inline): New static inline function,
749 with the old contents of xnmalloc.
750 (xnmalloc, xmalloc): Use it.
751 (xnrealloc_inline): New static inline function,
752 with the old contents of xnrealloc.
753 (xnrealloc, xrealloc): Use it.
755 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
757 2003-10-25 Paul Eggert <eggert@twinsun.com>
759 Fix several address-calculation bugs in the hash modules,
760 plus some minor code cleanup.
762 * hash.h: Include <stdbool.h>, for bool.
763 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
764 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
765 hash_get_n_entries, hash_get_max_bucket_length,
766 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
767 hash_rehash): Use size_t rather than unsigned.
768 * hash.c (struct hash_table, hash_get_n_buckets,
769 hash_get_n_buckets_used, hash_get_n_entries,
770 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
771 hash_get_entries, hash_do_for_each, hash_string, is_prime,
772 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
774 (SIZE_MAX): Define if not defined.
775 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
776 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
778 Use const * when possible.
779 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
780 (check_tuning): Fix bug: if tuning parameters were very close to
781 0 or 1, rounding errors could have caused subscript violations.
782 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
783 (hash_initialize): Add 'fail:' label
784 to free table and return NULL, and use it to simplify code.
785 Use calloc rather than clearing the storage ourself.
786 (hash_initialize, hash_rehash): Check for arithmetic overflow in
787 buffer size calculations.
788 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
789 Include <stddef.h>, for size_t.
790 * hash-pjw.c (hash_pjw): Likewise.
791 Switch to method described by Bruno Haible.
792 Include <limits.h>, for CHAR_BIT.
793 (SIZE_BITS): New macro.
795 2003-10-21 Paul Eggert <eggert@twinsun.com>
797 * getndelim2.c (getndelim2): When size calculation overflows,
798 ceiling the allocation at NMAX bytes rather than silently
799 discarding input bytes before NMAX is reached. This makes
800 a difference only if NMAX exceeds SIZE_MAX / 2.
802 * obstack.c: Merge from glibc.
803 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
804 Add libc_hidden_def (_obstack_newchunk).
805 (_obstack_free) [! defined _LIBC]: Remove.
806 [defined _LIBC]: Make a strong alias from obstack_free, rather than
807 a clone of the function body.
808 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
809 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
811 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
812 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
815 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
816 (obstack_ptr_grow_fast, obstack_int_grow_fast):
817 Don't use lvalue casts, as GCC plans to remove support for them
818 in GCC 3.5. Reported by Joseph S. Myers. This bug
819 was also present in the non-GCC version, indicating that this
820 code had always been buggy and had never been widely used.
821 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
822 Use the fast variant of each macro, rather than copying the
823 definiens of the fast variant; that way, we'll be more likely to
824 catch future bugs in the fast variants.
826 2003-10-20 Bruno Haible <bruno@clisp.org>
828 * wait-process.h: New file, from GNU gettext.
829 * wait-process.c: New file, from GNU gettext.
831 2003-10-19 Jim Meyering <jim@meyering.net>
833 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
835 2003-10-16 Paul Eggert <eggert@twinsun.com>
837 * getgroups.c: Include <errno.h>, <stdlib.h>.
838 (getgroups): First arg is int, not size_t.
839 Don't let 'free' mangle errno.
841 2003-10-16 Jim Meyering <jim@meyering.net>
843 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
845 2003-10-15 Paul Eggert <eggert@twinsun.com>
847 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
849 (new_exclude, add_exclude_file): Initial size no longer needs to
851 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
852 our own address arithmetic overflow checking.
854 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
855 (fnmatch): Do not alloca more than 2000 wide characters;
856 instead, use malloc for large buffers.
857 Check for address arithmetic overflow, and return -1
858 with errno set to ENOMEM in that case.
859 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
860 (NEW_PATTERN): Do not alloca more than 8000 bytes;
861 instead, return -1. Check for address arithmetic overflow.
863 2003-10-14 Paul Eggert <eggert@twinsun.com>
865 Handle invalid suffixes and overflow independently, so that
866 callers can treat them independently as needed. Fix some bugs in
867 suffix handling, e.g., "100k@" was not diagnosed as an invalid
868 suffix for a human-readable blocksize. The major caller-visible
869 change is the addition of a new
870 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
871 that both overflow and suffix chars were found.
873 * human.c (humblock): Don't check separately for invalid suffix
874 char; that is xstrtoumax's job (now that its bug is fixed).
875 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
876 INTMAX_MAX]: New macros.
877 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
878 TYPE_MAXIMUM): New macros.
879 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
880 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
881 if overflow occurs, as it's what __strtol does and it's more useful
883 (__xstrtol): If __strtol reports some error other than ERANGE,
884 reflect it to the caller as LONGINT_INVALID. If it reports
885 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
886 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
887 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
889 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
890 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
891 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
892 [defined UINTMAX_MAX]: New macros.
894 2003-10-14 Bruno Haible <bruno@clisp.org>
896 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
897 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
898 Also use volatile where needed.
900 2003-10-12 Paul Eggert <eggert@twinsun.com>
902 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
903 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
904 and define in terms of the other primitives.
905 * xmalloc.c: Include stdbool.h; do not include exit.h.
906 (SIZE_MAX): Define if not already defined.
907 (array_size_overflow): New function.
908 (xalloc_die): Abort instead of exiting if 'error' returns.
909 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
910 (xmalloc, xrealloc): Use them.
911 (xcalloc): Check for address arithmetic overflow.
912 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
913 a bit faster than strcpy.
915 2003-10-08 Paul Eggert <eggert@twinsun.com>
917 Merge getpass from libc, plus a few fixes.
919 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
921 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
922 __fsetlocking to empty.
923 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
924 do include <bits/libc-lock.h>.
925 Do not include <fcntl.h>; not needed.
926 [_LIBC]: Include <wchar.h>.
927 (NOTCANCEL_MODE): New macro.
928 (flockfile, funlockfile) [_LIBC]: New macros.
929 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
930 [!_LIBC]: New macros.
931 (call_fclose): New function.
932 (getpass): Use it. Save tty stream separately; this simplifies the
933 code and makes it more reliable if stdin happens to equal stdout.
934 Invoke __fsetlocking on tty.
935 Handle thread cancellation if needed.
936 Namespace cleanup (use __tcgetattr, __getline).
937 Use bool for Booleans.
938 [USE_IN_LIBIO]: Handle wide streams.
939 [!_LIBC]: Unconditionally do the fseek, since we don't know what
940 stream might go where.
942 * unlocked-io.h: Include <stdio.h>, so that the caller
943 doesn't have to include <stdio.h> before us.
944 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
945 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
946 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
947 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
948 if not declared, so that we can use getpass.c code from libc without
950 (flockfile, ftrylockfile, funlockfile): New macros.
952 2003-10-06 Bruno Haible <bruno@clisp.org>
954 * version-etc-2.h: Remove file.
955 * version-etc-2.c: Remove file.
957 2003-09-25 Jim Meyering <jim@meyering.net>
958 Bruno Haible <bruno@clisp.org>
960 This lets translators provide better translations for the
961 "Written by ..." part of --version output.
962 * version-etc.h: Include stdarg.h.
963 (version_etc_copyright): Declare as readonly.
964 (version_etc): Make this function variadic with a NULL-terminated list
965 of author name strings.
966 (version_etc_va): New declaration.
967 * version-etc.c: Include stdarg.h, stdlib.h.
968 (version_etc_copyright): Declare as readonly.
969 (version_etc_va): New function. Provide a different translatable string
970 for each possible number of authors < 10. Abbreviate when there are 10
972 (version_etc): Make this function variadic. Call version_etc_va.
973 Suggestion from Gary V. Vaughan.
975 * long-options.h (parse_long_options): Change prototype: the authors
976 string is moved to the end and becomes variadic.
977 * long-options.c: Include stdarg.h.
978 (parse_long_options): Make this function variadic, too.
979 Call version_etc_va, not version_etc.
981 2003-10-06 Bruno Haible <bruno@clisp.org>
983 * fatal-signal.h: New file, from GNU gettext.
984 * fatal-signal.c: New file, from GNU gettext.
986 2003-10-04 Karl Berry <karl@gnu.org>
988 * argp*: update from libc.
990 2003-10-01 Larry Jones <lawrence.jones@eds.com>
992 * getpass.c (getpass): Use a no-op fseek when switching from input to
993 output mode on the same stream.
995 2003-09-29 Paul Eggert <eggert@twinsun.com>
997 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
998 Fix arg typo in previous patch.
1000 2003-09-28 Jim Meyering <jim@meyering.net>
1002 * error.c: Correct cpp indentation.
1004 2003-09-27 Paul Eggert <eggert@twinsun.com>
1006 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
1007 Omit the special code that used __typeof__, since we worry that
1008 it could be more trouble than it's worth. See:
1009 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
1010 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
1014 2003-09-26 Jim Meyering <jim@meyering.net>
1016 * error.c (error_tail): Move some declarations
1017 into inner scope where the local variables are used.
1019 2003-09-26 Bruno Haible <bruno@clisp.org>
1021 * stpncpy.h (gnu_stpncpy): New declaration.
1022 (stpncpy): Define as alias for gnu_stpncpy.
1023 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
1025 2003-09-26 Paul Eggert <eggert@twinsun.com>
1027 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
1028 (error_tail): Do not loop, reallocating temporary buffer, since
1029 the output cannot contain more wide characters than the input
1030 contains bytes, the size must be big enough already. This avoids
1031 one potential size overflow calculation. Check for size overflow
1032 when calculating temporary buffer size. Free temporary buffer
1033 when done, if it was allocated with malloc; this plugs a memory
1034 leak. Remove casts from void * to pointers, that are no longer
1035 needed now that we're assuming C89 or better.
1037 Merge error changes from glibc.
1039 * error.c, error.h: Update copyright notice header to match glibc.
1040 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
1041 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
1042 Disable cancellation while printing error.
1043 * error.h: Prepend __ to parameter names.
1045 2003-09-25 Karl Berry <karl@gnu.org>
1047 * argp-fmtstream.c, argp-help.c: update from libc.
1049 2003-09-25 Bruno Haible <bruno@clisp.org>
1051 * version-etc-2.h: New file, from version-etc.h with modifications.
1052 * version-etc-2.c: New file, from version-etc.c with modifications.
1054 2003-09-25 Simon Josefsson <jas@extundo.com>
1056 * xgetdomainname.h: New file.
1057 * xgetdomainname.c: New file.
1059 2003-09-25 Simon Josefsson <jas@extundo.com>
1060 Bruno Haible <bruno@clisp.org>
1062 * getdomainname.h: New file.
1063 * getdomainname.c: New file.
1065 2003-09-24 Paul Eggert <eggert@twinsun.com>
1067 * linebuffer.c (freebuffer): Don't free the argument, just
1068 the buffer associated with the argument. Bug reported by
1071 2003-09-19 Karl Berry <karl@gnu.org>
1073 * argp.h: update from libc.
1075 2003-09-16 Paul Eggert <eggert@twinsun.com>
1077 * linebuffer.c (readlinebuffer): Return NULL immediately upon
1078 input error, instead of returning NULL the next time we are called
1079 (and therefore losing track of errno).
1081 2003-09-15 Paul Eggert <eggert@twinsun.com>
1083 * getndelim2.c (getndelim2): Don't trash errno when a read
1084 fails, so that the caller gets the proper errno.
1086 * readutmp.c (read_utmp): Likewise.
1087 Check for fstat error. Close stream and free storage
1090 2003-09-14 Bruno Haible <bruno@clisp.org>
1092 * fwriteerror.h: New file.
1093 * fwriteerror.c: New file.
1095 2003-09-14 Jim Meyering <jim@meyering.net>
1097 * getloadavg.c: Correct cpp indentation.
1098 * strdup.c: Likewise.
1099 * vasnprintf.c: Likewise.
1101 2003-09-12 Paul Eggert <eggert@twinsun.com>
1103 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
1104 * obstack.c [!defined _LIBC]: Likewise.
1105 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
1106 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
1107 * exitfail.c: Don't include stdlib.h; no longer needed.
1109 More changes to assume C89 or better.
1111 * error.c (error_tail): Assume vprintf.
1113 * argmatch.c (getenv): Remove decl.
1114 * progreloc.c (get_full_program_name): Define via prototype.
1115 * setenv.c (clearenv): Likewise.
1116 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
1118 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
1119 (malloc, memcpy): Remove decls.
1120 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
1121 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
1122 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1123 (memcpy): Remove macro.
1124 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
1125 (__P): Remove. All uses removed.
1126 (PTR): Remove. All uses changed to void *.
1127 (CHAR_BIT, NULL): Remove.
1128 (spaces, zeros, memset_space, memset_zero)
1129 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
1131 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
1132 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
1133 Define with prototype.
1134 Remove now-unnecessary prototype decl.
1135 (extra_args_spec): Assume ANSI C. All uses changed.
1136 (extra_args_spec_iso): Remove.
1137 (my_strftime, emacs_strftimeu): Define via prototype.
1138 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
1140 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
1141 * strtoimax.c: Include <stdlib.h> unconditionally.
1142 (strtoul, strtol): Remove decls.
1143 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
1145 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1146 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
1147 (LOCALE_PARAM_PROTO): New macro.
1148 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
1149 (INTERNAL (strtol), strtol): Define with a prototype.
1150 (PARAMS): Remove. All uses removed.
1151 * tempname.c: Include <string.h> unconditionally.
1152 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
1153 * xgethostname.c (main): Define with a prototype.
1154 * xmalloc.c: Include "xalloc.h" first, to check interface.
1155 Include <stdlib.h> unconditionally.
1156 (calloc, malloc, realloc, free): Remove decls.
1157 * xstrtod.c: Include "xstrtod.h" first, to check interface.
1158 Include <stdlib.h> unconditionally. Sort include file names.
1160 (xstrtod): Define with a prototype.
1161 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
1162 (strtol, strtoul): Remove decls.
1164 2003-09-11 Paul Eggert <eggert@twinsun.com>
1166 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
1167 Include <stdlib.h>, <string.h> unconditionally.
1168 Remove now-unnecessary cast to char *.
1169 * strnlen.c: Include <string.h> unconditionally.
1170 * yesno.c (yesno): Define with a prototype.
1172 2003-09-10 Bruno Haible <bruno@clisp.org>
1174 * strcspn.c: Include <string.h> unconditionally.
1175 * strpbrk.c: Include <string.h> unconditionally.
1176 * strstr.c: Include <string.h> unconditionally.
1177 * unicodeio.c: Include <string.h> unconditionally.
1178 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
1179 * unsetenv.c: Likewise.
1180 * xreadlink.c: Include <stdlib.h> unconditionally.
1181 * yesno.c: Include <stdlib.h> unconditionally.
1182 (rpmatch): Add prototype.
1184 2003-09-10 Jim Meyering <jim@meyering.net>
1186 * error.c: Correct indentation of cpp directives.
1188 2003-09-09 Paul Eggert <eggert@twinsun.com>
1192 * acosl.c (main): Use a prototype.
1193 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
1196 * getloadavg.c (getloadavg, main): Define via prototypes.
1198 * getopt.h (struct option.name): Assume C89, and use 'const'.
1199 (getopt, etopt_long, getopt_long_only, _getopt_internal)
1200 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
1202 * getopt.c (const): Remove macro.
1203 Include <string.h> unconditionally.
1204 (my_index): Remove; all uses changed to strchr.
1205 (strlen): Remove decl.
1206 (exchange): Remove forward decl; no longer needed.
1207 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
1208 Define with prototype.
1209 * getopt1.c (const): Remove macro.
1210 (getopt_long, getopt_long_only, main): Define with prototype.
1212 * getugroups.c: Include <string.h> unconditionally.
1214 * getusershell.c: Include <stdlib.h> unconditionally.
1215 (getusershell, setusershell, endusershell, readname, main):
1216 Define with prototypes.
1218 * group-member.c: Include group-member.h first.
1219 Include <stdlib.h> unconditionally.
1221 * hard-locale.c: Include hard-locale.h first.
1222 Include <stdlib.h>, <string.h> unconditionally.
1224 * hash.c (free, malloc): Remove decls.
1225 Include <stdlib.h> unconditionally.
1227 * human.c: Include <stdlib.h>, <string.h> unconditionally.
1228 (getenv): Do not declare.
1230 * idcache.c: Include <string.h> unconditionally.
1232 * long-options.c: Include long-options.h first, to test interface.
1233 Include <stdlib.h> unconditionally.
1235 * makepath.c: Include makepath.h first, to test interface.
1236 Include <stdlib.h> and <string.h> unconditionally.
1238 * linebuffer.c: Include <stdlib.h>.
1239 (free): Remove decl.
1241 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
1242 rpl_malloc returns void *, not char *.
1243 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
1245 * md5.h: Include <limits.h> unconditionally.
1246 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
1247 (__P): Remove; all uses removed.
1248 * md5.c: Include "md5.h" first.
1249 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
1250 md5_buffer, md5_process_bytes, md5_process_block):
1251 Define with prototypes.
1252 * sha.h (__P): Remove all uses. (It wasn't defined??)
1253 * sha.c: Include "sha.h" first.
1254 Include <stdlib.h>, <string.h> unconditionally.
1256 * memchr.c (__ptr_t): Remove; all uses changed to void *.
1257 * memcmp.c (__ptr_t): Likewise.
1258 * memrchr.c (__ptr_t): Likewise.
1259 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
1260 Include <string.h> unconditionally.
1261 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
1262 * memchr.c: Include <stdlib.h> unconditionally.
1263 * memchr.c (LONG_MAX): Remove.
1264 * memrchr.c (LONG_MAX): Likewise.
1265 * memchr.c (__memchr): Define via a prototype.
1266 * memrchr.c (__memrchr): Likewise.
1267 * memcmp.c (__P): Remove, and remove all uses.
1268 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
1269 Remove forward decls; no longer needed.
1270 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
1271 Use types required by C89 in prototype.
1273 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
1274 * savedir.c: Likewise.
1275 * mkdir.c (free): Remove decl.
1276 * rmdir.c (rmdir): Define with a prototype.
1277 * savedir.c: Include savedir.h first, to test interface.
1279 * mktime.c (STDC_HEADERS): Remove.
1280 Include <stdlib.h>, <string.h> unconditionally.
1282 * modechange.c: Include <stdlib.h> unconditionally.
1283 (malloc): Remove decl.
1285 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
1286 (free): Remove decl.
1288 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
1289 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
1290 (This type really should be intptr_t, but that's a C99ism.)
1291 (_obstack_memcpy): Remove: all uses changed to memcpy.
1292 Include <string.h> unconditionally.
1293 (struct obstack): Assume __STDC__ for types of members
1294 chunkfun, freefun, extra_arg.
1295 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
1296 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
1297 obstack_begin, obstack_specify_allocation,
1298 obstack_specify_allocation_with_arg, obstack_chunkfun,
1299 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
1300 Remove unprototyped decls and the macros that use them.
1301 * obstack.c (POINTER): Remove. All uses changed to void *.
1302 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
1303 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
1304 (defined __STDC__ && __STDC__)]:
1305 Remove nonprototyped code.
1306 Include <stdlib.h> unconditionally.
1307 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
1308 _obstack_allocated_p, _obstack_free, obstack_free,
1309 _obstack_memory_used, print_and_abort):
1310 Define using prototypes.
1311 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
1312 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
1313 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
1314 obstack_next_free, obstack_object_size, obstack_room) [0]:
1315 Remove unused, unprototyped code.
1317 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
1319 * physmem.c (physmem_total, physmem_available, main): Define
1322 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
1323 (main): Define with a prototype.
1325 * posixver.c (getenv): Remove decl.
1327 * putenv.c (malloc): Returns void *, not char *.
1328 Include <string.h> unconditionally.
1329 (strchr, memcpy, NULL): Do not define.
1331 * readtokens.c: Include readtokens.h first, to test interface.
1332 Include <stdlib.h>, <string.h> unconditionally.
1333 (init_tokenbuffer): Define with a prototype.
1335 * regex.c (PARAMS): Remove. All uses removed.
1336 All uses of _RE_ARGS removed, too.
1337 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1339 (bzero): Assume memset exists.
1340 (memcmp, memcpy, NULL): Remove.
1341 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
1342 char, or assignments to local vars of type signed char.
1343 (init_syntax_once, PREFIX(extract_number_and_incr),
1344 PREFIX(print_partial_compiled_pattern),
1345 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
1346 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
1347 PREFIX(regex_grow_registers), PREFIX(regex_compile),
1348 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
1349 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
1350 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
1351 wcs_compile_range, byte_compile_range, truncate_wchar,
1352 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
1353 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
1354 count_mbs_length, wcs_re_match_2_internal,
1355 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
1356 PREFIX(alt_match_null_string_p),
1357 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
1358 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
1359 regfree, PREFIX(extract_number)): Define with prototype. Remove
1360 now-unnecessary declaration, if any.
1361 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
1363 Remove now-unnecessary casts among pointer types.
1364 * regex.h (_RE_ARGS): Remove. All uses removed.
1366 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
1367 (free): Remove decl.
1369 * rpmatch.c: Include <stdlib.h> unconditionally.
1371 * same.c: Include <stdlib.h>, <string.h> unconditionally.
1372 (free): Remove decl.
1374 * save-cwd.c: Include <stdlib.h> unconditionally.
1375 * xgetcwd.c: Likewise.
1377 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
1378 (free): Remove decl.
1380 * strchrnul.c (strchrnul): Define with a prototype.
1381 Fix bug: c_in was not converted to char before searching.
1383 The following changes are not K&R related:
1385 * group-member.h: Include <sys/types.h>, so that this file is
1387 * makepath.h: Likewise.
1389 * getusershell.c (readname, default_index, line_size, readname):
1390 Use size_t, not int, for sizes.
1391 (readname): If the size overflows, report an error instead of
1394 2003-09-09 Derek Robert Price <derek@ximbiot.com>
1396 * getndelim2.c: Assume stdlib.h per the C89 spec.
1398 2003-09-08 Paul Eggert <eggert@twinsun.com>
1400 Assume C89 or better; remove K&R cruft.
1401 A few of these changes were first proposed by Derek Robert Price
1402 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
1404 * addext.c: Include <string.h> unconditionally.
1405 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
1406 Don't declare getenv or malloc.
1408 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
1409 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
1411 (find_stack_direction, alloca): Use prototypes.
1413 * atexit.c (atexit): Define using a prototype.
1415 * basename.c, dirname.c, stripslash.c:
1416 Include <string.h> unconditionally.
1418 * bcopy.c: Include <stddef.h>.
1419 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
1421 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
1423 * error.h (error, error_at_line, error_print_progname)
1424 [! (defined (__STDC__) && __STDC__)]: Remove decls.
1425 * error.c: Include error.h first, to check interface.
1426 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1427 (VA_START): Remove; all uses changeed to va_start.
1428 (exit, strerror): Remove decls.
1429 (error_print_progname): Prototype uncondionally.
1430 Don't include <errno.h>; no longer needed.
1431 (private_strerror): Remove.
1432 (error_tail): Always define.
1433 (error, error_at_line): Assume C89 or better; always use prototypes.
1434 * fatal.c: Include "fatal.h" first, to test interface.
1435 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1436 (VA_START): Remove; all uses changed to va_start.
1437 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
1439 (exit): Remove decl.
1440 (fatal): Prototype unconditionally. Assume va_start works.
1441 Abort at end, to pacify gcc.
1443 * euidaccess.c (main): Define with a prototype.
1445 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
1447 * exitfail.c: Include <stdlib.h> unconditionally.
1449 * fnmatch_.h (__P): Remove. All uses changed to assume
1451 * fnmatch.c: Include fnmatch.h first, to test interface.
1452 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
1453 (getenv): Remove decl.
1454 (fnmatch): Define using a prototype.
1455 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
1456 (FCT): Define using a prototype.
1458 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
1460 * gethostname.c: Include <stddef.h>.
1461 (gethostname): Define with prototype. Length is size_t, not int.
1463 2003-09-08 Paul Eggert <eggert@twinsun.com>
1465 * getversion.c: Remove; was migrated to backupfile.c in 1997.
1466 getversion.c should have been removed then, but was accidentally
1469 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
1470 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
1472 2003-09-07 Paul Eggert <eggert@twinsun.com>
1474 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
1475 copy_tm_result. Bug reported by Simon Josefsson in
1476 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
1478 2003-09-06 Paul Eggert <eggert@twinsun.com>
1480 * time_r.c, time_r.h: New files.
1482 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
1484 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
1485 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
1487 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
1489 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
1490 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
1493 * timegm.c: Switch to glibc implementation, with the following changes:
1494 [defined HAVE_CONFIG_H]: Include <config.h>.
1495 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
1496 (__mktime_internal) [!defined _LIBC]: New decl.
1497 (__gmtime_r) [!defined _LIBC]: New macro and function.
1498 (timegm): Use a prototype, since gnulib assumes C89.
1499 Do not bother declaring tmp to be const, as it's not really usefu.
1500 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
1501 (timegm): Declare only if HAVE_DECL_TIMEGM.
1503 2003-09-03 Paul Eggert <eggert@twinsun.com>
1505 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
1506 Bug reported by Lute Kamstra in
1507 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
1509 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
1510 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
1511 course with correspondingly smaller numbers for tomorrow and
1512 yesterday. From Tadayoshi Funaba. Originally installed into
1513 sh-utils on 1999-08-07, but the patch got lost (I guess during the
1516 2003-08-31 Simon Josefsson <jas@extundo.com>
1518 * timegm.h: New file.
1519 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
1521 2003-08-31 Karl Berry <karl@gnu.org>
1523 * argp.h: update from libc.
1525 2003-08-28 Bruno Haible <bruno@clisp.org>
1527 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
1528 warning on QNX, which defines O_BINARY to 000000.
1530 2003-08-24 Bruno Haible <bruno@clisp.org>
1532 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
1533 MSVC7 <stdio.h> is included later.
1535 2003-08-20 Bruno Haible <bruno@clisp.org>
1537 * progname.h: New file, from GNU gettext.
1538 * progname.c: New file, from GNU gettext.
1539 * progreloc.c: New file, from GNU gettext.
1541 2003-08-19 Bruno Haible <bruno@clisp.org>
1543 * xstrdup.c: Assume <string.h> exists.
1545 2003-08-18 Jim Meyering <jim@meyering.net>
1547 * setenv.h: Indent nested cpp directive.
1548 * vasnprintf.c: Remove trailing blanks.
1550 2003-08-17 Simon Josefsson <jas@extundo.com>
1551 Bruno Haible <bruno@clisp.org>
1553 * xstrndup.h: New file.
1554 * xstrndup.c: New file.
1556 2003-08-17 Bruno Haible <bruno@clisp.org>
1558 * strndup.h: New file.
1560 2003-08-16 Paul Eggert <eggert@twinsun.com>
1562 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
1563 space, undoing this 2003-08-12 change:
1564 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
1566 2003-08-16 Jim Meyering <jim@meyering.net>
1568 Merge from coreutils.
1569 * xstrtoimax.c: #else #if -> #elif.
1570 * xstrtoumax.c: Likewise.
1572 2003-08-15 Paul Eggert <eggert@twinsun.com>
1574 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
1575 rather than tab, after '#' in shell-script copyright notices.
1576 Suggested by Bruno Haible.
1578 2003-08-15 Jim Meyering <jim@meyering.net>
1579 and Paul Eggert <eggert@twinsun.com>
1581 Merge from coreutils.
1582 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
1583 member but strut utmpx does not. Needed for AIX 4.3.3.
1584 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
1586 2003-08-15 Jim Meyering <jim@meyering.net>
1588 Merge from coreutils.
1589 * xgethostname.c: Include <stdlib.h>.
1590 (xghostname): Don't exit for anything other than memory-related
1591 failure; just return NULL.
1592 * userspec.c: Include "posixver.h".
1593 (parse_user_spec): Accept `.' as a separator only
1594 in pre-POSIX-200112 mode.
1595 * strtoimax.c: Use #elif rather than #else #if.
1596 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
1597 Remove function, now that we can rely on a working tzset function.
1598 [!_LIBC]: Ensure that the required autoconf test has been run.
1599 [!defined _NL_CURRENT && HAVE_STRFTIME]:
1600 Use underlying_strftime for %r.
1601 * sha.c: Merge in some clean-up and optimization changes from glibc.
1602 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
1603 Ensure that it is a multiple of 64.
1604 Rearrange loop exit tests so as to avoid performing an
1605 additional fread after encountering an error or EOF.
1606 * realloc.c: Update copyright date.
1608 2003-08-14 Jim Meyering <jim@meyering.net>
1610 Merge from coreutils.
1611 * obstack.h: Whitespace changes.
1612 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
1613 and xcalloc return values.
1614 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
1615 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
1616 hang on OSF/1 5.1 for DIR on both local and remote file systems.
1617 Reported by (and fix confirmed by) Nelson H. F. Beebe.
1618 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1620 Use mntctl's return value to drive the entry-processing loop, since
1621 we can't rely on the value of the vmt_length member in the last
1622 entry. On some systems doing so could result in exhausting
1623 virtual memory. Based in part on a patch from Mike Jetzer.
1625 2003-08-14 Jim Meyering <jim@meyering.net>
1626 and Paul Eggert <eggert@twinsun.com>
1628 Merges from coreutils, plus other fixes.
1629 * physmem.c: Merge in portability changes from gcc/libiberty
1630 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
1631 for credits and details. Thanks to Kaveh Ghazi for helping
1632 to keep these files in sync.
1633 (ARRAY_SIZE): Define it.
1634 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
1635 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
1636 (memcasecmp): Don't assume size_t fits in unsigned int.
1637 Remove casts and duplicate code.
1638 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
1639 (memcpy): Remove definition.
1640 Merge in some clean-up and optimization changes from glibc.
1641 [BLOCKSIZE]: Move definition to top of file.
1642 Ensure that it is a multiple of 64.
1643 Rearrange loop exit tests so as to avoid performing an
1644 additional fread after encountering an error or EOF.
1645 * md5.h (md5_uintptr): Define.
1646 * makepath.c (CLEANUP_CWD): Report an error if we failed to
1647 return to the initial working directory. Preserve errno
1649 * idcache.c: Include "xalloc.h".
1650 (xmalloc, xrealloc): Remove decls.
1651 (getuser): Remove casts no longer required in C89.
1652 * human.c: Include stdio.h, for sprintf.
1653 * group-member.c: Include "xalloc.h".
1654 (xmalloc, xrealloc): Remove decls.
1655 (get_group_info): Remove casts no longer required in C89.
1656 * getusershell.c (readname): Remove casts no longer required in C89.
1657 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
1658 * getline.c: Whitespace fix, from coreutils.
1660 2003-08-13 Paul Eggert <eggert@twinsun.com>
1662 * exclude.c: Include <ctype.h>
1663 (IN_CTYPE_DOMAIN): New macro.
1665 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
1668 * argp-help.c, argp-parse.c, config.charset, getopt.h:
1669 Undo previous (whitespace-only) change.
1671 2003-08-12 Paul Eggert <eggert@twinsun.com>
1673 * argp-help.c, argp-parse.c, config.charset, getopt.h:
1674 Normalize leading white space and remove trailing white space.
1675 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
1676 notice, as per ../config/srclist-update.
1678 Merge from coreutils.
1679 * euidaccess.h: New file.
1680 * euidaccess.c: Include it.
1681 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
1682 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
1683 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
1685 2003-08-11 Bruno Haible <bruno@clisp.org>
1687 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
1688 (vasnprintf): Use it instead of wcslen.
1690 2003-08-11 Bruno Haible <bruno@clisp.org>
1692 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
1693 value to ensure that _Bool promotes to int. Use #define for _Bool when
1694 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
1696 2003-08-10 Karl Berry <karl@gnu.org>
1698 * regex.h: update from libc (whitespace fix).
1700 2003-08-09 Paul Eggert <eggert@twinsun.com>
1702 Merge some files from coreutils. These changes were
1703 originally made by Jim Meyering.
1704 * acl.c: Include <sys/types.h> before <sys/stat.h>;
1705 many older Unixes require this.
1706 * alloca.c (alloca): Remove cast to argument of free;
1707 no longer needed in C89.
1708 * alloca_.h, regex.h: Fix white space to match
1709 what GNU indent does.
1711 2003-08-05 Paul Eggert <eggert@twinsun.com>
1713 * bumpalloc.h: Remove.
1715 2003-08-04 Paul Eggert <eggert@twinsun.com>
1717 * getloadavg.c: Change copyright notice and spacing to conform to
1720 Merge from coreutils.
1721 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
1723 * getdate.y (date): Also accept dates like May-23-2003; suggestion
1724 from Karl Berry, implemented by Jim Meyering.
1725 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
1726 from Dmitry V. Levin.
1727 Remove anachronistic cast of xrealloc.
1728 * fnmatch_.h (__const): Remove. Use 'const'.
1729 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
1730 type. Otherwise, it wouldn't compile with at least /bin/cc on
1731 ymp-cray-unicos9.0.2.X.
1732 Combine two mostly-identical uses of alloca into one.
1733 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
1735 2003-08-04 Dave Love <d.love@dl.ac.uk>
1739 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
1740 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
1741 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
1742 obsolete NLIST_NAME_UNION.
1743 [__GNU__]: Undef BSD and FSCALE.
1744 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
1746 2003-08-03 Paul Eggert <eggert@twinsun.com>
1748 * stdbool_.h (_Bool): Make it signed char, instead of
1749 an enum type, so that it's guaranteed to promote to int. See:
1750 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
1752 2003-07-31 Paul Eggert <eggert@twinsun.com>
1754 * strerror.c: Include config.h, limits.h. Declare sprintf.
1755 (strerror): Don't assume that a printable int fits in 14 bytes.
1757 2003-07-24 Derek Robert Price <derek@ximbiot.com>
1758 Bruno Haible <bruno@clisp.org>
1760 * getline.h (getline, getdelim): Change return type to ssize_t.
1761 * getline.c (getline, getdelim): Likewise.
1762 Remove _GNU_SOURCE define; now it's defined in config.h through
1765 2003-07-22 Paul Eggert <eggert@twinsun.com>
1767 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
1768 over-parenthesization in macros.
1770 Sync with coreutils.
1772 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
1775 Use `exit_failure' for xalloc and xmemcoll instead of their own
1776 private exit-failure variables.
1777 * xalloc.h (xalloc_exit_failure): Remove.
1778 * xmalloc.c: Likewise. Include exitfail.h.
1779 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
1780 * xmemcoll.h (xmemcoll_exit_failure): Remove.
1781 * xmemcoll.c: Likewise. Include exitfail.h.
1782 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
1784 2003-07-18 Paul Eggert <eggert@twinsun.com>
1786 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
1787 * closeout.c: Likewise. Include "closeout.h" right after config.h,
1788 to test that it can stand by itself. Include "exitfail.h".
1789 Clients should set exit_failure instead.
1790 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
1792 2003-07-18 Andreas Schwab <schwab@suse.de>
1794 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
1796 2003-07-18 Bruno Haible <bruno@clisp.org>
1798 * getndelim2.h: New file.
1799 * getndelim2.c: Make into a module of its own. Include config.h,
1801 (getndelim2): Make non-static. Change return type to ssize_t.
1802 * getline.h: Change argument names.
1803 * getline.c: Include getndelim2.h instead of getndelim2.c.
1804 * getnline.c: Include getndelim2.h.
1806 2003-07-17 Bruno Haible <bruno@clisp.org>
1808 * Makefile.am: Remove file.
1809 * Makefile.in: Remove file.
1811 2003-07-17 Bruno Haible <bruno@clisp.org>
1813 * getnline.h: New file.
1814 * getnline.c: New file.
1815 * getndelim2.c: New file, extracted from getline.c.
1816 (getndelim2): Renamed from getdelim2, with added nmax argument.
1817 * getline.c: Include getndelim2.c.
1818 (getdelim2): Moved out to getndelim2.c.
1819 (getline, getdelim): Update.
1821 2003-07-15 <karl@gnu.org>
1823 * vasnprintf.c: update from gettext.
1825 2003-07-15 Jim Meyering <jim@meyering.net>
1827 * makepath.c (make_path): Enclose diagnostic in _(...).
1829 2003-07-14 Paul Eggert <eggert@twinsun.com>
1831 * asnprintf.c, asprintf.c, config.charset, gettext.h,
1832 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
1833 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
1834 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
1835 vasprintf.c, vasprintf.h: Regenerate. These files are now being
1836 updated automatically by ../config/srclist-update. This changes
1837 their license from LPGL to GPL.
1839 2003-07-14 Jim Meyering <jim@meyering.net>
1841 Don't emit diagnostics. Let callers do that.
1842 * save-cwd.c: Don't include "error.h".
1843 (save_cwd): Don't call error. Ensure that errno is valid
1844 when returning nonzero.
1846 * save-cwd.h (restore_cwd): Update prototype.
1847 * save-cwd.c (restore_cwd): Remove two parameters.
1848 Simplify. Don't call error upon failure. Let callers do that.
1849 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
1850 when auditing is enabled. But don't bother updating the #if.
1852 2003-07-14 Simon Josefsson <jas@extundo.com>
1854 * mempcpy.h: New file.
1855 * mempcpy.c: New file.
1857 2003-07-14 Paul Eggert <eggert@twinsun.com>
1859 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
1860 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
1861 unicodeio.c, unicodeio.h, unlocked-io.h:
1862 Switch from LGPL to GPL.
1864 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
1866 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
1867 it breaks C++ compilation.
1868 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
1870 2003-07-10 Jim Meyering <jim@meyering.net>
1872 * vasnprintf.c: Remove trailing blanks.
1873 Make cpp indentation consistent.
1875 2003-07-09 Paul Eggert <eggert@twinsun.com>
1877 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
1878 posixver.c, strftime.c, strnlen.c, strverscmp.c:
1879 Switch from LGPL to GPL.
1881 2003-07-07 Paul Eggert <eggert@twinsun.com>
1883 * mktime.c: Fix some boundary cases and remove need for floating point.
1885 Issue a compile-time diagnostic if time_t is floating point, or if
1886 two's complement arithmetic is not in effect, or if arithmetic
1887 right shift does not propagate the sign. These assumptions were
1888 all in the original code but they weren't checked.
1890 (TIME_T_MIDPOINT, verify): New macros.
1891 (__isleap): Remove; it has integer overflow problems.
1892 (leapyear): New function, without those problems.
1893 (ydhms_tm_diff): Remove; splitting into two parts.
1894 (ydhms_diff): New function, containing the arithmetic part of
1895 the old ydhms_tm_diff function. Issue a compile-time
1896 diagnostic if we are not using C99 integer division.
1897 Avoid casts when possible.
1898 (guess_time_tm): New function, containing the checking part of
1899 the old ydhms_tm_diff function. Return the new value, rather than
1900 the difference between it and the old. Accept a new argument T
1901 so that *T specifies the old value. Check for overflow in the result.
1903 (__mktime_internal): Use a time_t offset, not a long int offset.
1904 This undoes the 2003-06-04 change, which is no longer needed now
1905 that we have better overflow checking.
1906 (localtime_offset): Likewise.
1908 (__mktime_internal): Avoid harmful overflow on hosts where time_t
1909 and long are 64-bit but int is only 32-bit.
1910 (ydhms_diff): Use long int to store year1 and yday1.
1911 Issue a compile-time diagnostic if long int is not wide enough.
1913 (__mktime_internal): Use long int to store adjusted year and yday.
1914 Use plain C rather than preprocessor commands, if that doesn't
1916 Check for overflow (and try to repair) after each probe
1917 rather than checking only at the very end. This avoids some bugs
1918 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
1919 does not equal GMT offset at maximum time).
1920 Use integer to check for overflow rather than floating point; this
1921 is more portable to non-IEEE hosts, and is a tad faster.
1922 When we detect that we are oscillating between two values,
1923 don't check whether tm_isdst has the requested value, since
1924 we already know the answer. When tm_isdst has the wrong value,
1925 use a different heuristic to find the right one, based on the
1926 extreme values actually observed in practice in tz2003a,
1927 rather than the (overly optimistic) "previous 3 calendar quarters".
1929 (not_equal_tm, print_tm, check_result): Use "const T" rather than
1930 "T const" to accommodate glibc style.
1931 (check_result): Use less-confusing report format. "long" -> "long int.
1933 Don't loop if the iteration overflows time_t.
1934 Allow a negative step in the iteration.
1936 2003-07-01 Paul Eggert <eggert@twinsun.com>
1938 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
1939 having it depend on HAVE_SYS_TYPES_H.
1941 2003-06-25 Bruno Haible <bruno@clisp.org>
1943 * readlink.c: New file.
1945 2003-06-20 Bruno Haible <bruno@clisp.org>
1947 Assume C89, so PARAMS isn't needed.
1948 * unicodeio.h (PARAMS): Remove.
1949 * unicodeio.c: Don't use PARAMS.
1951 2003-06-18 Jim Meyering <jim@meyering.net>
1953 Merge changes from coreutils.
1954 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
1955 Remove explicit declarations of xmalloc and realloc.
1957 (read_utmp): Remove anachronistic cast of xmalloc.
1959 2003-06-17 Paul Eggert <eggert@twinsun.com>
1961 Assume C89, so PARAMS isn't needed.
1962 * backupfile.h (PARAMS): Remove. All uses removed.
1963 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
1964 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
1965 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
1966 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
1967 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
1968 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
1969 xstrtol.h: Likewise.
1970 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
1971 same.h, strverscmp.h: Do not include config.h; no longer needed.
1972 Anyway, config.h should always be included before any other file.
1974 2003-06-11 Simon Josefsson <jas@extundo.com>
1976 * sysexit_.h: New file.
1978 2003-05-20 Derek Price <derek@ximbiot.com>
1980 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
1982 2003-06-10 Simon Josefsson <jas@extundo.com>
1984 * strchrnul.h: New file.
1985 * strchrnul.c: New file.
1987 2003-06-10 Simon Josefsson <jas@extundo.com>
1989 * argp.h: New file, from glibc.
1990 * argp-ba.c: New file, from glibc.
1991 * argp-eexst.c: New file, from glibc.
1992 * argp-fmtstream.c: New file, from glibc.
1993 * argp-fmtstream.h: New file, from glibc.
1994 * argp-fs-xinl.c: New file, from glibc.
1995 * argp-help.c: New file, from glibc.
1996 * argp-namefrob.h: New file, from glibc.
1997 * argp-parse.c: New file, from glibc.
1998 * argp-pv.c: New file, from glibc.
1999 * argp-pvh.c: New file, from glibc.
2000 * argp-xinl.c: New file, from glibc.
2002 2003-06-07 Jim Meyering <jim@meyering.net>
2004 * readtokens.h: Put `Free Software Foundation, Inc.'
2005 in place of my name in the copyright comment.
2006 Remove definition and uses of __P.
2009 * stat.c: Don't declare xmalloc explicitly.
2010 Instead, include "xalloc.h".
2011 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
2012 xrealloc, and xcalloc return values.
2013 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
2015 * xgetcwd.h: Remove definition/uses of PARAMS.
2017 2003-06-06 Jim Meyering <jim@meyering.net>
2019 * stdbool_.h: Renamed from stdbool.h.in.
2021 2003-06-06 Jim Meyering <jim@meyering.net>
2023 Merge from coreutils.
2024 * same.c: (same_name): Declare *_basename locals to be `const'.
2025 Consolidate declarations and initializations of *_base* locals.
2027 Merge from coreutils.
2028 This avoids a core dump on systems without GNU putenv,
2029 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
2030 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
2031 (unsetenv): New static function, from GNU libc.
2032 (rpl_putenv): Use it.
2034 * modechange.c: Remove trailing blanks.
2036 Merge from coreutils.
2037 * fsusage.c: Remove declaration of statfs.
2038 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
2040 * posixtm.c: Include <stdbool.h> unconditionally.
2042 2003-06-05 Paul Eggert <eggert@twinsun.com>
2044 * mktime.c (__mktime_internal): When resolving a tm_isdst
2045 mismatch, look in future quarters as well as past. This fixes a
2046 bug when processing fall-backwards gaps immediately after a long
2047 period of daylight-saving time.
2049 * mktime.c: Assume freestanding C89 or better.
2050 (HAVE_LIMITS_H): Remove. Assume it's 1.
2051 (__P): Remove; not used.
2052 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
2053 (mktime, not_equal_tm, print_tm, check_result,
2054 main): Use prototypes. Use const * where appropriate.
2055 (main): Fix typo in testing code that uncovered by above changes.
2056 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
2058 2003-06-04 Paul Eggert <eggert@twinsun.com>
2060 * mktime.c: Fix Debian bug 177940
2061 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
2062 (localtime_offset): Now long int, not time_t, because we want it
2063 to be guaranteed to be signed. All uses changed.
2064 (__mktime_internal): If overflow would occur when adding offset,
2067 Merge 'human' changes from coreutils. Rewrite to support
2068 locale-specific notations like thousands separators.
2069 * human.c: Simplify authorship notice.
2070 Include human.h immediately after config.h.
2071 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
2072 <limits.h>: Do not include, since human.h does.
2073 (SIZE_MAX, UINTMAX_MAX): New macros.
2074 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
2075 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
2076 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
2077 (power_letter): Renamed from suffixes.
2078 (generate_suffix_backwards): Remove.
2079 (adjust_value): Now takes int style (because of human.h changes)
2080 and long double value (for greater precision on some platforms).
2081 (group_number): New function.
2082 (human_readable): Use it. Use integer options, not enum.
2083 Put the options before the sizes in the arg list.
2084 Support all the new options.
2085 The old human_readable function has been removed;
2086 use inttostr.h instead.
2087 (human_readable, default_block_size, humblock):
2088 Use uintmax_t, not int, for block sizes.
2089 (human_readable_inexact, block_size_types): Remove.
2090 (block_size_opts): New constant.
2091 (human_options): Renamed from human_block_size, with new signature
2092 that allows block sizes up to UINTMAX_MAX. All callers changed.
2093 * human.h: Add copyright and authorship notice.
2094 Include <limits.h> and <stdbool.h> unconditionally.
2095 (PARAMS): Remove. All uses removed.
2096 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
2097 (enum human_inexact_style): Remove tag; now a nameless enum.
2098 (human_floor, human_ceiling, human_round_to_even): Now have
2099 values 2, 0, 1 rather than -1, 1, 0.
2100 (human_group_digits, human_suppress_point_zero, human_autoscale,
2101 human_base_1024, human_SI, human_B): New constants.
2102 (human_readable_inexact, human_block_size): Remove.
2103 (human_readable): Size args are now uintmax_t, not int.
2104 (human_options): New decl.
2106 * exclude.c: (new_exclude, add_exclude): Remove casts that are
2107 unnecessary now that we assume C89 or better. This change
2108 imported from coreutils.
2110 * mktime.c (__mktime_internal): Do not reject negative timestamps
2111 arbitrarily. This is the same patch as 2003-05-28, but it got lost
2112 in the 2003-05-30 sync from glibc.
2114 .h files should stand alone, but we shouldn't include <sys/types.h>
2115 if we can get away with just <stddef.h>.
2117 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
2118 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
2119 rather than <sys/types.h>, as we merely need size_t.
2120 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
2122 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
2123 Include <stdio.h>, to get FILE.
2124 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
2125 memcasecmp.h has included <stddef.h> and all we need is size_t.
2126 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
2127 our interface, instead of including <sys/types.h>
2129 2003-06-02 Paul Eggert <eggert@twinsun.com>
2132 Fix some minor time-related bugs with POSIX time arguments.
2133 Some valid time stamps were being rejected (notably -1, and
2134 time stamps before 1900 on 64-bit hosts). And some invalid
2135 time stamps were being accepted, e.g. September 31.
2137 * posixtm.h (posixtime): Return bool instead of time_t, so
2138 that we can return (time_t) -1 successfully.
2139 * posixtm.c: Likewise.
2140 [HAVE_STDBOOL_H]: Include <stdbool.h>.
2141 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
2142 (t): Remove static var.
2143 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
2144 of static var. All uses changed.
2145 (year): Do not reject years before 1900; they can occur with
2147 (posix_time_parse): Do not check for out-of-range components;
2148 that is now the caller's responsibility, since our checks were
2149 only approximations.
2150 (posixtime): Use mktime to check for out-of-range components,
2151 since it knows them exactly.
2152 If mktime returns (time_t) -1, check whether an error actually occurred
2153 by invoking localtime on -1.
2154 (main) [TEST_POSIXTIME]: Check for input data errors, and report
2155 posixtime failures better.
2156 Improve the test data (in comments only).
2158 2003-05-30 <karl@gnu.org>
2160 * mktime.c: update from libc.
2162 2003-05-30 Bruno Haible <bruno@clisp.org>
2164 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
2165 * localcharset.h: Likewise.
2166 * localcharset.c: Likewise.
2168 2003-05-28 Paul Eggert <eggert@twinsun.com>
2170 Assume the headers required for C89 freestanding compilers.
2171 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
2172 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
2173 without checking for HAVE_LIMITS_H.
2174 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
2175 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
2177 * fatal.c: Include <stdarg.h> without checking for __STDC__.
2178 * exclude.c: Include <stdbool.h> unconditionally.
2179 * tempname.c: Include <stddef.h> unconditionally.
2180 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
2181 * modechange.c, rpmatch.c (NULL): Don't define, since
2182 <stddef.h> does that.
2183 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
2184 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
2185 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
2186 * xstrtol.c: Likewise.
2187 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
2188 * savedir.c: Include <stddef.h> instead of defining NULL.
2190 * addext.c (addext): Use assignment rather than cast, to avoid
2191 warnings on some platforms.
2193 * mktime.c (__mktime_internal): Do not reject negative timestamps
2196 2003-05-10 Bruno Haible <bruno@clisp.org>
2198 * linebreak.c (iconv_string_length): Don't return -1 just because the
2199 string is longer than 4 KB.
2201 2003-05-12 Jim Meyering <jim@meyering.net>
2203 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
2204 the space-padded-by-default conversion specifiers, %e, %k, %l.
2206 2003-05-03 Bruno Haible <bruno@clisp.org>
2208 Upgrade to Unicode-4.0.
2209 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
2210 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
2211 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
2212 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
2213 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
2214 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
2215 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
2216 Change width of U+E0100..U+E01EF from 1 to 0.
2218 2003-04-25 Bruno Haible <bruno@clisp.org>
2220 * copy-file.c: Include <stddef.h>, for size_t.
2222 2003-04-25 Jim Meyering <jim@meyering.net>
2224 * copy-file.c (copy_file_preserving): Declare buf_size to be
2225 of type size_t, not int.
2227 2003-04-11 Jim Meyering <jim@meyering.net>
2229 Merge changes from Coreutils.
2231 2003-03-22 Jim Meyering <jim@meyering.net>
2233 * strftime.c (widen): Cast alloca return value to proper type.
2235 2003-01-19 Ulrich Drepper <drepper@redhat.com>
2238 * strftime.c (my_strftime): Handle very large width
2239 specifications for numeric values correctly. Improve checks for
2242 2003-01-19 Jim Meyering <jim@meyering.net>
2244 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
2245 (nl_get_alt_digit) [! defined my_strftime]: Define.
2246 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
2247 _nl_get_alt_digit and _nl_get_walt_digit.
2249 * strftime.c (my_strftime): Merge in locale-related changes from libc.
2250 These changes have no effect outside of _LIBC.
2252 2003-04-10 Bruno Haible <bruno@clisp.org>
2254 * findprog.h: New file, from GNU gettext.
2255 * findprog.c: New file, from GNU gettext.
2257 2003-04-05 Jim Meyering <jim@meyering.net>
2259 Merge changes from Coreutils.
2261 * exclude.h (PARAMS): Remove definition and uses.
2262 * exclude.c: Remove uses of `PARAMS'.
2264 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
2265 Add test-cases for DOS filenames. Declare program_name.
2266 (main): Set up program_name. Patch by Rich Dawe.
2268 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2270 Use mntctl's return value to drive the entry-processing loop, since
2271 we can't rely on the value of the vmt_length member in the last
2272 entry. On some systems doing so could result in exhausting
2273 virtual memory. Based in part on a patch from Mike Jetzer.
2275 2003-04-04 Bruno Haible <bruno@clisp.org>
2277 * linebreak.h: New file, from GNU gettext.
2278 * linebreak.c: New file, from GNU gettext with slight modifications.
2279 * lbrkprop.h: New file, from GNU gettext.
2281 2003-04-03 Bruno Haible <bruno@clisp.org>
2283 * utf8-ucs4.h: New file, from GNU gettext.
2284 * utf16-ucs4.h: New file, from GNU gettext.
2285 * ucs4-utf8.h: New file, from GNU gettext.
2286 * ucs4-utf16.h: New file, from GNU gettext.
2288 2003-04-02 Bruno Haible <bruno@clisp.org>
2290 * binary-io.h: New file, from GNU gettext.
2292 2003-04-01 Bruno Haible <bruno@clisp.org>
2294 * pathname.h: New file, from GNU gettext.
2295 * concatpath.c: New file, from GNU gettext.
2297 2003-03-30 Bruno Haible <bruno@clisp.org>
2299 * copy-file.c (copy_file_preserving): Don't set owner if the function
2300 chown() doesn't exist.
2302 2003-03-28 Bruno Haible <bruno@clisp.org>
2304 * copy-file.h: New file, from GNU gettext.
2305 * copy-file.c: New file, from GNU gettext.
2307 2003-03-18 Jim Meyering <jim@meyering.net>
2309 * quote.c (quote_n): Fix typo in comment.
2311 2003-03-14 Jim Meyering <jim@meyering.net>
2313 Merge changes from Coreutils.
2314 * obstack.h (obstack_object_size): Declare temporary, __o,
2315 to be const, in order to avoid warnings.
2316 (obstack_room): Likewise.
2317 (obstack_empty_p): Likewise.
2319 2003-03-13 Paul Eggert <eggert@twinsun.com>
2321 Merge changes from Bison.
2322 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
2323 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
2324 when compiling Bison 1.875's `bitset bset = obstack_alloc
2325 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
2326 * hash.c: Include <stdbool.h> unconditionally.
2328 2003-03-09 Paul Eggert <eggert@twinsun.com>
2330 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
2331 Reported by Bruce Becker; see:
2332 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
2334 2003-03-03 Paul Eggert <eggert@twinsun.com>
2335 Bruno Haible <bruno@clisp.org>
2337 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
2338 Reported by John Hughes, see
2339 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
2341 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
2343 * poll_.h: New file.
2346 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
2348 * mathl.h: New file.
2349 * acosl.c: New file.
2350 * asinl.c: New file.
2351 * atanl.c: New file.
2352 * ceill.c: New file.
2355 * floorl.c: New file.
2356 * frexpl.c: New file.
2357 * ldexpl.c: New file.
2359 * sincosl.c: New file.
2361 * sqrtl.c: New file.
2363 * trigl.c: New file.
2364 * trigl.h: New file.
2366 2003-02-17 Bruno Haible <bruno@clisp.org>
2368 * mkdtemp.h: New file, from GNU gettext.
2369 * mkdtemp.c: New file, from GNU gettext.
2371 2003-01-31 Bruno Haible <bruno@clisp.org>
2373 * rename.c: #undef rename before defining rpl_rename.
2374 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
2376 2003-01-30 Bruno Haible <bruno@clisp.org>
2378 * printf-args.h: New file, from GNU gettext.
2379 * printf-args.c: New file, from GNU gettext.
2380 * printf-parse.h: New file, from GNU gettext.
2381 * printf-parse.c: New file, from GNU gettext.
2382 * vasnprintf.h: New file, from GNU gettext.
2383 * vasnprintf.c: New file, from GNU gettext.
2384 * asnprintf.c: New file, from GNU gettext.
2385 * vasprintf.h: New file, from GNU gettext with modifications.
2386 * vasprintf.c: New file, from GNU gettext.
2387 * asprintf.c: New file, from GNU gettext.
2389 2003-01-29 Bruno Haible <bruno@clisp.org>
2391 * stpncpy.h: New file, from GNU gettext with modifications.
2392 * stpncpy.c: New file, from GNU gettext with modifications.
2394 2003-01-28 Bruno Haible <bruno@clisp.org>
2396 * c-ctype.h: New file, from GNU gettext, with changes suggested by
2398 * c-ctype.c: New file, from GNU gettext, with changes suggested by
2401 2003-01-27 Bruno Haible <bruno@clisp.org>
2403 * xsetenv.h: New file, from GNU gettext.
2404 * xsetenv.c: New file, from GNU gettext.
2406 2003-01-23 Bruno Haible <bruno@clisp.org>
2408 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
2410 2003-01-22 Bruno Haible <bruno@clisp.org>
2412 * exit.h: New file, from GNU gettext.
2414 2003-01-11 Bruno Haible <bruno@clisp.org>
2416 * stpcpy.h (stpcpy): Use ANSI C function declarations.
2417 * strcase.h (strcasecmp, strncasecmp): Likewise.
2419 2003-01-14 Jim Meyering <jim@meyering.net>
2421 * same.c (same_name): Tweak a comment.
2423 2003-01-11 Bruno Haible <bruno@clisp.org>
2425 * same.c (same_name): Reorder tests so as to avoid calling stat()
2426 when a string comparison is sufficient.
2428 2003-01-11 Bruno Haible <bruno@clisp.org>
2430 * readtokens.c (readtoken): Cast character to 'unsigned char', not
2433 2003-01-11 Bruno Haible <bruno@clisp.org>
2435 * hash-pjw.c: Add comment about low quality of this function.
2437 2003-01-12 Paul Eggert <eggert@twinsun.com>
2439 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
2440 to avoid collisions with libcurses and libreadline.
2442 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
2443 * getstr.h, getstr.c: Remove.
2444 * getline.c: Include "getline.h", to check interface.
2445 Move body of old getstr.c here: this defines MIN_CHUNK and
2446 declares getdelim2, which is renamed from getstr.
2447 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
2449 * linebuffer.c (readlinebuffer): Renamed from readline.
2451 * linebuffer.h: Likewise.
2452 (readline): Remove backward-compatibility macro.
2454 2003-01-12 Jim Meyering <jim@meyering.net>
2456 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
2458 2003-01-10 Bruno Haible <bruno@clisp.org>
2460 * alloca_.h: New file.
2461 * getdate.y: Unconditionally include alloca.h.
2462 * makepath.c: Likewise.
2463 * setenv.c: Likewise.
2464 * userspec.c: Likewise.
2466 2003-01-09 Bruno Haible <bruno@clisp.org>
2468 * stdbool.h.in: New file.
2470 2003-01-08 Bruno Haible <bruno@clisp.org>
2472 * safe-read.c: Include specification header first, to ensure its
2474 * full-write.c: Likewise.
2476 2003-01-08 Jim Meyering <jim@meyering.net>
2478 * full-write.c: Undefine and define-away `const' after inclusion
2479 of errno.h, not before. Suggestion from Bruno Haible.
2481 2003-01-07 Jim Meyering <jim@meyering.net>
2483 * full-write.c: Rework so that it may serve to define full_read, too.
2484 * full-read.c: Simply #define FULL_READ and include full-write.c.
2486 2003-01-06 Jim Meyering <jim@meyering.net>
2488 * version-etc.c: Update year in translatable copyright string.
2490 2002-12-25 Bruno Haible <bruno@clisp.org>
2492 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
2493 * xstrtol.h: Likewise.
2494 * xstrtoimax.c: Likewise.
2495 * xstrtoumax.c: Likewise.
2496 * human.h: Likewise.
2498 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
2499 on systems that have <inttypes.h> but not <stdint.h>.
2501 2002-12-31 Paul Eggert <eggert@twinsun.com>
2503 * memcoll.c (memcoll): Fall back on a simple algorithm using
2504 memcmp if strcoll doesn't work.
2506 2002-12-23 Bruno Haible <bruno@clisp.org>
2508 * localcharset.h: New file.
2509 * localcharset.c: Include it.
2510 * unicodeio.c: Likewise.
2512 2002-12-22 Bruno Haible <bruno@clisp.org>
2514 * utime.c (utime_null): No need to call ftruncate if the file was
2517 2002-12-23 Bruno Haible <bruno@clisp.org>
2519 * memcoll.c (STRCOLL): New macro.
2522 2002-12-22 Bruno Haible <bruno@clisp.org>
2524 * getstr.h (getstr): Define, to avoid clash with libcurses.
2525 * linebuffer.h (readline): Define, to avoid clash with libreadline.
2527 2002-12-22 Bruno Haible <bruno@clisp.org>
2529 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
2531 2002-12-23 Bruno Haible <bruno@clisp.org>
2533 * getline.h: Include <stddef.h>, for size_t.
2535 * unicodeio.h: Include <stddef.h>, for size_t.
2536 * unicodeio.c: Don't include <stddef.h>.
2538 2002-12-17 Bruno Haible <bruno@clisp.org>
2540 * canon-host.c (strdup): Remove unused declaration.
2542 * fsusage.c: Include full_read.h.
2543 (get_fs_usage): Use full_read instead of safe_read.
2545 * utime.c (utime_null): Use SAFE_READ_ERROR.
2547 2002-12-11 Bruno Haible <bruno@clisp.org>
2549 * setenv.h: Rewritten to cope with systems that have setenv() but not
2551 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
2554 2002-12-11 Bruno Haible <bruno@clisp.org>
2556 * setenv.c (alloca): Fall back to malloc.
2558 (setenv): Use freea() to free memory allocated with alloca().
2560 2002-11-13 Bruno Haible <bruno@clisp.org>
2562 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
2563 function declarations.
2564 * unsetenv.c (unsetenv): Likewise.
2566 2002-03-04 Bruno Haible <bruno@clisp.org>
2568 Portability to AIX 4.3.3.
2569 * unsetenv.c: New file, extracted from setenv.c.
2570 * setenv.c: Move the unsetenv() function to unsetenv.c.
2572 2001-12-20 Bruno Haible <bruno@clisp.org>
2574 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
2575 use malloc instead. For SunOS 4.
2577 2001-12-11 Bruno Haible <bruno@clisp.org>
2579 * setenv.c: Declare alloca.
2580 (compar_fn_t): New typedef.
2581 (KNOWN_VALUE, STORE_VALUE): Use it.
2583 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
2586 2002-12-10 Paul Eggert <eggert@twinsun.com>
2588 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
2589 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
2590 Choose values that are less likely to collide with system fnmatch
2592 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
2593 defined (e.g., a pure POSIX system).
2594 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
2595 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
2597 2002-12-06 Jim Meyering <jim@meyering.net>
2599 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
2601 Merge in changes from libc's misc/error.c, in preparation
2602 for the merge of gnulib's changes back into libc.
2604 * error.c (_): Define only if not already defined.
2605 Move definition to follow all #include directives.
2606 Include unlocked-io.h only if !_LIBC.
2607 [_LIBC]: Include <libio/libioP.h>.
2608 [USE_IN_LIBIO]: Include <libio/iolibio.h>
2609 (fflush): Tweak definition to use INTUSE.
2612 2002-12-05 Paul Eggert <eggert@twinsun.com>
2614 * alloca.c [defined emacs]: Include "lisp.h".
2615 (xalloc_die) [defined emacs]: New macro.
2616 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
2617 [! defined emacs]: Include <xalloc.h>.
2618 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
2619 (pointer): Typedef to POINTER_TYPE *.
2620 (malloc): Remove decl; we now always use xmalloc.
2621 (alloca): Use old-style definition, since Emacs needs this.
2622 Check for arithmetic overflow when computing combined size.
2624 2002-12-04 Paul Eggert <eggert@twinsun.com>
2626 Do not generate unlocked-io.h automatically, since it's easier to
2627 maintain it by hand.
2629 * unlocked-io.h: New file, from GNU diffutils,
2630 but with proper copyright notice and attribution.
2632 * Makefile.am: Add copyright notice.
2633 (libfetish_a_SOURCES): Add unlocked-io.h.
2634 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
2635 (DISTCLEANFILES, io_functions): Remove macros.
2636 (EXTRA_DIST): Remove gen_uio.
2637 (unlocked-io.h): Remove rule.
2639 2002-12-04 Jim Meyering <jim@meyering.net>
2641 Reflect the fact that stat.c and lstat.c are no longer generated.
2642 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
2643 (DISTCLEANFILES): Likewise.
2644 (EXTRA_DIST): Likewise.
2645 (all_local): Don't depend on stat.c or lstat.c.
2646 (stat.c, lstat.c): Remove rules.
2647 (EXTRA_DIST): Remove xstat.in.
2649 * xstat.in: Remove file. Contents moved into stat.c.
2650 * stat.c: New file. Contents mostly from xstat.in.
2651 * stat.c: Rework so that it may serve to define rpl_lstat, too.
2652 * lstat.c: New file. Simply #define LSTAT and include stat.c.
2654 * safe-read.c: Rework so that it may serve to define safe_write, too.
2655 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
2657 2002-12-03 Jim Meyering <jim@meyering.net>
2659 * safe-read.c, safe-write.c: Change variable names and comments, but
2660 not semantics, to minimize the differences between these two files.
2661 (safe_read): Change comment to mention SAFE_READ_ERROR.
2663 * safe-read.c (IS_EINTR): Define.
2664 (safe_read): Use IS_EINTR in place of in-function cpp directives.
2666 2002-12-02 Bruno Haible <bruno@clisp.org>
2668 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
2669 Define, taken from safe-read.c.
2670 (INT_MAX): Provide fallback.
2671 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
2672 * safe-write.h (SAFE_WRITE_ERROR): Define.
2674 * safe-read.c (EINTR): Remove definition.
2675 (safe_read): Don't use EINTR if it is absent.
2677 2002-12-02 Jim Meyering <jim@meyering.net>
2679 * safe-read.c (EINTR): Define.
2680 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
2681 (INT_MAX): Provide fallback.
2682 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
2684 * safe-read.h (SAFE_READ_ERROR): Define.
2686 2002-12-01 Jim Meyering <jim@meyering.net>
2688 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
2689 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
2691 2002-11-27 Paul Eggert <eggert@twinsun.com>
2693 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2694 hash_rehash): Replace `if (limit <= value) abort ();' with
2695 `if (! (value < limit)) abort ();', for readability.
2697 2002-11-26 <karl@gnu.org>
2699 * strdup.c: copy from libc again, with jim's ok.
2700 * .cppi-disable: re-add strdup.c
2702 2002-11-25 <karl@gnu.org>
2704 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
2705 instead of "strtol.c".
2707 2002-11-25 Jim Meyering <jim@meyering.net>
2709 * mktime.c: Sync from libc, now that it has the latest fix.
2711 2002-11-24 <karl@gnu.org>
2713 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
2714 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
2716 2002-11-24 Jim Meyering <jim@meyering.net>
2718 Update from coreutils:
2720 * mktime.c: Merge in changes from libc.
2722 Avoid a link-time failure on some Linux systems.
2723 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
2724 (__mon_yday): Declare with the STATIC attribute.
2725 (__mktime_internal): Likewise.
2726 Based on a report from Greg Schafer.
2728 2002-11-23 Jim Meyering <jim@meyering.net>
2730 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
2731 Use `unsigned', not `int', as type of index.
2733 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
2735 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
2737 2002-11-22 Paul Eggert <eggert@twinsun.com>
2739 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
2740 hint that one should use `if (! x) abort ();' rather than `assert
2741 (x);', and anyway it's one less thing to worry about configuring.
2742 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2743 hash_rehash, hash_insert): Use abort rather than assert.
2745 2002-11-22 Paul Eggert <eggert@twinsun.com>
2747 * quotearg.h: Allow multiple inclusion by surrounding with
2748 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
2749 so that we can be included first.
2750 (PARAMS): Remove; we now assume C89 or later. All uses removed.
2751 * quotearg.c: Include quotearg.h immediately after config.h.
2752 No need to include stddef.h or sys/types.h any more.
2753 Surround local include files with "", not "<>".
2754 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
2755 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
2756 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
2757 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
2758 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
2759 (ISPRINT): Remove; no longer needed now that we assume C89.
2761 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
2764 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
2765 quotearg_char): Use SIZE_MAX rather than
2766 (size_t) -1 when we are talking about "infinity".
2768 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
2770 2002-11-22 Bruno Haible <bruno@clisp.org>
2772 * safe-read.h: Assume C89. Add comments.
2773 (safe_read): Change return type to size_t.
2774 * safe-read.c (safe_read): Change return type to size_t. Handle byte
2775 counts > SSIZE_MAX correctly.
2776 * safe-write.h: New file.
2777 * safe-write.c: New file.
2778 * full-read.h: New file.
2779 * full-read.c: New file.
2780 * full-write.h: Assume C89. Add comments.
2781 * full-write.c: Include safe-write.h.
2782 (full_write): Rewritten to use safe_write.
2783 Suggested by Jim Meyering and Paul Eggert.
2785 2002-11-21 Bruno Haible <bruno@clisp.org>
2787 Remove case insensitive option matching.
2788 * argmatch.h (argcasematch): Remove declaration.
2789 (ARGCASEMATCH): Remove macro.
2790 (__xargmatch_internal): Remove case_sensitive argument.
2791 (XARGMATCH): Update.
2792 (XARGCASEMATCH): Remove macro.
2793 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
2794 case_sensitive argument.
2795 (argcasematch): Remove function.
2796 (__xargmatch_internal): Remove case_sensitive argument.
2797 (main): Use XARGMATCH instead of XARGCASEMATCH.
2799 * xmalloc.c: Change compile-time error message. Add comment about
2800 required autoconf version.
2802 2002-11-21 Jim Meyering <jim@meyering.net>
2804 * strdup.c (strdup): Tweak comment and initial #if/#include.
2806 Merge in changes from the coreutils.
2808 2002-09-25 Paul Eggert <eggert@twinsun.com>
2809 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
2810 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
2811 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
2812 int. Work more efficiently if X is the same width as uintmax_t.
2813 Do not compare X to -1, to avoid bogus compiler warning.
2814 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
2815 Don't assume that f_frsize and f_bsize are the same type.
2817 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
2820 * makepath.c (make_path): Restore umask *before* creating the final
2822 (make_path): Minor reformatting.
2824 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
2825 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
2827 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
2828 ones. At least on GNU/Linux systems, `auto' means something else.
2831 2002-11-20 Paul Eggert <eggert@twinsun.com>
2833 Merge argmatch cleanups from Bison. Assume C89.
2835 * argmatch.c: Include config.h here, not in argmatch.h.
2836 Include stdlib.h, for EXIT_FAILURE.
2837 Always include <string.h>, since we assume C89.
2838 (EXIT_FAILURE): Remove pre-C89 bug workaround.
2839 * argmatch.h: Do not include <config.h> or <sys/types.h>.
2840 Include <stddef.h> instead, since it's all we need for size_t.
2841 (PARAMS): Remove. All uses removed.
2842 (ARRAY_CARDINALITY): Do not bother to #undef.
2843 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
2844 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2845 Remove unnecessary parentheses.
2846 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2847 Insert necessary parentheses.
2848 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
2849 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
2851 2002-11-19 Bruno Haible <bruno@clisp.org>
2853 * mbswidth.c: Include mbswidth.h right at the beginning.
2854 * mbswidth.h: Include <stddef.h>, for size_t.
2856 * mbswidth.h (PARAMS): Remove macro.
2857 (mbswidth, mbsnwidth): Use ANSI C function declarations.
2858 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
2860 * gcd.h (PARAMS): Remove macro.
2861 (gcd): Use ANSI C function declarations.
2862 * gcd.c (gcd): Likewise.
2864 2002-11-15 Bruno Haible <bruno@clisp.org>
2866 * strcspn.c: Include <stddef.h>.
2867 (strcspn): Use ANSI C function declaration. Change return type to
2869 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
2870 (strpbrk): Use NULL.
2871 * strpbrk.h (PARAMS): Remove macro.
2872 (strpbrk): Use ANSI C function declaration.
2873 * strstr.c: Don't include <sys/types.h>.
2874 * strstr.h (PARAMS): Remove macro.
2875 (strstr): Use ANSI C function declarations.
2877 2002-11-06 Bruno Haible <bruno@clisp.org>
2879 * gcd.h (gcd): Change argument type to 'unsigned long'.
2880 * gcd.c (gcd): Likewise.
2882 2002-11-05 Bruno Haible <bruno@clisp.org>
2884 * gcd.h: New file, from gettext-0.11.5.
2885 * gcd.c: New file, from gettext-0.11.5.
2887 2002-11-05 Bruno Haible <bruno@clisp.org>
2889 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2890 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2891 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2892 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2894 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2895 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2897 * closeout.c: Include gettext.h instead of <libintl.h>.
2898 * human.c: Include gettext.h instead of <libintl.h>.
2899 * quotearg.c: Include gettext.h instead of <libintl.h>.
2900 * rpmatch.c: Include gettext.h instead of <libintl.h>.
2901 * unicodeio.c: Include gettext.h instead of <libintl.h>.
2902 * userspec.c: Include gettext.h instead of <libintl.h>.
2903 * version-etc.c: Include gettext.h instead of <libintl.h>.
2904 * xmalloc.c: Include gettext.h instead of <libintl.h>.
2905 (textdomain): Remove definition.
2906 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
2908 * long-options.c: Remove include of <libintl.h> and definition of _.
2909 * same.c: Remove include of <libintl.h> and definition of _.
2911 2002-11-04 Bruno Haible <bruno@clisp.org>
2913 * stpcpy.h: New file, from GNU gettext-0.11.5.
2914 * strcase.h: New file, from GNU gettext-0.11.5.
2915 * strpbrk.h: New file, from GNU gettext-0.11.5.
2916 * strstr.h: New file, from GNU gettext-0.11.5.
2917 * xgetcwd.h: New file, from GNU gettext-0.11.5.
2919 2002-05-09 Bruno Haible <bruno@clisp.org>
2921 * config.charset: Update for newest glibc. Add canonical names
2922 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
2924 2002-05-09 Bruno Haible <bruno@clisp.org>
2926 * localcharset.c (get_charset_aliases): Add more Windows specific
2929 2002-05-08 Owen Taylor <otaylor@redhat.com>
2931 * config.charset: A few additions for Solaris.
2933 2001-12-05 Bruno Haible <bruno@clisp.org>
2935 * localcharset.c (locale_charset): Don't return an empty string.
2937 2001-10-23 Bruno Haible <haible@clisp.cons.org>
2939 * config.charset: msdos in uk_UA uses CP1125.
2941 2001-08-05 Bruno Haible <haible@clisp.cons.org>
2943 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
2944 * localcharset.c (locale_charset): Declare as extern "C".
2946 2002-02-15 Bruno Haible <bruno@clisp.org>
2948 * config.charset [msdosdjgpp]: For Russian, use CP866.
2950 2002-02-11 Bruno Haible <bruno@clisp.org>
2952 * config.charset: Add support for NetBSD.
2954 2002-09-25 <karl@gnu.org>
2956 * strdup.c: copy from libc/string (via ../config/srclist*).
2957 * getopt*: copy from libc/posix.
2958 * gettext.h: copy from gettext.
2959 * .cppi-disable: add strdup.c, gettext.h.
2961 2002-07-01 Jim Meyering <meyering@lucent.com>
2963 * c-stack.c: Include sys/time.h.
2964 From Volker Borchert.
2966 2002-06-11 Paul Eggert <eggert@twinsun.com>
2968 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
2969 New macro. Use it uniformly instead of
2970 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
2971 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
2972 reported by Vin Shelton.
2974 2002-06-22 Jim Meyering <meyering@lucent.com>
2976 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
2977 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
2979 2002-06-22 Paul Eggert <eggert@twinsun.com>
2981 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
2982 Do not assume SA_SIGINFO behavior.
2983 Bug reported by Jim Meyering on NetBSD 1.5.2.
2985 2002-06-22 Jim Meyering <meyering@lucent.com>
2987 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
2989 * exitfail.c, exitfail.h: Likewise.
2990 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
2992 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
2994 (EXTRA_DIST): Add fnmatch_loop.c.
2995 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
2997 * fnmatch_loop.c: New file, from diffutils-2.8.2.
2998 * fnmatch.c: Update from diffutils-2.8.2.
2999 * fnmatch_.h: New file. From diffutils-2.8.2.
3000 * fnmatch.h: Remove file.
3002 2002-06-18 Paul Eggert <eggert@twinsun.com>
3004 * file-type.h: Report an error if neither S_ISREG nor
3005 S_IFREG is defined, instead of using a test specific to glibc
3006 2.2. This should be safe, since POSIX requires S_ISREG and
3007 Unix Version 7 had S_IFREG. We don't need to check for
3008 <sys/types.h> since we don't use any symbols that it defines.
3010 2002-06-15 Jim Meyering <meyering@lucent.com>
3012 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
3013 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
3014 have been included before this file.
3016 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
3018 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
3019 so that each temporary file name is unique and valid in the first
3020 8 characters, for operation under DOS.
3022 2002-06-15 Jim Meyering <meyering@lucent.com>
3024 Work even with DJGPP 2.03, which lacks support for symlinks.
3026 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
3028 * lchown.c (S_ISLNK): Likewise.
3030 2002-06-14 Jim Meyering <meyering@lucent.com>
3032 * file-type.h: Use the version from diffutils-2.8.2.
3033 * file-type.c: Likewise.
3035 2002-05-27 Jim Meyering <meyering@lucent.com>
3037 Fix a problem seen only on nonconforming systems whereby ls.c's
3038 use of localtime, and then of gettimeofday would cause trouble:
3039 the localtime call used to initialize rpl_gettimeofday's save
3040 mechanism would clobber ls's current local time information so
3041 that in any long listing the first file would always be listed
3042 with date 1970-01-01. Analysis by Volker Borchert.
3044 * gettimeofday.c (localtime): Undefine.
3045 (rpl_localtime): New function.
3047 2002-05-22 Jim Meyering <meyering@lucent.com>
3049 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
3050 * file-type.h: New file.
3051 * file-type.c (file_type): New file/function. Extracted from diffutils.
3053 2002-04-29 Paul Eggert <eggert@twinsun.com>
3055 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
3057 2002-04-28 Paul Eggert <eggert@twinsun.com>
3059 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
3060 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
3061 of 127, since 64 is the largest conceivable number for ancient
3063 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
3065 2002-04-28 Jim Meyering <meyering@lucent.com>
3067 * sig2str.c (WTERMSIG): Remove definition (unused).
3069 2002-04-28 Paul Eggert <eggert@twinsun.com>
3071 * sig2str.h, sig2str.c: New files.
3072 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
3074 2002-04-24 Jim Meyering <meyering@lucent.com>
3076 * gettext.h: New file, from Gettext.
3077 * Makefile.am (INCLUDES): Remove -I../intl.
3078 (libfetish_a_SOURCES): Add gettext.h.
3080 2002-04-16 Jim Meyering <meyering@lucent.com>
3082 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
3083 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
3084 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
3086 2002-04-12 Jim Meyering <meyering@lucent.com>
3088 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
3090 2002-03-10 Jim Meyering <meyering@lucent.com>
3092 * makepath.c (make_path): Remove a comma from a diagnostic.
3093 Suggestion from Santiago Vila.
3095 2002-03-08 Jim Meyering <meyering@lucent.com>
3097 * rename.c: Mention that this wrapper is needed also on
3098 mips-dec-ultrix4.4 systems.
3100 2002-03-02 Jim Meyering <meyering@lucent.com>
3102 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
3103 not HAVE_CLOCK_SETTIME.
3105 2002-02-27 Paul Eggert <eggert@twinsun.com>
3107 * nanosleep.h: Rename to....
3108 * timespec.h: New name for nanosleep.h. All uses changed.
3110 * gettime.c: New file.
3111 * settime.c: New file.
3114 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
3115 timespec.h. Remove nanosleep.h.
3117 2002-02-25 Paul Eggert <eggert@twinsun.com>
3119 * acl.c, acl.h: New files.
3120 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
3122 2002-02-24 Jim Meyering <meyering@lucent.com>
3124 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
3125 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
3126 cause trouble. Reported by Nelson Beebe.
3128 2002-02-23 Paul Eggert <eggert@twinsun.com>
3130 * path-concat.c (xpath_concat): Reorder code to pacify
3131 compilers that don't know that xalloc_die never returns.
3133 2002-02-20 Jim Meyering <meyering@lucent.com>
3135 * getdate.c: Regenerate using bison-1.33.
3137 2002-02-15 Paul Eggert <eggert@twinsun.com>
3139 * posixver.c, posixver.h: New files.
3140 * Makefile.am (libfetish_a_SOURCES): Add them.
3142 2002-02-02 Paul Eggert <eggert@twinsun.com>
3143 Bruno Haible <bruno@clisp.org>
3145 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
3146 (fwrite_success_callback): New declaration.
3147 * unicodeio.c (unicode_to_mb): New function, extracted from
3148 print_unicode_char. Call failure callback instead of error.
3149 (fwrite_success_callback): New function.
3150 (exit_failure_callback): New function.
3151 (fallback_failure_callback): New function.
3152 (print_unicode_char): Call unicode_to_mb.
3154 2002-01-26 Jim Meyering <meyering@lucent.com>
3156 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
3158 2002-01-22 Jim Meyering <meyering@lucent.com>
3160 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
3161 Otherwise, some versions of automake would omit the rule that makes
3162 Makefile from Makefile.in.
3164 2001-01-21 Paul Eggert <eggert@twinsun.com>
3166 * xmemcoll.h, xmemcoll.c: New files.
3167 * Makefile.am (libfetish_a_SOURCES): Add them.
3168 * memcoll.c: Include errno.h, and declare errno if not defined.
3169 (memcoll): Set errno to zero if there is no error.
3171 * quotearg.c (quotearg_buffer_restyled):
3172 Fix bug with quoting buffers containing NUL when backslashing escapes.
3173 This bug was exposed by the other changes in this patch.
3174 (quotearg_n_options): New arg ARGSIZE.
3175 All callers changed.
3176 (quoting_options_from_style): New function.
3177 (quotearg_n_style): Use it.
3178 (quotearg_n_style_mem): New function.
3180 * quotearg.h (quotearg_n_style_mem): New function.
3182 2002-01-16 Jim Meyering <meyering@lucent.com>
3184 * getdate.y: Add three semicolons, each just before a closing brace.
3185 Bison (as of version 1.31) no longer papers over that mistake.
3187 2002-02-14 Paul Eggert <eggert@twinsun.com>
3189 * backupfile.c (ISDIGIT): Comment fix.
3190 * getdate.y (ISDIGIT): Likewise.
3191 * posixtm.c (ISDIGIT, year): Likewise.
3192 * strverscmp.c (ISDIGIT): Likewise.
3193 * userspec.c (ISDIGIT): Likewise.
3195 2002-01-05 Jim Meyering <meyering@lucent.com>
3197 * version-etc.c (version_etc_copyright): Update copyright year.
3199 2001-01-19 Paul Eggert <eggert@twinsun.com>
3201 * closeout.c (close_stdout_status): If ferror (stdout), do
3202 not silently exit merely because the output buffer happens to
3203 have nothing pending.
3205 2001-12-18 Paul Eggert <eggert@twinsun.com>
3207 See the big note in ../ChangeLog.
3208 * human.c (suffixes): Prefer K to k for 1024.
3209 (generate_suffix_backwards): New function.
3210 (human_readable_inexact): Use it.
3211 * xstrtol.c (__xstrtol): If there is no number but there
3212 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
3213 Accept 'K' as well as 'k'.
3215 2001-12-15 Jim Meyering <meyering@lucent.com>
3217 * regex.h (__restrict_arr): Update from libc.
3219 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
3220 as `remote' if the name starts with `//'. Suggested by Michael Stone.
3223 2001-12-10 Jim Meyering <meyering@lucent.com>
3225 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
3226 Instead, include "xalloc.h".
3227 (initbuffer): Don't cast xmalloc return value to char*.
3228 (readline): Reword comment.
3229 Don't cast xrealloc return value to char*
3232 2001-12-09 Jim Meyering <meyering@lucent.com>
3234 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
3235 `signed and unsigned type in conditional expression'.
3236 * posixtm.c (posix_time_parse): Likewise.
3238 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
3240 * readtokens.c (readtoken): Declare an index to be of type unsigned
3241 to avoid a pedantic warning.
3243 * getstr.c: Don't include assert.h.
3244 (getstr): Remove warning-evoking assertions.
3245 Return -1 if offset parameter is out of bounds.
3246 Change the type of a local from int to size_t.
3248 * strftime.c (my_strftime_localtime_r): Include this function
3249 definition in the `#if ! HAVE_TM_GMTOFF' block.
3251 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
3252 Include xalloc.h instead.
3254 2001-12-02 Jim Meyering <meyering@lucent.com>
3256 * tempname.c: Don't declare getenv, thus reverting the change of
3257 2001-11-18. It's no longer necessary, now that stdlib.h is always
3260 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
3261 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
3263 2001-11-30 Akim Demaille <akim@epita.fr>
3265 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
3266 before being defined.
3268 2001-11-27 Paul Eggert <eggert@twinsun.com>
3270 * quotearg.h (quotearg_n, quotearg_n_style):
3271 First arg is int, not unsigned.
3272 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
3273 (SIZE_MAX, UINT_MAX): New macros.
3274 (quotearg_n_options): Abort if N is negative.
3275 Avoid overflow check on hosts where size_t is 64 bits and int
3276 is 32 bits, as overflow is impossible there.
3277 Fix off-by-one typo that caused unnecessary reallocation.
3279 2001-11-27 Jim Meyering <meyering@lucent.com>
3281 * tempname.c: Merge with version from libc.
3282 * regex.c: Likewise.
3284 * tempname.c: Include stdlib.h unconditionally. On some old systems
3285 for which STDC_HEADERS is 0, it was not included, resulting in a
3286 warning about an integer-to-pointer conversion problem with getenv.
3287 Reported by Volker Borchert.
3289 2001-11-26 Jim Meyering <meyering@lucent.com>
3291 * gtod.h: Remove file.
3292 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
3293 * gettimeofday.c: Don't include gtod.h.
3294 (GTOD_init): Remove function.
3295 (rpl_gettimeofday): Do its job here instead, rather than aborting.
3296 Suggestion from Volker Borchert.
3298 2001-11-23 Jim Meyering <meyering@lucent.com>
3300 * hash.h (struct hash_table): Don't define here. Merely declare it.
3301 * hash.c (struct hash_table): Define it here instead.
3303 2001-11-22 Jim Meyering <meyering@lucent.com>
3305 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
3307 2001-11-18 Paul Eggert <eggert@twinsun.com>
3309 * tempname.c (TMP_MAX): Remove; no longer needed.
3310 (TEMPORARIES): New macro.
3311 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
3312 removes an artificial limitation (e.g. HP-UX 10.20, where
3315 2001-11-18 Jim Meyering <meyering@lucent.com>
3317 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
3320 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
3321 files will be created before anything else.
3323 2001-11-17 Jim Meyering <meyering@lucent.com>
3325 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
3326 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
3327 rather than group writable. Patch by Juan F. Codagnone.
3329 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
3330 Instead, include "xalloc.h".
3332 * mountlist.c: Include unlocked-io.h after all system headers.
3333 Remove explicit declarations of xmalloc, xrealloc,
3334 and xstrdup. Instead, include "xalloc.h".
3336 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
3337 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
3338 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
3340 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
3341 Reported by Padraig Brady.
3343 * mkstemp.c: #undef mkstemp.
3345 (rpl_mkstemp): Rename from mkstemp.
3348 2001-11-16 Jim Meyering <meyering@lucent.com>
3350 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
3351 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
3352 determine the amount of total physical memory, use pstat_getstatic.
3353 HPUX-11 doesn't define _SC_PHYS_PAGES.
3354 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
3355 If sysconf couldn't be used to determine the amount of available
3356 physical memory, use both pstat_getstatic and pstat_getdynamic.
3357 Based on a patch from Bob Proulx.
3359 2001-11-05 Jim Meyering <meyering@lucent.com>
3361 * xstat.in (slash_aware_lstat): Correct a misleading comment.
3363 2001-11-03 Jim Meyering <meyering@lucent.com>
3365 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
3366 in argmatch_to_argument call.
3368 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
3371 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
3372 e.g., a fault due to an attempt to free a NULL pointer.
3374 2001-11-01 Jim Meyering <meyering@lucent.com>
3376 * dirfd.c, dirfd.h: New files.
3377 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
3379 * hash.c (hash_print) [TESTING]: Clean up.
3381 2001-10-22 Paul Eggert <eggert@twinsun.com>
3383 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
3384 to avoid a warning if -Wall.
3386 2001-10-21 Paul Eggert <eggert@twinsun.com>
3388 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
3390 2001-10-21 Jim Meyering <meyering@lucent.com>
3392 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
3393 this code would end up calling gettext even in packages built
3395 * getopt.c (_): Likewise.
3396 * regex.c (_): Likewise.
3398 2001-10-20 Paul Eggert <eggert@twinsun.com>
3400 * error.c (strerror_r): Do not declare unless !_LIBC.
3401 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
3402 Use strerror_r that is only a macro, even if it is not a function.
3403 (strerror): Check for HAVE_DECL_STRERROR before declaring.
3404 (private_strerror): Use prototypes, not old-style function definition.
3405 (print_errno_message): New function.
3406 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
3408 (error_tail, error, error_at_line): Use it.
3410 2001-10-11 Jim Meyering <meyering@lucent.com>
3412 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
3413 and quote_n (1, ... to avoid clobbering a buffer.
3415 2001-10-05 Jim Meyering <meyering@lucent.com>
3417 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
3418 * hash-pjw.c: New file (factored out of fileutils' remove.c).
3419 * hash-pjw.h: New file.
3421 2001-09-30 Jim Meyering <meyering@lucent.com>
3423 * mountlist.c [MOUNTED_GETFSSTAT]:
3424 Include <sys/ucred.h>, for Apple Darwin.
3425 Include sys/mount.h and sys/fs_types.h only if available.
3427 (read_filesystem_list): Use FS_TYPE.
3429 2001-09-29 Paul Eggert <eggert@twinsun.com>
3431 * exclude.c (excluded_filename): 0 -> false, since it's
3434 2001-09-28 Paul Eggert <eggert@twinsun.com>
3436 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
3437 #defines strtoimax. Also treat the other strto* functions
3440 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
3441 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
3442 (strtoimax, strtoumax): Do not declare if already defined as a macro.
3444 2001-09-26 Jim Meyering <meyering@lucent.com>
3446 Most macros in unlocked-io.h had the wrong number of arguments.
3447 * gen-uio: New script.
3448 (USE_UNLOCKED_IO): Define to 1 if not already defined.
3449 * unlocked-io.hin: Remove file.
3450 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
3451 rather than trying to embed it here.
3452 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
3453 Reported by Padraig Brady.
3455 2001-09-25 Volker Borchert <bt@teknon.de>
3457 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
3459 2001-09-23 Jim Meyering <meyering@lucent.com>
3461 * mountlist.c: Remove useless parentheses in #if directives.
3462 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
3463 the deprecated MOUNTED symbol is no longer defined in mntent.h.
3465 2001-09-22 Jim Meyering <meyering@lucent.com>
3467 * localcharset.c: Update from latest gettext.
3468 * config.charset: Likewise.
3470 2001-09-20 Jim Meyering <meyering@lucent.com>
3472 * xstrtol.c (strtoimax): Guard declaration with
3473 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
3474 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
3475 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
3476 (strtoumax): Likewise, for completeness (it wasn't necessary).
3478 2001-09-06 Paul Eggert <eggert@twinsun.com>
3480 * strtoimax.c (HAVE_LONG_LONG):
3481 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
3482 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
3483 to work around bug in IBM C compiler.
3485 2001-09-16 Jim Meyering <meyering@lucent.com>
3487 * mkdir.c: New file.
3489 2001-09-04 Paul Eggert <eggert@twinsun.com>
3491 * xgetcwd.c: Revert some of the previous change; intead,
3492 fix the HAVE_GETCWD_NULL code to behave more like the
3493 !HAVE_GETCWD_NULL code used to.
3496 (xgetcwd): Do not return NULL when memory is exhausted; instead,
3499 2001-09-04 Paul Eggert <eggert@twinsun.com>
3501 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
3502 Use ssize_t, not int, to store result of readlink.
3503 Check for ssize_t overflow as well as size_t overflow,
3504 as POSIX says the result of readlink is implementation-defined
3505 when ssize_t overflows.
3506 Remove unnecessary cast to char*.
3507 Use free+malloc instead of realloc, as the storage doesn't need
3508 to be preserved and it's clearer and can be more efficient that way.
3509 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
3510 * xreadlink.h (xreadlink): Update prototype.
3512 2001-09-03 Paul Eggert <eggert@twinsun.com>
3514 * exclude.c (fnmatch_no_wildcards): Fix confusion between
3515 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
3516 spotted by Jim Meyering.
3518 2001-09-03 Jim Meyering <meyering@lucent.com>
3520 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
3522 2001-09-03 Paul Eggert <eggert@twinsun.com>
3524 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
3525 like the HAVE_GETCWD_NULL code.
3526 Include pathmax.h if not HAVE_GETCWD.
3527 Do not include xalloc.h.
3528 (INITIAL_BUFFER_SIZE): New symbol.
3529 Do not use xmalloc / xrealloc, since the caller is responsible for
3530 handling errors. Preserve errno around `free' during failure.
3531 Do not overrun buffer when using getwd.
3533 2001-09-03 Paul Eggert <eggert@twinsun.com>
3535 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
3536 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
3538 2001-09-02 Jim Meyering <meyering@lucent.com>
3540 * error.c: Update from GNU libc.
3542 2001-09-01 Jim Meyering <meyering@lucent.com>
3544 * xreadlink.c: New file.
3545 * xreadlink.h: New file.
3546 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
3548 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
3549 doesn't conflict with sparc Solaris 7's definition in
3550 /usr/include/sys/int_types.h.
3552 * exclude.c: Use `""', not `<>' to #include non-system header files.
3553 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
3554 and strncasecmp as r-values. Unixware didn't have declarations.
3556 2001-08-31 Jim Meyering <meyering@lucent.com>
3558 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
3559 Use an initial, malloc'd, buffer of length 128 rather than
3560 a statically allocated one of length 1024.
3562 2001-08-30 Paul Eggert <eggert@twinsun.com>
3564 * xgetcwd.c: Don't include pathmax.h.
3565 Include stdlib.h and unistd.h if available.
3567 (xmalloc, xstrdup, free): Remove decls.
3568 (xgetcwd): Don't assume sizes fit in unsigned.
3569 Check for overflow when computing sizes.
3570 Simplify reallocation code.
3572 2001-08-28 Paul Eggert <eggert@twinsun.com>
3574 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
3576 * strtoimax.c: Renamed from strtoxmax.c, removing the
3579 Also, make the following further changes to make this file's
3580 configuration more similar to that of strtol.c:
3581 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
3582 (strtoumax, uintmax_t, strtoull, strtol): Remove.
3583 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
3584 (strtoimax): Renamed from strtoumax. All uses of unsigned values
3585 changed to signed values.
3587 And make the following changes as well:
3588 Fix copyright notice, as 1999 was missing.
3589 (verify): New macro.
3590 (strtoimax): Check sizes at compile-time, not run-time.
3591 Prefer strtol to strtoll if both work.
3592 (main): Remove; it was not that useful and was a pain to maintain.
3594 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
3596 2001-08-30 Paul Eggert <eggert@twinsun.com>
3598 * savedir.c (savedir): Remove size parameter, as POSIX says that
3599 a directory's st_size can have an arbitrary value, so the old
3600 usage could waste an arbitrary amount of memory. All uses
3602 * savedir.h: Update prototype.
3604 2001-08-30 Paul Eggert <eggert@twinsun.com>
3606 * xstrtol.c (strtoimax): New decl.
3608 2001-08-28 Paul Eggert <eggert@twinsun.com>
3610 * xstrtol.h: Add copyright notice.
3611 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
3612 LONGINT_INVALID_SUFFIX_CHAR.
3614 2001-08-30 Paul Eggert <eggert@twinsun.com>
3616 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
3619 2001-08-30 Paul Eggert <eggert@twinsun.com>
3621 * hash.c: Remove '2001' from copyright notice.
3623 2001-08-30 Paul Eggert <eggert@twinsun.com>
3625 * full-write.h: New file.
3626 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
3627 * full-write.c: Correct credits, as cccp.c no longer
3628 exists and anyway it was so heavily changed from the old cccp
3629 code as to be unrecognizable. Include full-write.h.
3630 (full_write) Return size_t, with short writes meaning failure.
3631 All callers changed. This fixes a bug with large buffers
3633 * utime.c: Include full-write.h.
3635 2001-08-30 Paul Eggert <eggert@twinsun.com>
3637 Merge 'exclude' changes from tar 1.13.22.
3638 This fixes one or two unlikely storage allocation overflow bugs,
3639 but doesn't change user-visible behavior otherwise.
3641 2001-08-30 Paul Eggert <eggert@twinsun.com>
3643 * exclude.c (bool): Declare, perhaps by including stdbool.h.
3644 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
3645 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
3646 Include if available.
3647 (<xalloc.h>): Include
3648 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
3649 (verify): New macro. Use it to verify that EXCLUDE macros do not
3650 collide with FNM macros.
3651 (struct patopts): New struct.
3652 (struct exclude): Use it, as exclude patterns now come with options.
3653 (new_exclude): Support above changes.
3654 (new_exclude, add_exclude_file):
3655 Initial size must now be a power of two to simplify overflow checking.
3656 (free_exclude, fnmatch_no_wildcards): New function.
3657 (excluded_filename): No longer requires options arg, as the options
3658 are determined by add_exclude. Now returns bool, not int.
3659 (excluded_filename, add_exclude):
3660 Add support for the fancy new exclusion options.
3661 (add_exclude, add_exclude_file): Now takes int options arg.
3662 Check for arithmetic overflow when computing sizes.
3663 (add_exclude_file): xrealloc might modify errno, so don't
3664 realloc until after errno might be used.
3666 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
3668 (free_exclude): New decl.
3669 (add_exclude, add_exclude_file): Now takes int options arg.
3670 (excluded_filename): No longer requires options arg, as the options
3671 are determined by add_exclude. Now returns bool, not int.
3673 2001-08-30 Paul Eggert <eggert@twinsun.com>
3675 * alloca.c (alloca): Arg is of type size_t, not unsigned.
3677 2001-08-27 Jim Meyering <meyering@lucent.com>
3679 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
3681 * version-etc.c (N_): Remove definition.
3682 Revert most of last change.
3683 Instead, simply don't mark the `Copyright...' string for translation.
3684 Based on advice from Paul Eggert.
3686 * strtoxmax.c: Tweak comment.
3688 2001-08-26 Jim Meyering <meyering@lucent.com>
3690 * version-etc.c (version_etc_copyright_fmt): Replace literal year
3691 of copyright with `%s' so translators don't get an untranslated
3693 (COPYRIGHT_YEAR): Define.
3694 (version_etc): Use fprintf rather than fputs.
3695 Suggestion from Ulrich Drepper.
3697 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
3699 * strtoll.c: New file, from GNU libc.
3700 * xstrtoimax.c: New file.
3702 * xstrtol.h: Add xstrtoimax.
3703 * strtoumax.c: New file. Simply include "strtoumax.c".
3704 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
3706 * strtoumax.c: Factor to work both for unsigned and signed types, ...
3707 * strtoxmax.c: ... then renamed to this.
3709 2001-08-13 Paul Eggert <eggert@twinsun.com>
3711 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
3712 Port to Solaris 8, where 'sed' requires a space after the 'r'
3713 command, and where sh dislikes "$/". Clean up the spacing a bit.
3714 Redirect output to $tmp just once.
3716 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
3718 * addext.c (<errno.h>): Include.
3719 (errno): Declare if not defined.
3720 (addext): Work correctly when pathconf returns -1 and leaves
3721 errno alone because there is no limit. Also, work even if
3722 pathconf returns a value greater than SIZE_MAX.
3724 2001-08-12 Jim Meyering <meyering@lucent.com>
3726 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
3727 Simply `return getcwd (NULL, 0);'.
3728 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
3729 Use 1300 as initial value for length, not PATH_MAX.
3731 * pathmax.h: Clean up cpp syntax.
3733 2001-08-12 Jim Meyering <meyering@lucent.com>
3735 * gettimeofday.c: New file.
3737 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
3739 2001-08-04 Jim Meyering <meyering@lucent.com>
3741 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
3742 to get in sync with glibc.
3744 2001-08-03 Paul Eggert <eggert@twinsun.com>
3746 The following changes are from gettext 0.10.39 as maintained by
3749 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
3750 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
3751 with inverted sense. All uses changed.
3753 * mbswidth.c: Don't include <limits.h>.
3754 Include <stdlib.h> and <string.h> unconditionally.
3755 (iswcntrl, mbsinit, ISCNTRL): New macros.
3756 (mbsnwidth): Use K&R style function declarations.
3757 Don't bother checking for MB_LEN_MAX == 1, since the compiler
3758 can optimize it when MB_CUR_MAX == 1.
3759 The width of control characters is zero, not 1.
3761 2001-07-15 Jim Meyering <meyering@lucent.com>
3763 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
3764 (BUILT_SOURCES): Add unlocked-io.h.
3765 (io_functions): Define.
3766 (unlocked-io.h): New rule.
3767 (DISTCLEANFILES): Add unlocked-io.h.
3768 (all-local): Depend on unlocked-io.h, to ensure it is created.
3770 * unlocked-io.hin: New file
3772 * regex.c: Update from glibc.
3774 2001-07-05 Jim Meyering <meyering@lucent.com>
3776 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
3778 (libfetish_a_SOURCES): Put all .h files here instead.
3779 Remove a thus-exposed (better checks in automake) duplicate and
3780 two unnecessary .h files.
3782 2001-06-11 Jim Meyering <meyering@lucent.com>
3784 * regex.c: Update from GNU libc.
3786 2001-05-27 Jim Meyering <meyering@lucent.com>
3788 * readutmp.h (UT_TYPE): Define.
3790 2001-05-24 Jim Meyering <meyering@lucent.com>
3792 * argmatch.c: Include "quote.h".
3793 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
3794 quote function. Reported by Göran Uddeborg.
3796 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
3798 * dirname.c (dir_name): Compute append_dot using path, not newpath
3799 which is not yet declared.
3801 2001-05-11 Paul Eggert <eggert@twinsun.com>
3803 * Makefile.am (libfetish_a_SOURCES):
3804 Add strftime.c, since we now compile it on all hosts.
3806 * strftime.c (my_strftime):
3807 Define to nstrftime if emacs, but only if my_strftime is not defined.
3808 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
3809 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
3810 Add one more extra argument: a nanoseconds value.
3813 (my_strftime function): Add %N format.
3814 (emacs_strftimeu): Renamed from emacs_strftime,
3815 with extra ut argument.
3817 2001-05-11 Paul Eggert <eggert@twinsun.com>
3819 dirname code cleanup. base_name now behaves more compatibly
3820 with POSIX basename when given file names that have trailing
3821 slashes, and similarly for dir_name. Add new primitives
3822 base_len and dir_len. Put the directory-name-related decls
3825 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
3826 * backupfile.c (base_name): Likewise.
3827 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
3828 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
3829 * makepath.c (strip_trailing_slashes): Likewise.
3830 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
3832 * rename.c (strip_trailing_slashes): Likewise.
3833 * same.c (base_name): Likewise.
3834 * stripslash.c (ISSLASH): Likewise.
3836 * addext.c: Include <dirname.h> after size_t is defined.
3837 * backupfile.c: Likewise.
3839 * addext.c (addext): Use base_len to trim redundant
3840 trailing slashes instead of doing it ourselves.
3841 But do not trim the last slash if it is not redundant.
3843 * backupfile.c (find_backup_file_name,
3844 max_backup_version): Use base_len instead of rolling it ourselves.
3845 Handle the case of "" and (on DOS) "C:" correctly.
3847 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
3848 Include <string.h>, <dirname.h>.
3849 (base_name): Allow file names ending in slashes, other than names
3850 that are all slashes. In this case, return the basename followed
3851 by the slashes. This is more general, and can be used in places
3852 where the original base_name purposely had an assertion failure.
3853 (base_len): New function.
3855 * dirname.c: Include <string.h> instead of <stdlib.h>.
3856 Do not include <assert.h>; no longer needed.
3858 (memrchr): Remove decl.
3859 (dir_name_r): Remove.
3860 (dir_len): Renamed from dirlen. All callers changed.
3861 Rewrite in terms of base_name, for simplicity and consistency.
3862 (dir_name): Never return NULL. All callers changed.
3863 Do not include <stdlib.h> in test program; no longer needed.
3864 return 0; is fine for test program.
3866 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
3868 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
3870 * path-concat.c (path_concat): Use base_len to compute
3871 base length, not strlen; this means we cannot rely on memcpy
3874 * same.c (STREQ): Remove.
3875 (same_name): Handle the case where the basename ends in trailing '/'.
3877 * stripslash.c (strip_trailing_slashes): Return nonzero if
3878 a slash was stripped. Do not strip the last slash after a
3881 2001-04-08 Jim Meyering <meyering@lucent.com>
3883 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
3884 recomputed; that's necessary when the offset spans a DST transition.
3885 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
3887 2001-04-02 Jim Meyering <meyering@lucent.com>
3889 * regex.h, regex.c: Update from GNU libc.
3891 2001-03-19 Paul Eggert <eggert@twinsun.com>
3893 * version-etc.c (version_etc_copyright): Update to 2001.
3895 2001-03-16 Paul Eggert <eggert@twinsun.com>
3897 * tempname.c (uint64_t): Define to uintmax_t if
3898 not defined, and if UINT64_MAX is not defined.
3899 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
3900 Reported by John David Anglin.
3902 2001-03-10 Bruno Haible <haible@clisp.cons.org>
3904 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
3905 alias if codeset is empty.
3906 * config.charset (BeOS): Use wildcard syntax.
3908 2001-03-13 Jim Meyering <meyering@lucent.com>
3910 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
3911 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
3914 2001-03-06 Bruno Haible <haible@clisp.cons.org>
3916 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
3918 * unicodeio.c (print_unicode_char): Simplify accordingly.
3920 2001-03-06 Bruno Haible <haible@clisp.cons.org>
3922 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
3923 support for DOS/DJGPP.
3925 2001-02-28 Paul Eggert <eggert@twinsun.com>
3927 * Makefile.am (libfetish_a_SOURCES):
3928 Add dup-safer.c, fopen-safer.c.
3929 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
3931 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
3933 2001-02-25 Paul Eggert <eggert@twinsun.com>
3935 The mkstemp replacement is taken from glibc 2.2.2, with some
3936 portability fixes for use outside glibc, as follows:
3938 * tempname.c (struct_stat64): New macro.
3939 (direxists, __gen_tempname): Use it.
3940 This avoids a portability problem with Solaris 8.
3942 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
3943 (<stddef.h>, <stdint.h>, <string.h>):
3944 Include only if STDC_HEADERS || _LIBC.
3945 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
3946 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
3947 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
3948 (__set_errno): Define this macro if <errno.h> doesn't.
3949 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
3950 Define these macros if <stdio.h> doesn't.
3951 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
3952 Define these macros if <sys/stat.h>
3953 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
3954 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
3955 __xstat64): Define if not _LIBC.
3956 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
3957 (__gen_tempname): Invoke gettimeofday only if
3958 HAVE_GETTIMEOFDAY || _LIBC;
3959 otherwise, fall back on plain "time".
3960 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
3962 * mkstemp.c (__GT_FILE): Define to zero if not defined.
3964 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
3966 2001-02-17 Jim Meyering <meyering@lucent.com>
3968 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
3969 around included file name.
3971 * strnlen.c (__strnlen): Merge in a change from GNU libc.
3973 * strftime.c: Update from GNU libc (the only changes were to comments).
3975 2001-02-13 Bruno Haible <haible@clisp.cons.org>
3977 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
3979 2001-02-17 Paul Eggert <eggert@twinsun.com>
3981 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
3982 Remove workaround macros for hosts that have mbrtowc but not
3983 mbstate_t, as we now insist on proper declarations for both
3984 before using mbrtowc.
3986 2001-02-17 Jim Meyering <meyering@lucent.com>
3988 * regex.c: Update from libc.
3990 2001-02-16 Paul Eggert <eggert@twinsun.com>
3992 * alloca.c (malloc): Undef before defining, since stdlib.h
3993 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
3994 Reported by Mark Hounschell via Paul Eggert.
3996 2001-01-30 Bruno Haible <haible@clisp.cons.org>
3998 * config.charset: Update for FreeBSD 4.2.
4000 2001-01-26 Jim Meyering <meyering@lucent.com>
4002 * quotearg.c: Include stddef.h.
4003 * quote.c: Include stddef.h.
4004 Reported by Axel Kittenberger.
4006 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
4007 line in double quotes so that it evokes a better diagnostic.
4008 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
4009 Reported by Axel Kittenberger.
4011 2001-01-15 Bruno Haible <haible@clisp.cons.org>
4013 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
4014 to avoid a warning. Add back 'const' to inptr.
4016 2001-01-16 Jim Meyering <meyering@lucent.com>
4018 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
4021 2001-01-14 Jim Meyering <meyering@lucent.com>
4023 * rename.c: New file. From Volker Borchert.
4024 Include stdlib.h, string.h or strings.h, and xalloc.h.
4025 Use strip_trailing_slashes rather than open-coding it.
4027 2001-01-03 Paul Eggert <eggert@twinsun.com>
4029 * strftime.c: Sync with glibc time/strftime.c 1.81.
4031 2001-01-03 Jim Meyering <meyering@lucent.com>
4033 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
4034 local `inptr' to avoid warning with some system declarations of iconv.
4036 2000-12-29 Paul Eggert <eggert@twinsun.com>
4038 * modechange.c: Do not assume that mode_t uses the
4039 traditional octal encoding. E.g. "chmod 1 FOO" should set
4040 the other-execute bit of FOO even if S_IXOTH != 1.
4042 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
4043 WOTH, XOTH, ALLM): New macros.
4044 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
4045 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
4047 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
4048 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
4050 No need to use uintmax_t; unsigned long is long enough.
4051 Don't bother to get suffix since we don't use it.
4053 2000-12-24 Jim Meyering <meyering@lucent.com>
4055 * hash.c (is_prime): Return explicit boolean values.
4056 (hash_get_first): Return NULL to appease Irix5.6's 89.
4057 Reported by Nelson Beebe.
4059 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4061 * localcharset.c (locale_charset): Add support for Win32.
4063 2000-12-18 Paul Eggert <eggert@twinsun.com>
4065 * physmem.h, physmem.c: New files.
4067 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
4068 (noinst_HEADERS): Add physmem.h.
4070 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
4071 't' for compatibility with Solaris 8 sort.
4073 2000-12-18 Bruno Haible <haible@clisp.cons.org>
4075 * config.charset: Add support for BeOS.
4077 2000-12-16 Jim Meyering <meyering@lucent.com>
4079 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
4080 SHELLS_FILE to a file name that's useful on djgpp systems.
4082 (ADDITIONAL_DEFAULT_SHELLS): Define.
4083 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
4084 Based mostly on a patch from Prashant TR.
4086 2000-12-16 Jim Meyering <meyering@lucent.com>
4088 This bug had a serious impact on chown: `chown N:M FILE' (for integer
4089 N and M) would have treated it like `chown N:N FILE'.
4091 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
4093 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4095 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
4096 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
4097 to the list of canonical encodings. Rename EUC-CN to GB2312.
4099 2000-12-08 Andreas Schwab <schwab@suse.de>
4101 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
4102 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
4104 2000-12-07 Jim Meyering <meyering@lucent.com>
4106 * stripslash.c (ISSLASH): Define.
4107 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
4110 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
4111 (dir_name_r): Declare this function as static.
4112 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
4113 manifest itself on a name containing a mix of slashes and
4115 Make this function work with names starting with a DOS-style
4116 drive letter and colon prefix.
4117 (dir_name): Append `.' if necessary.
4118 Based mostly on patches from Prashant TR and Eli Zaretskii.
4120 * dirname.h (dir_name_r): Remove prototype.
4122 2000-12-05 Jim Meyering <meyering@lucent.com>
4124 * dirname.c (dir_name_r): Add `const' in a few local declarations.
4126 2000-12-04 Jim Meyering <meyering@lucent.com>
4128 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
4129 Also include memory.h, stdlib.h, unistd.h if appropriate.
4130 Reported by Andreas Jaeger (conflicting declaration of malloc).
4132 2000-12-02 Jim Meyering <meyering@lucent.com>
4134 * closeout.h: Make idempotent, to avoid some obscure warnings.
4136 2000-12-01 Paul Eggert <eggert@twinsun.com>
4138 * memrchr.c: Include <config.h> before any system include file.
4140 2000-11-29 Paul Eggert <eggert@twinsun.com>
4142 * dirname.c (dir_name_r): Fix typo: int -> size_t.
4144 2000-11-26 Jim Meyering <meyering@lucent.com>
4146 * memcoll.c: Include sys/types.h. From Werner Almesberger.
4148 2000-11-22 Paul Eggert <eggert@twinsun.com>
4150 * strftime.c (my_strftime): Do not invoke mbrlen with a
4151 size of (size_t) -1; it's not portable.
4153 2000-11-17 Akim Demaille <akim@epita.fr>
4155 * obstack.h: Formatting changes.
4156 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
4157 prevent type checking.
4158 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
4159 cast the value to (void *): assigning a `foo *' to a `void *'
4161 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
4163 2000-11-17 Jim Meyering <meyering@lucent.com>
4165 * strstr.c: Update from GNU libc.
4167 2000-11-16 Jim Meyering <meyering@lucent.com>
4169 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
4171 2000-11-11 Jim Meyering <meyering@lucent.com>
4173 * error.c: Add a couple #includes, merging from GNU libc version.
4175 2000-11-10 Jim Meyering <meyering@lucent.com>
4177 * obstack.h: Update from GNU libc.
4178 * obstack.c: Likewise.
4180 2000-11-06 Paul Eggert <eggert@twinsun.com>
4182 * getusershell.c (setusershell): Use rewind rather than
4183 fseek/fseeko, to avoid configuration hassles with fseeko.
4184 Don't bother opening SHELLS_FILE if shellstream is NULL;
4187 2000-11-05 Jim Meyering <meyering@lucent.com>
4189 * makepath.h (make_dir): Declare.
4190 * makepath.c (make_dir): Remove `static' attribute.
4193 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
4195 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
4196 last one in a bucket, advance to the next bucket.
4198 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
4200 * fnmatch.c: Do not comment out all the code if we are using
4201 the GNU C library, because in some cases we are replacing buggy
4202 code in the GNU C library itself.
4204 2000-10-30 Paul Eggert <eggert@twinsun.com>
4206 * error.h, getline.h, modechange.h:
4207 Remove "2000" from Copyright line, as the file hasn't been
4208 changed this year other than in the copyright notice.
4210 * xalloc.h: Add "2000" to Copyright line, as this file
4211 was changed this year.
4213 2000-10-30 Paul Eggert <eggert@twinsun.com>
4215 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
4216 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
4217 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4219 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
4221 * regex.h (__restrict_arr): Move definition out of #ifndef block.
4222 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
4223 doesn't define __restrict_arr.
4225 2000-10-29 Jim Meyering <meyering@lucent.com>
4227 * xstat.in: Fix grammar in comment.
4229 2000-10-28 Jim Meyering <meyering@lucent.com>
4231 * memchr.c: Update from libc.
4232 Adjust for portability:
4233 [HAVE_STDLIB_H]: Include stdlib.h.
4234 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
4235 Undef __memchr, too.
4236 [!weak_alias]: Define __memchr to memchr.
4238 * regex.c: Update from libc.
4239 * regex.h: Likewise.
4240 * getopt1.c: Likewise.
4241 * memcmp.c: Likewise.
4243 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
4244 Avoid using fseek, when possible -- it's broken by design.
4245 Patch by Ulrich Drepper.
4247 2000-10-26 Jim Meyering <meyering@lucent.com>
4249 * strftime.c: Update from libc.
4251 2000-10-25 Jim Meyering <meyering@lucent.com>
4253 * obstack.c: Update from libc.
4255 2000-10-23 Jim Meyering <meyering@lucent.com>
4257 * hard-locale.c (hard_locale): Revert last change -- it was simply
4258 wrong. That set_locale call must not have any side effects.
4261 2000-10-22 Jim Meyering <meyering@lucent.com>
4263 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
4264 [CYCLIC]: Remove now-unused definition.
4266 * save-cwd.c (O_DIRECTORY): Define, if needed.
4267 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
4268 Suggestion from Ulrich Drepper.
4270 2000-10-21 Jim Meyering <meyering@lucent.com>
4272 * dirname.c (dir_name_r): New function, factored out of dir_name.
4273 (dir_name): Use dir_name_r.
4274 * dirname.h (dir_name_r): Declare it.
4276 2000-10-21 Jim Meyering <meyering@lucent.com>
4278 * dirname.c (memrchr): Declare if necessary.
4279 (dir_name): Remove the restriction that there be no
4280 trailing slashes. Now, this code skips past them, effectively
4282 [TEST_DIRNAME] (main): New unit tests.
4284 * memrchr.c: New file from GNU libc.
4285 Undef __memrchr, too.
4286 [!weak_alias]: Define __memrchr to memrchr.
4287 Guard weak_alias use with `#ifdef weak_alias'.
4289 2000-10-17 Jim Meyering <meyering@lucent.com>
4291 * quote.h (PARAMS): Define and use.
4292 Reported by Akim Demaille.
4294 * getopt.c: Update from libc.
4296 2000-10-16 Jim Meyering <meyering@lucent.com>
4298 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
4301 2000-09-25 Jim Meyering <meyering@lucent.com>
4303 * md5.h (rol): Define (from GnuPG).
4305 * sha.c: Give credit (GnuPG) where due.
4306 (M): Use rol rather than open-coding it.
4307 Add a FIXME comment.
4309 2000-09-21 Jim Meyering <meyering@lucent.com>
4311 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
4312 Reported by Michael Stone.
4314 2000-09-20 Jim Meyering <meyering@lucent.com>
4316 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
4317 (noinst_HEADERS): Add sha.h.
4318 Based on code from Scott G. Miller and from GnuPG.
4320 2000-09-15 Jim Meyering <meyering@lucent.com>
4322 * regex.c: Update from libc.
4324 2000-09-10 Jim Meyering <meyering@lucent.com>
4326 * getopt.c (_getopt_internal): Update from glibc.
4328 2000-09-09 Jim Meyering <meyering@lucent.com>
4330 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
4331 think it should be used as a general replacement for isascii.
4332 * fnmatch.c: Likewise.
4333 * mbswidth.c: Likewise
4334 * regex.c: Likewise.
4337 * userspec.c: Include sys/param.h and limits.h.
4339 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4340 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
4341 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
4342 UID, GID. Check range.
4344 2000-09-06 Jim Meyering <meyering@lucent.com>
4346 * getopt.c (_getopt_internal): Update from glibc.
4348 2000-08-30 Jim Meyering <meyering@lucent.com>
4350 * strftime.c: Merge in changes from GNU libc.
4352 2000-08-26 Jim Meyering <meyering@lucent.com>
4354 * closeout.c: Include "__fpending.h".
4355 (close_stdout_status): Return right away if there's nothing to flush.
4357 * Makefile.am (noinst_HEADERS): Add __fpending.h.
4358 * __fpending.c: New file.
4359 * __fpending.h: New file.
4361 2000-08-07 Paul Eggert <eggert@twinsun.com>
4363 Standardize on "memory exhausted" instead of "Memory exhausted"
4364 or "virtual memory exhausted".
4365 * obstack.c (print_and_abort): Use "memory exhausted", not
4366 "virtual memory exhausted".
4367 * same.c (same_name): Invoke xalloc_die instead of printing
4369 * userspec.c (parse_user_spec): Likewise.
4370 * bumpalloc.h: comment fix
4371 * same.c, userspec.c: Include xalloc.h.
4373 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
4374 not char *const and pointing to a constant array.
4375 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
4376 (xrealloc): Comment fix.
4378 * userspec.c (parse_user_spec):
4379 Don't translate a message until just before returning,
4380 to avoid unnecessary translation.
4382 2000-08-07 Jim Meyering <meyering@lucent.com>
4384 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
4385 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
4386 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
4387 getgroups.c, gethostname.c, getopt.h, group-member.c,
4388 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
4389 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
4390 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
4391 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
4392 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
4393 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
4394 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
4395 yesno.c: Back out Copyright date changes for each file with no change
4396 this year. This eases coordination with other programs using the same
4397 source code modules. From Paul Eggert.
4399 2000-08-03 Greg McGary <greg@mcgary.org>
4401 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
4402 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
4403 (EXTEND_BUFFER): Use them.
4405 2000-08-01 Jim Meyering <meyering@lucent.com>
4407 * dirname.c (ISSLASH): Define.
4408 (BACKSLASH_IS_PATH_SEPARATOR): Define.
4409 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
4410 both `\' and `/' may be use as path separators.
4411 Based on a patch from Prashant TR.
4413 2000-07-31 Paul Eggert <eggert@twinsun.com>
4415 * quotearg.c (quotearg_n_options): Don't make the initial
4416 slot vector a constant, since it might get modified.
4418 2000-07-31 Jim Meyering <meyering@lucent.com>
4420 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
4421 * obstack.c (print_and_abort): Likewise.
4423 2000-07-30 Paul Eggert <eggert@twinsun.com>
4425 * quotearg.c (quotearg_n_options): Preallocate a slot 0
4426 buffer, so that the caller can always quote one small
4427 component of a "memory exhausted" message in slot 0.
4428 From a suggestion by Jim Meyering.
4430 2000-07-30 Jim Meyering <meyering@lucent.com>
4432 * makepath.c (make_path): Quote the other instance, too.
4434 * quotearg.c (N_STATIC_SLOTVECS): Define.
4435 (STATIC_BUF_SIZE): Define.
4436 (quotearg_n_options): Use only statically allocated storage when
4437 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
4438 than STATIC_BUF_SIZE.
4440 2000-07-29 Jim Meyering <meyering@lucent.com>
4442 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
4443 * dirname.c (dir_name): Likewise.
4445 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
4447 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
4448 (dir_name): Assert that there are no trailing slashes.
4450 2000-07-18 Bruno Haible <haible@clisp.cons.org>
4452 * mbswidth.h (mbswidth): Add a flags argument.
4453 (mbswidth): New declaration.
4454 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
4455 * mbswidth.c (mbswidth): Add a flags argument.
4456 (mbsnwidth): New function.
4458 2000-07-24 Jim Meyering <meyering@lucent.com>
4460 * mbswidth.c: Remove useless #else. From Bruno Haible.
4462 2000-07-23 Paul Eggert <eggert@twinsun.com>
4464 * mbswidth.c (_XOPEN_SOURCE):
4465 Don't define; this causes problems on Solaris 7.
4466 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
4468 2000-07-23 Paul Eggert <eggert@twinsun.com>
4471 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
4472 so that mbstate_t is always defined.
4474 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
4475 be 1 in at least one GCC installation, and this configuration
4476 error is likely to be common. Ignoring MB_LEN_MAX hurts
4477 performance on hosts that have mbrtowc but have only unibyte
4478 locales, but I assume these hosts are rare.
4480 2000-07-23 Paul Eggert <eggert@twinsun.com>
4482 * quotearg.c: Streamline by invoking multibyte code only if needed.
4483 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
4484 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
4485 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
4486 invoke multibyte primitives.
4488 2000-07-23 Jim Meyering <meyering@lucent.com>
4490 * basename.c (base_name): Add an assertion.
4492 2000-07-15 Bruno Haible <clisp.cons.org>
4494 * quotearg.c: When the system forces us to redefine mbstate_t,
4495 shadow its mbsinit function.
4497 2000-07-16 Bruno Haible <haible@clisp.cons.org>
4499 * mbswidth.h: New file.
4500 * mbswidth.c: New file.
4501 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
4502 (noinst_HEADERS): Add mbswidth.h.
4504 2000-07-17 Bruno Haible <haible@clisp.cons.org>
4506 * config.charset: Add support for FreeBSD. Improve support for HP-UX
4509 2000-07-15 Jim Meyering <meyering@lucent.com>
4511 * makepath.c: Include quote.h.
4512 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
4513 corresponding argument in a `quote (...)' call.
4514 Give better diagnostics.
4516 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
4517 (noinst_HEADERS): Add quote.h.
4519 * quote.c (quote, quote_n): New file. Two functions taken verbatim
4520 from tar's src/misc.c.
4521 * quote.h: New file. Prototypes for same.
4523 2000-07-10 Paul Eggert <eggert@twinsun.com>
4525 From a suggestion by Bruno Haible.
4526 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
4527 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
4528 to decide whether to define the BeOS workaround macro;
4529 this adjusts to the change to AC_MBSTATE_T.
4531 2000-07-13 Paul Eggert <eggert@twinsun.com>
4533 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
4535 * quotearg.c (quoting_style_args, quoting_style_vals,
4536 quotearg_buffer_restyled): Add support for
4537 clocale_quoting_style. Undo previous change to
4538 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
4539 and "{RIGHT QUOTATION MARK}" msgids.
4541 2000-07-05 Paul Eggert <eggert@twinsun.com>
4543 The old behavior of quoting `like this' doesn't look good with
4544 newer, ISO-style fonts. See:
4545 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
4547 Instead, quote "like this" by default. Let the translator
4548 tailor the locale-specific quoting behavior by providing
4549 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
4551 * quotearg.c (N_): New macro.
4552 (gettext_default): New function.
4553 (quotearg_buffer_restyled): Use
4554 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
4555 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
4557 2000-07-09 Jim Meyering <meyering@lucent.com>
4559 * Most files: Update copyright dates to include 2000.
4561 2000-07-08 Jim Meyering <meyering@lucent.com>
4563 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
4565 (xgethostname): Remove now-unnecessary #ifdef.
4566 Move declaration of `err' into loop where it's used.
4568 2000-07-05 Bruno Haible <haible@clisp.cons.org>
4570 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
4571 by allocating a larger buffer. Test the gethostname return value for
4572 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
4573 returns an error and ENAMETOOLONG isn't defined.
4575 2000-07-05 Paul Eggert <eggert@twinsun.com>
4576 and Bruno Haible <haible@clisp.cons.org>
4578 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
4580 2000-07-05 Bruno Haible <haible@clisp.cons.org>
4582 * quotearg.c (struct quoting_options): Simplify quote_these_too
4585 2000-07-03 Jim Meyering <meyering@lucent.com>
4587 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
4588 Reported by Bruno Haible.
4590 2000-07-04 Jim Meyering <meyering@lucent.com>
4592 * quotearg.c: Make inclusion of <wchar.h> independent of whether
4593 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
4596 2000-07-03 Paul Eggert <eggert@twinsun.com>
4597 and Bruno Haible <haible@clisp.cons.org>
4599 * quotearg.c (mbrtowc):
4600 Assign to *pwc, and return 1 only if result is nonzero.
4601 (iswprint): Use ISPRINT when substituting our own mbrtowc.
4603 2000-07-03 Jim Meyering <meyering@lucent.com>
4605 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
4606 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
4609 2000-07-02 Jim Meyering <meyering@lucent.com>
4611 * quotearg.c (mbstate_t): Don't define here.
4613 2000-07-02 Jim Meyering <meyering@lucent.com>
4615 * nanosleep.c (SIGCONT): Define if not already defined.
4617 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4619 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
4620 per change in ../m4/ls-mntd-fs.m4.
4621 (read_filesystem_list): Ignore symbolic links.
4623 2000-06-29 Jim Meyering <meyering@lucent.com>
4625 * same.c: Include <string.h> or <strings.h>, as appropriate,
4626 for declaration of strcmp.
4628 * long-options.c: Include <stdlib.h>, for declaration of exit.
4630 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
4631 Avoid warning by casting result to `char *' to remove `const'.
4633 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4635 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
4637 2000-06-26 Paul Eggert <eggert@twinsun.com>
4639 savedir now sets errno on failure and invokes xmalloc to get memory.
4640 Fix a couple of other minor bugs while we're at it.
4642 * savedir.c (<unistd.h>): Do not include; there's no need.
4643 (NAMLEN): Remove macro.
4644 (malloc, realloc): Remove decls.
4646 ("xalloc.h"): Include.
4647 (NAME_SIZE_DEFAULT): New macro.
4648 (savedir): Use xmalloc / xrealloc to allocate memory.
4649 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
4650 Skip "" directory entries.
4651 Use strlen to calculate directory entry length, since the old method
4652 is rarely used these days and isn't worth supporting.
4653 Don't use a pointer after freeing it.
4654 Check for integer overflow when calculating allocation size.
4655 Use memcpy to copy entries, instead of stpcpy.
4656 Set errno properly when returning NULL.
4657 Check for readdir error.
4659 2000-06-26 Jim Meyering <meyering@lucent.com>
4661 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
4663 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4665 * getusershell.c (xmalloc, xrealloc): Remove functions.
4667 Don't include <stdlib.h>. Don't declare malloc, realloc.
4669 2000-06-23 Bruno Haible <haible@clisp.cons.org>
4671 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
4673 2000-06-24 Jim Meyering <meyering@lucent.com>
4675 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
4677 2000-06-21 Jim Meyering <meyering@lucent.com>
4679 * getpass.c: New file, from Bruno Haible. Required for BeOS.
4681 2000-06-19 Paul Eggert <eggert@twinsun.com>
4683 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
4684 (mbrtowc, mbstate_t): Define substitutes if
4685 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
4686 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
4687 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
4689 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4691 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
4692 than 1024, return a memory chunk of least possible size, instead
4693 of size PATH_MAX + 2. In the loop, increment the size proportionally.
4694 Use free/xmalloc instead of xrealloc to avoid copying for very long
4697 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4699 * canon-host.c (canon_host): Use malloc and memcpy to copy an
4700 address, not strdup. Include <stdlib.h> and don't declare free().
4702 2000-06-17 Bruno Haible <haible@clisp.cons.org>
4704 * path-concat.c (path_concat): Don't access dir[-1] if dir is
4707 2000-06-21 Jim Meyering <meyering@lucent.com>
4709 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
4710 (noinst_HEADERS): Add getstr.h.
4712 * getline.c (getstr): Move into a separate file.
4713 * getstr.c (getstr): New file, extracted from getline.c, with
4714 the following changes: new parameter, delim2; both delim[12]
4715 parameters have type `int', not `char'. The latter would lose
4716 with 8-bit delimiters.
4717 * getstr.h: New file.
4719 2000-06-19 Jim Meyering <meyering@lucent.com>
4721 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
4723 2000-06-18 Jim Meyering <meyering@lucent.com>
4725 * mkdir.c: Remove file, due mainly to copyright incompatibility.
4726 Besides, these days every porting target provides a mkdir function.
4728 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
4729 (this snippet comes from src/system.h).
4731 2000-06-15 Paul Eggert <eggert@twinsun.com>
4733 * human.c (adjust_value): New function.
4734 (human_readable_inexact): Apply rounding style even when
4735 printing approximate values.
4737 2000-06-14 Paul Eggert <eggert@twinsun.com>
4739 * human.c (human_readable_inexact): Allow an input block
4740 size that is not a multiple of the output block size, and vice versa.
4741 Reported by Piergiorgio Sartor.
4743 2000-06-14 Paul Eggert <eggert@twinsun.com>
4745 * getdate.y (get_date): Apply relative times after time
4746 zone indicator, not before. Reported by Todd A. Jacobs.
4748 2000-06-13 Jim Meyering <meyering@lucent.com>
4750 * Makefile.am (all-local): Depend on lstat.c and stat.c.
4752 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
4754 2000-06-12 Paul Eggert <eggert@twinsun.com>
4756 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
4758 2000-06-04 Paul Eggert <eggert@twinsun.com>
4760 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
4762 2000-06-04 Jim Meyering <meyering@lucent.com>
4764 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
4765 SunOS 4.1.4 for which gid_t is an unsigned type.
4767 2000-06-03 Jim Meyering <meyering@lucent.com>
4769 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
4771 2000-05-26 Bruno Haible <haible@clisp.cons.org>
4773 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
4774 newer, don't install charset.alias.
4775 * config.charset: Change the Linux/glibc rules so they become empty
4776 on glibc-2.1 or newer.
4778 2000-06-02 Jim Meyering <meyering@lucent.com>
4780 * mountlist.c: Back out last change. Instead, do this...
4781 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
4782 member using the same `ignore'-testing code.
4783 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
4787 2000-05-29 Jim Meyering <meyering@lucent.com>
4789 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
4790 with the `ignore' attribute. Based on a patch from Mark D. Roth.
4792 2000-05-22 Jim Meyering <meyering@lucent.com>
4794 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
4796 2000-05-18 Jim Meyering <meyering@lucent.com>
4798 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
4799 back, too, since it may have been modified by allocate_entry.
4800 (hash_delete): Rewrite to use neither the assignment operator
4801 nor the comma operator in an if-expression.
4803 2000-05-15 Paul Eggert <eggert@twinsun.com>
4806 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
4807 Remove; no longer needed.
4808 "quotearg.h": Add include.
4809 (file_name): Do not bother to explicitly initialize to NULL; it's less
4810 efficient on some hosts.
4811 (close_stdout_status): Remove test as to whether stdout was already
4812 closed; it breaks for the case "echo x | sort >&-".
4813 Quote file name colons.
4814 Do not assume that _("write error") lacks format strings.
4816 2000-05-15 Jim Meyering <meyering@lucent.com>
4818 * version-etc.c (version_etc_copyright): Update the copyright string
4819 used in all --version output.
4821 2000-05-14 Jim Meyering <meyering@lucent.com>
4823 * closeout.c (close_stdout_set_file_name): New function.
4824 (close_stdout_status): Use new file-scoped global.
4825 Return right away if fstat says the stdout file descriptor is invalid.
4826 * closeout.h (close_stdout_set_file_name): Declare.
4828 2000-05-10 Jim Meyering <meyering@lucent.com>
4830 * closeout.c [default_exit_status]: New file-scoped variable.
4831 (close_stdout_set_status): New function.
4832 * closeout.h (close_stdout_set_status): Declare.
4834 2000-05-08 Jim Meyering <meyering@lucent.com>
4836 * long-options.c: Don't include closeout.h.
4837 (parse_long_options): Don't call close_stdout for --version.
4839 2000-05-06 Jim Meyering <meyering@lucent.com>
4841 * strnlen.c: Undefine __strnlen and strnlen.
4842 [!weak_alias]: Define __strnlen to strnlen.
4844 * atexit.c: New file, from libiberty.
4846 2000-05-06 Jim Meyering <meyering@lucent.com>
4848 * closeout.c (close_stdout_status): Also check for errors on the
4851 2000-05-05 Bruno Haible <haible@clisp.cons.org>
4853 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
4854 instead of xmalloc, xrealloc, path_concat.
4855 (locale_charset): Treat empty environment variables as absent.
4856 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
4858 2000-05-04 Jim Meyering <meyering@lucent.com>
4860 * getopt.c: Update from glibc.
4861 * obstack.c: Likewise.
4862 * obstack.h: Likewise.
4863 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
4865 * regex.h: Likewise.
4866 * strndup.c: Likewise.
4867 * strnlen.c: New file, from glibc.
4869 2000-05-01 Jim Meyering <meyering@lucent.com>
4871 * full-write.c (full_write): Remove `FIXME' part of comment.
4873 2000-04-29 Jim Meyering <meyering@lucent.com>
4875 * path-concat.c: Declare strdup only if it's not defined.
4876 * canon-host.c: Likewise.
4878 2000-04-28 Jim Meyering <meyering@lucent.com>
4880 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
4881 redefinition warning on some systems (HPUX). Otherwise, regex.h is
4882 included first, then limits.h is included by locale.h by libintl.h.
4883 From John David Anglin.
4885 2000-04-25 Jim Meyering <meyering@lucent.com>
4887 * makepath.c (S_IRWXUGO): Define.
4888 (make_path): Always perform explicit chmod if MODE specifies any
4889 of the `special' permission bits. Prompted by a bug report against
4890 install from Mate Wierdl and Joost van Baal.
4892 2000-04-18 Jim Meyering <meyering@lucent.com>
4896 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
4897 getpagesize. For BeOS. Based on a patch from Bruno Haible.
4899 2000-04-17 Jim Meyering <meyering@lucent.com>
4901 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
4902 the definition of it to rpl_strftime also defined-away the system's
4905 2000-04-15 Jim Meyering <meyering@lucent.com>
4907 Use `C' to denote so-called `contiguous' files, the same way
4909 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
4910 (ftypelet): Use S_ISCTG.
4911 From Michael Deutschmann.
4913 2000-04-14 Jim Meyering <meyering@lucent.com>
4915 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
4917 2000-04-08 Jim Meyering <meyering@lucent.com>
4919 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
4920 names don't conflict. Reported by Eli Zaretskii.
4922 2000-03-28 Bruno Haible <haible@clisp.cons.org>
4924 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
4925 bug. Deal with the different error behavior of Irix iconv.
4927 2000-04-07 Jim Meyering <meyering@lucent.com>
4929 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
4930 to work around system header problems on AIX 3.2.5. From Bruno Haible.
4932 2000-04-05 Jim Meyering <meyering@lucent.com>
4934 Portability tweaks required for ultrix4.3.
4935 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
4936 * readutmp.c: Include sys/types.h before sys/stat.h.
4937 * canon-host.c: Declare strdup.
4938 * path-concat.c: Likewise.
4939 From John David Anglin.
4941 2000-04-04 Jim Meyering <meyering@lucent.com>
4943 Be more DOS 8.3-friendly.
4944 * ref-add.sin: Renamed from ref-add.sed.in.
4945 * ref-del.sin: Renamed from ref-del.sed.in.
4946 * Makefile.am: Reflect renaming.
4947 Reported by Eli Zaretskii.
4949 Use a temporary file name that won't clash with `charset.alias'
4950 in the DOS 8.3 name space.
4951 * Makefile.am (charset_tmp): Define.
4952 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
4953 (uninstall-local): Likewise.
4954 Reported by Eli Zaretskii.
4956 2000-03-29 Paul Eggert <eggert@twinsun.com>
4958 * time/strftime.c (my_strftime): Make sure we call the system
4959 strftime, not ourselves, when invoking the underlying strftime.
4961 2000-03-24 Jim Meyering <meyering@lucent.com>
4963 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
4964 (charset_alias): Define.
4965 (install-exec-local): Factor out common code.
4966 (uninstall-local): Split lines longer than 80.
4967 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
4969 (.sed.in.sed): New rule. Don't redirect directly to $@.
4970 (CLEANFILES): Add ref-add.sed and ref-del.sed.
4972 2000-03-19 Bruno Haible <haible@clisp.cons.org>
4974 * config.charset: Output a line containing "Packages using this file".
4975 * ref-add.sed.in, ref-del.sed.in: New files.
4976 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
4977 ref-del.sed): New rules.
4979 2000-03-17 Jim Meyering <meyering@lucent.com>
4981 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
4982 Otherwise, include <strings.h>
4984 2000-03-17 Bruno Haible <haible@clisp.cons.org>
4986 * unicodeio.c (utf8_wctomb): New function.
4987 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
4988 format instead of in UCS-4 with platform dependent endianness.
4990 2000-03-07 Paul Eggert <eggert@twinsun.com>
4992 * savedir.c (savedir): Work even if directory size is
4993 negative; this can happen with some screwy NFS configurations.
4995 2000-03-06 Jim Meyering <meyering@lucent.com>
4997 * localcharset.c (get_charset_aliases): Don't try to free file_name
4998 if it's NULL (because we ran out of memory). From Bruno Haible.
5000 2000-03-05 Jim Meyering <meyering@lucent.com>
5002 * localcharset.c ("path-concat.h"): Include.
5003 (get_charset_aliases): Use path_concat instead of ANSI string
5006 * unicodeio.h (PARAMS): Define.
5007 Use it to guard prototype.
5009 2000-03-04 Jim Meyering <meyering@lucent.com>
5011 * Makefile.am (install-exec-local): Create $(libdir) before installing
5013 (uninstall-local): Uncomment this rule so `make distcheck' works
5016 * unicodeio.c (<errno.h>): Include it.
5017 (errno): Declare if not defined.
5019 * localcharset.c: Add Bruno's comment justifying use of volatile.
5021 * config.charset: New version, incorporating remarks from a linux
5022 i18n mailing list. From Bruno Haible.
5024 2000-03-02 Jim Meyering <meyering@lucent.com>
5026 * Makefile.am (EXTRA_DIST): Add config.charset.
5028 2000-03-01 Jim Meyering <meyering@lucent.com>
5030 * localcharset.c: Guard some #includes with `#if HAVE_...'.
5031 * unicodeio.c: Likewise.
5033 2000-02-02 Bruno Haible <haible@clisp.cons.org>
5035 * config.charset: New file.
5036 * localcharset.c: New file.
5037 * unicodeio.h, unicodeio.c: New files.
5038 * Makefile.am (DEFS): Add -DLIBDIR=...
5039 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
5040 (noinst_HEADERS): Add unicodeio.h.
5041 (all-local, install-exec-local, charset.alias): New targets.
5043 2000-02-28 Paul Eggert <eggert@twinsun.com>
5045 * quotearg.c (ALERT_CHAR): New macro.
5046 (quotearg_buffer_restyled): Use it.
5048 2000-02-27 Jim Meyering <meyering@lucent.com>
5050 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
5051 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
5053 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
5054 not `#if STDC_HEADERS'.
5055 Declare malloc if needed.
5057 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
5058 now that autoconf always defines the HAVE_DECL_ symbols.
5059 * human.c: Likewise.
5061 * strtoumax.c: Likewise.
5063 * backupfile.c: Arrange for cpp to fail if the configure-time
5064 declaration check was not run.
5066 * human.c: Likewise.
5068 * strtoumax.c: Likewise.
5070 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
5071 then first look up the entire `.'-containing string as a login name.
5073 2000-02-18 Paul Eggert <eggert@twinsun.com>
5075 * getdate.y: Handle two-digit years with leading zeros correctly.
5076 (textint): New typedef.
5077 (parser_control): Member year changed from int to textint.
5079 (YYSTYPE): Removed; replaced by %union with int and textint members.
5080 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
5081 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
5082 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
5083 (tSNUMBER, tUNUMBER): Now of type <textintval>.
5084 (date, number, to_year): Use width of number in digits, not its value,
5085 to determine whether it's a 2-digit year, or a 2-digit time.
5086 (yylex): Store number of digits of numeric tokens.
5087 Reported by John Kendall.
5089 (parser_control): Changed from struct parser_control to typedef (for
5090 consistency). All uses changed.
5092 (tID): Removed; not used.
5093 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
5095 2000-02-14 Paul Eggert <eggert@twinsun.com>
5097 * getpagesize.h (getpagesize): Port to VMS for Alpha;
5098 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
5100 2000-02-12 Jim Meyering <meyering@lucent.com>
5102 * userspec.c (ISDIGIT): Define it.
5103 (isdigit): Remove definition.
5104 (is_number): Use ISDIGIT, not isdigit.
5105 <libintl.h>: Include.
5107 (parse_user_spec): Mark translatable strings.
5109 2000-02-10 Jim Meyering <meyering@lucent.com>
5111 With these changes, nanosleep.[ch] are finally enough like the other
5112 lib/* replacement files to compile on a few more losing systems.
5114 * nanosleep.h: Don't include config.h.
5115 Remove prototype from declaration of nanosleep.
5116 (PARAMS): Remove now-unneeded definition.
5117 * nanosleep.c: #undef nanosleep.
5118 (rpl_nanosleep): Rename from nanosleep.
5120 2000-02-03 Jim Meyering <meyering@lucent.com>
5122 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
5123 rather than with `#if HAVE_UTMPNAME'.
5125 2000-02-01 Jim Meyering <meyering@lucent.com>
5127 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
5129 2000-01-31 Jim Meyering <meyering@lucent.com>
5131 * nanosleep.h (nanosleep): Guard declaration with
5132 `#if ! HAVE_DECL_NANOSLEEP'.
5133 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
5134 the declaration in that vendor's sys/timers.h.
5135 Reported by Christian Krackowizer.
5137 * quotearg.c (ISASCII): Add #undef and move definition to follow
5138 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
5139 (ISPRINT): Likewise.
5140 Reported by Tom Tromey.
5142 2000-01-30 Jim Meyering <meyering@lucent.com>
5144 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
5145 uses of ->ut_name. The latter doesn't work with new Linux header files
5146 where only utmpx.ut_user is declared.
5148 * readutmp.h (UT_USER): Define.
5150 2000-01-23 Jim Meyering <meyering@lucent.com>
5152 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
5155 2000-01-22 Jim Meyering <meyering@lucent.com>
5157 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
5158 [! HAVE_DECL_STRTOULL]: Declare strtoull.
5159 Required for some AIX systems. Reported by Christian Krackowizer.
5160 [TESTING] (main): New function.
5162 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
5163 * dirname.c (dir_name): Support for DOS-style file names with drive
5166 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
5168 * strverscmp.c (ISDIGIT): Define.
5169 (strverscmp): Use ISDIGIT, not isdigit.
5171 2000-01-17 Paul Eggert <eggert@twinsun.com>
5173 * nanosleep.c (nanosleep):
5174 Don't use SA_INTERRUPT to decide whether to call sigaction, as
5175 POSIX.1 doesn't require SA_INTERRUPT and some systems
5176 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
5177 it's been part of POSIX.1 since day 1 (in 1988).
5179 2000-01-17 Jim Meyering <meyering@lucent.com>
5181 * interlock: Remove unused file. Reported by François Pinard.
5183 2000-01-16 Paul Eggert <eggert@twinsun.com>
5185 * quotearg.c (quotearg_buffer_restyled): Do not quote
5186 alert, backslash, formfeed, and vertical tab unnecessarily in
5187 shell quoting style.
5190 version-control: never