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