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