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