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