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