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