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