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