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