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