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