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