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