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