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