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