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