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