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