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