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