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