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