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