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