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