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