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