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