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