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