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