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