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