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