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