1 2005-08-24 Jim Meyering <jim@meyering.net>
4 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
6 2005-08-21 Bruno Haible <bruno@clisp.org>
8 * lock.h: Add multiple inclusion guard.
9 * tls.h: Add multiple inclusion guard.
11 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
14 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
15 Define, since POSIX requires it as of 2001.
16 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
17 New private symbol, used to keep the enum signed in all cases.
18 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
19 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
21 * regex_internal.c (re_string_skip_chars, register_state):
23 Remove forward decls; no longer needed now that we use prototypes.
24 * regexec.c (acquire_init_state_context, check_halt_node_context):
25 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
26 (clean_state_log_if_needed): Likewise.
28 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
30 Fix problems reported by Sam Steingold in
31 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
32 * regexec.c (sift_states_bkref): Fix portability bug: the code
33 assumed that reg_errcode_t is a signed type, which is not
34 necessarily true if _XOPEN_SOURCE is not defined.
35 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
36 some compilers warn about it otherwise.
38 2005-08-20 Jim Meyering <jim@meyering.net>
40 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
43 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
45 * regcomp.c (create_initial_state): Remove duplicate decl.
46 (init_word_char, create_initial_state, duplicate_node_closure):
47 (fetch_token, peek_token_bracket, build_range_exp):
48 (build_collating_symbol): Remove forward decls; no longer needed
49 now that we use prototypes.
52 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
53 (re_compile_fastmap_iter, regcomp, regerror, regfree):
54 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
55 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
56 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
57 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
58 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
59 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
60 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
61 (build_range_exp, build_collating_symbol, parse_bracket_exp):
62 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
63 (build_charclass, build_charclass_op, fetch_number, create_tree):
64 (create_token_tree, mark_opt_subexp, duplicate_tree):
65 Use prototypes rather than old-style definitions.
68 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
69 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
70 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
71 (re_string_reconstruct, re_string_peek_byte_case):
72 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
73 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
74 (re_node_set_init_copy, re_node_set_add_intersect):
75 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
76 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
77 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
78 (re_acquire_state, re_acquire_state_context, register_state):
79 (create_ci_newstate, create_cd_newstate, free_state):
81 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
82 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
83 (re_search_internal, prune_impossible_nodes):
84 (acquire_init_state_context, check_matching, static):
85 (check_halt_node_context, check_halt_state_context, proceed_next_node):
86 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
87 (update_regs, sift_states_backward, build_sifted_states):
88 (clean_state_log_if_needed, merge_state_array):
89 (update_cur_sifted_state, add_epsilon_src_nodes):
90 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
91 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
92 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
93 (find_recover_state, check_subexp_matching_top, transit_state_mb):
94 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
95 (check_arrival, check_arrival_add_next_nodes):
96 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
97 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
98 (check_node_accept_bytes, check_node_accept, extend_buffers):
99 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
100 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
105 (re_string_allocate, re_string_construct, re_string_reconstruct):
106 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
107 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
108 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
109 (re_string_context_at, re_string_peek_byte_case):
110 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
111 is defined, since we now use prototypes always.
113 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
114 C89 or better. All uses removed.
116 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
118 * regex_internal.c (re_acquire_state, re_acquire_state_context)
119 [defined lint]: Suppress bogus uninitialized-variable warnings.
121 * regcomp.c (duplicate_node): Return new index, not an error code,
122 and let the caller return REG_ESPACE if out of space. This
123 removes an uninitialied-variable warning with GCC 4.0.1, and also
124 avoids taking the address of a local variable. All callers
127 2005-08-19 Jim Meyering <jim@meyering.net>
129 * regexec.c (proceed_next_node): Redo local variables to
130 avoid GCC shadowing warnings.
132 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
134 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
135 (re_node_set_insert_last, re_dfa_add_node):
136 Rename local variables to avoid GCC shadowing warnings.
138 2005-08-18 Bruno Haible <bruno@clisp.org>
140 * strstr.c (strstr): Fix return value in multibyte case.
141 * strcasestr.c (strcasestr): Likewise.
143 2005-08-17 Jim Meyering <jim@meyering.net>
145 Make the %s format (seconds since the epoch) work for a negative
146 number and when used with a zero-padded field width, e.g. %015s.
148 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
149 label so that it precedes the code to set `digits'. Otherwise,
150 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
151 print `00-22'. Now, it prints `-0022', as it should.
153 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
155 * regex.h: Remove useless space-before-tab. From coreutils.
157 2005-08-17 Bruno Haible <bruno@clisp.org>
159 * strcasestr.h: New file.
160 * strcasestr.c: New file.
162 2005-08-17 Bruno Haible <bruno@clisp.org>
164 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
165 * strstr.c: Completely rewritten, with multibyte locale support.
167 2005-08-17 Bruno Haible <bruno@clisp.org>
169 * strcasecmp.c: Use mbuiter.h.
171 2005-08-17 Bruno Haible <bruno@clisp.org>
173 * mbuiter.h: New file.
175 2005-08-16 Bruno Haible <bruno@clisp.org>
177 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
179 (mbi_avail, mbi_advance): Let the iteration end before the terminating
180 NUL byte, not after it.
182 2005-08-16 Bruno Haible <bruno@clisp.org>
184 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
185 the valid ones. Makes the comparison operations transitive:
186 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
187 * strcasecmp.c (strcasecmp): Use mb_casecmp.
189 2005-08-16 Bruno Haible <bruno@clisp.org>
191 * strcase.h (strcasecmp): Add note in comments.
192 * strncasecmp.c: Use code from strcasecmp.c.
193 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
194 (strcasecmp): Work correctly in multibyte locales.
196 2005-08-16 Bruno Haible <bruno@clisp.org>
198 * strnlen1.h: New file.
199 * strnlen1.c: New file.
201 2005-08-16 Bruno Haible <bruno@clisp.org>
203 * mbfile.h: New file.
205 2005-08-16 Bruno Haible <bruno@clisp.org>
207 * mbiter.h: New file.
209 2005-08-16 Bruno Haible <bruno@clisp.org>
211 * mbchar.h: New file.
212 * mbchar.c: New file.
214 2005-08-16 Bruno Haible <bruno@clisp.org>
216 * tls.h: New file, from GNU gettext.
217 * tls.c: New file, from GNU gettext.
219 2005-08-15 Bruno Haible <bruno@clisp.org>
221 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
224 2005-08-14 Jim Meyering <jim@meyering.net>
228 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
229 Use the hash-table-based cycle-detection code not just when
230 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
231 Reported by James Youngman in
232 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
233 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
234 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
235 This lets us compile with -DFTS_DEBUG, once again.
236 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
237 * fts.c (fd_safer): Remove decl.
238 Include fcntl--.h rather than unistd-safer.h
239 (fts_safe_changedir): Don't call fd_safer; no longer needed
240 now that we include fcntl--.h.
242 2005-08-11 Simon Josefsson <jas@extundo.com>
244 * readline.h, readline.c: New file.
246 2005-08-11 Bruno Haible <bruno@clisp.org>
248 * strnlen.h (strnlen): Change parameter name to match comment.
250 2005-08-10 Simon Josefsson <jas@extundo.com>
252 * strndup.c: Use strnlen.h.
254 * strnlen.h: New file.
256 2005-08-02 Simon Josefsson <jas@extundo.com>
258 * getline.h, getline.c: Rewrite.
260 * getdelim.h, getdelim.c: New files, ported from glibc.
262 2005-07-31 Bruno Haible <bruno@clisp.org>
264 * lock.h (gl_lock_initializer): New macro.
265 (gl_lock_define_initialized): Use it.
266 (gl_rwlock_initializer): New macro.
267 (gl_rwlock_define_initialized): Use it.
268 (gl_recursive_lock_initializer): New macro.
269 (gl_recursive_lock_define_initialized): Use it.
271 2005-07-26 Bruno Haible <bruno@clisp.org>
273 * lock.h: Update from GNU gettext.
274 * lock.c: Update from GNU gettext.
276 2005-07-18 Bruno Haible <bruno@clisp.org>
278 * lock.h (gl_once_t): New type.
279 (gl_once_define, gl_once): New macros.
280 * lock.c (fresh_once): New variable.
281 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
284 2005-07-18 Simon Josefsson <jas@extundo.com>
286 * check-version.c (check_version): Accept identical versions too.
288 2005-07-18 Bruno Haible <bruno@clisp.org>
290 * lock.h: New file, from GNU gettext.
291 * lock.c: New file, from GNU gettext.
293 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
295 * quotearg.c: Add translator comment suggested by Bruno Haible,
298 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
300 * version-etc-fsf.c (version_etc_copyright): Parameterize the
301 copyright symbol and the year.
302 * version-etc.c (COPYRIGHT_YEAR): New constant.
303 (version_etc_va): Use parameterized copyright notice.
304 Reword to conform to the current GNU coding standards.
306 2005-07-11 Simon Josefsson <jas@extundo.com>
308 * size_max.h: New file.
310 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
312 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
315 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
316 and Paul Eggert <eggert@cs.ucla.edu>
318 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
319 in wint_t, not wchar_t. Remove now-unnecessary cast.
321 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
323 * regex.c, regex.h: Sync from libc.
324 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
325 New files, synced from libc, except that regex_internal.h
326 currently has a small porting fix.
328 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
330 Remove the dependency of the strftime module on the tzset module.
331 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
332 Copy the input structure, to work around some of the bug with
333 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
334 Solaris releases, you should also use the tzset module, but we won't
335 require it as a dependency any more since we don't want LGPLed code
336 to depend on GPLed code.
338 2005-07-02 Jim Meyering <jim@meyering.net>
340 * backupfile.c (backup_args): Change a `0' to NULL.
342 2005-07-01 Jim Meyering <jim@meyering.net>
344 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
345 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
346 * save-cwd.c, tempname.c:
347 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
348 and don't include <sys/file.h>).
350 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
352 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
353 declares only 'struct timespec;' (!).
355 2005-06-29 Jim Meyering <jim@meyering.net>
357 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
358 type name. Use the variable name instead.
359 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
361 2005-06-28 Simon Josefsson <jas@extundo.com>
363 * check-version.h, check-version.c: New files.
365 2005-06-28 Simon Josefsson <jas@extundo.com>
367 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
368 collision with global variable. Better indentation. Don't
369 increment buffer pointer beyond buffer end. Based on comments
370 from Paul Eggert <eggert@cs.ucla.edu>.
374 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
376 * canon-host.c (canon-host): Append trailing "," to 0 in
377 initializer of struct addrinfo, as an indication that we don't
378 care how many members the structure has.
380 2005-06-24 Derek Price <derek@ximbiot.com>
381 and Bruno Haible <bruno@clisp.org>
383 Remove stat module & update lstat.
384 * stat.c: Remove this file...
385 (slash_aware_lstat): ...moving this content and its support...
386 * lstat.c (rpl_lstat): ...into here.
389 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
391 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
392 (ranged_convert): Don't save conversion in a temporary struct.
393 This causes a warning with GCC 4.0.0, and anyway in the typical
394 case it's not worth the extra 100 bytes or so of code.
395 (ranged_convert, __mktime_internal): When calling a function via a
396 pointer P, use P () rather than (*P) (), as we now assume C89 or
399 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
401 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
402 "who -r" failed to give output. Problem reported by Tim Waugh.
404 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
405 (xcalloc): Use it to avoid needless tests.
406 Problem reported by Jim Meyering.
408 2005-06-16 Jim Meyering <jim@meyering.net>
410 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
411 when either N or S is zero.
413 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
415 * argp.h (__option_is_short): Check upper limit of
416 __key. Isprint() requires its argument to have the value
417 of an unsigned char or EOF.
419 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
421 * fnmatch.c (fnmatch): If there is an encoding error in a
422 multibyte string or pattern, fall back on unibyte matching.
423 Problem reported by James Youngman.
425 2005-06-08 Bruno Haible <bruno@clisp.org>
427 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
430 2005-06-08 Bruno Haible <bruno@clisp.org>
432 * csharpcomp.h: New file, from GNU gettext.
433 * csharpcomp.c: New file, from GNU gettext.
434 * csharpcomp.sh.in: New file, from GNU gettext.
436 2005-06-07 Derek Price <derek@ximbiot.com>
439 * glob_.h: Indent nested #ifdef.
441 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
444 Use "file name" when talking about file names, instead of "filename"
445 or "path", as per the GNU coding standards.
446 * mkdir-p.c: Renamed from makepath.c.
447 (make_dir_parents): Renamed from make_path. All callers changed.
448 * mkdir-p.h: Likewise. All includers changed.
449 * filenamecat.c: Renamed from path-concat.c.
450 (file_name_concat): Renamed from path_concat. All callers changed.
451 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
452 * filenamecat.h: Likewise. All includers changed.
453 * acl.c: Don't use "path" or "filename" to mean "file name"
454 in comments or local variable names.
455 * basename.c: Likewise.
456 * canonicalize.c, canonicalize.h: Likewise.
457 * dirname.c, dirname.h: Likewise.
458 * euidaccess.c: Likewise.
459 * exclude.c: Likewise
460 * fnmatch_.h, fnmatch_loop.c: Likewise.
461 * fsusage.c, fsuage.h: Likewise.
462 * fts.c, fts_.h: Likewise.
463 * getcwd.c: Likewise.
464 * getloadavg.c: Likewise.
465 * mkstemp.c: Likewise.
466 * mountlist.c, mountlist.h: Likewise.
467 * openat.c, openat.h: Likewise.
468 * readlink-stub.c: Likewise.
469 * readutmp.c, readutmp.h: Likewise.
470 * rename.c: Likewise.
473 * savedir.c: Likewise.
474 * stripslash.c: Likewise.
475 * tempname.c: Likewise.
476 * xreadlink.c: Likewise.
477 * exclude.c (excluded_file_name): Renamed from excluded_filename.
479 * exclude.h: Likewise.
481 * euidaccess.c (getuid, getgid, getuid, getegid)
482 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
483 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
484 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
485 * pathmax.h: Include <limits.h> unconditionally, since other
486 files have been getting away with it for years (MORE/BSD 4.3
488 * userspec.c (getpwnam, getgrnam, getgrgid)
489 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
491 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
492 Define to 256, not 255, as per modern POSIX.
494 2005-06-01 Bruno Haible <bruno@clisp.org>
496 * csharpexec.h: New file, from GNU gettext.
497 * csharpexec.c: New file, from GNU gettext.
498 * csharpexec.sh.in: New file, from GNU gettext.
500 2005-05-31 Derek Price <derek@ximbiot.com>
501 Paul Eggert <eggert@cs.ucla.edu>
504 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
506 2005-05-29 Derek Price <derek@ximbiot.com>
507 Paul Eggert <eggert@cs.ucla.edu>
509 * glob_.h, glob.c: New files.
511 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
513 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
515 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
516 the configuration hassle isn't worth it.
517 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
518 (LONGEST_MODIFIER, PRIuMAX): Remove.
520 2005-05-27 Bruno Haible <bruno@clisp.org>
522 * getlogin_r.h: Remove second include of <stddef.h>.
524 2005-05-25 Bruno Haible <bruno@clisp.org>
525 Derek Price <derek@ximbiot.com>
527 * getlogin_r.h: Simplify API documentation.
529 2005-05-25 Derek Price <derek@ximbiot.com>
530 Paul Eggert <eggert@cs.ucla.edu>
532 * getlogin_r.c, getlogin_r.h: New files.
534 2005-05-22 Bruno Haible <bruno@clisp.org>
536 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
537 Also include <sys/param.h> if it defines MIN, MAX.
538 Based on a patch by Derek Price <derek@ximbiot.com>.
540 2005-05-22 Bruno Haible <bruno@clisp.org>
542 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
543 (INT64_MIN): Fix definition.
544 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
546 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
547 NEED_SIGNED_INT_TYPES.
549 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
550 HAVE_SYSTEM_INTTYPES.
552 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
554 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
555 so that unistd-safer.h (GPL'ed code) need not be included.
557 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
560 * fts.c: Don't include "cycle-check.h" or "hash.h".
561 (setup_dir, free_dir): New functions.
562 (enter_dir, leave_dir): Define trivial
563 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
564 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
565 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
566 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
568 (fts_open): Use setup_dir.
569 (fts_close): Use free_dir.
570 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
571 This adds a label and some gotos, but the alternatives were messier.
572 Check for memory allocation failure when entering a dir.
573 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
574 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
575 (FTS): New member fts_cycle, that is a union that contains the
576 old active_dir_ht and cycle_state. All uses changed to mention
577 fts_cycle.ht and fts_cycle.state.
578 * fts-cycle.c: New file, containing GPL'ed code migrated out of
579 fts.c, with the following changes:
580 (setup_dir, free_dir): New functions.
581 (enter_dir): Now returns bool. Return true if successful, false
582 if memory exhausted. All callers changed.
583 Do not bother partly cleaning up on
584 memory allocation failure; that is free_dir's job.
585 However, free ad if hash_insert fails, to avoid memory leak.
586 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
587 fts->fts_options to see which union member to use.
589 2005-05-20 Jim Meyering <jim@meyering.net>
591 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
592 Now a macro, to pacify GCC.
594 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
596 * chown.c (rpl_chown): Return -1 on failure.
598 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
600 * canonicalize.c: Include canonicalize.h first, to test interface.
601 Include <stddef.h> unconditionally, since we assume C89 now.
602 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
603 * fts.c: Include fts_.h first, to check interface.
604 Do not include intprops.h; no longer needed.
605 Include cycle-check.h and hash.h, since fts_.h no longer does.
606 Remove unnecessary casts of closedir to void.
607 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
608 decide whether to decrement nlinks.
609 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
610 (FTS): Use struct hash_table * instead of Hash_table, so that
611 we no longer need to include hash.h here.
613 2005-05-17 Jim Meyering <jim@meyering.net>
615 * fts.c, fts_.h: New files, from coreutils.
617 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
620 * unlinkdir.c, unlinkdir.h: New files.
621 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
622 regex.h, unlocked-io.h, xtime.h:
623 White space changes only.
624 * makepath.c (make_path): Port to hosts where leading "//" is special.
625 * yesno.c: Include getline.h, not ctype.h.
626 (yesno): Don't remove leading white space; POSIX doesn't allow it.
627 Use getline to remove arbitrary restriction on response length.
629 2005-05-13 Bruno Haible <bruno@clisp.org>
631 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
632 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
633 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
634 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
635 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
636 Add support for 64-bit integers in the MSVC compiler.
638 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
640 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
641 Change the initial comment to refer to GPL, not LGPL.
642 gnulib-tool will change it to LGPL as needed.
644 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
645 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
646 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
647 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
648 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
649 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
650 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
651 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
652 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
653 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
654 concatpath.c, config.charset, copy-file.c, copy-file.h,
655 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
656 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
657 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
658 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
659 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
660 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
661 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
662 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
663 full-read.c, full-read.h, full-write.c, full-write.h,
664 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
665 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
666 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
667 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
668 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
669 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
670 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
671 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
672 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
673 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
674 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
675 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
676 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
677 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
678 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
679 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
680 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
681 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
682 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
683 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
684 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
685 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
686 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
687 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
688 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
689 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
690 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
691 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
692 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
693 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
694 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
695 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
696 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
697 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
698 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
699 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
700 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
701 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
702 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
703 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
704 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
705 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
706 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
707 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
708 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
709 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
710 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
711 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
712 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
713 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
714 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
715 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
716 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
717 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
718 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
719 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
720 Update FSF postal mail address.
722 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
724 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
725 specified in ai_socktype. Fix invalid ai_protocol
726 check. ai_protocol is usually set to 0 or depending on
727 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
728 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
729 ai_socktype / ai_protocol in the returned addrinfo structure.
731 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
732 Bruno Haible <bruno@clisp.org>
734 * inet_ntop.h: New file.
735 * inet_ntop.c: New file, from glibc with modifications.
737 2005-05-08 Jim Meyering <jim@meyering.net>
739 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
741 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
743 Merge from coreutils. Among other things,
744 add bulletproofing for cases where stdin, stdout, or stderr are closed.
745 * fd-safer.c: New file.
746 * fcntl-safer.h, open-safer.c: Remove.
747 * chdir-long.c: Fix comment "fetish" -> "coreutils".
748 * dup-safer.c: Include unistd-safer.h first.
749 Don't include errno.h.
750 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
751 * file-type.h: Don't assume invoker included sys/stat.h first.
752 * file-type.c: Rely on file-type.h change.
753 * getloadavg.c: Include unistd-safer.h.
754 (getloadavg): Use safer open.
755 * getusershell.c: Include "stdio-safer.h".
756 (getusershell): Use safer fopen.
757 * long-options.c (long_options): Use NULL rather than 0.
758 * modechange.h (mode_free): Remove; all callers changed to invoke
760 * modechange.c: Likewise.
761 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
762 (MODE_DONE): New constant.
763 (struct mode_change): Remove 'next' member.
764 (make_node_op_equals): New function; like the old one of the
765 same name, except it allocates an array.
766 (mode_compile, mode_create_from_ref): Use it.
767 (mode_compile): Allocate result as an array, not a linked list.
768 Parse octal string ourself, so that we catch mistakes like "+0".
769 (mode_adjust): Arg is an array, not a linked list.
770 * modechange.c: Include stat-macros.h, xalloc.h.
771 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
772 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
773 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
774 Remove. This is now stat-macros.h's job.
775 (talloc): Remove. All callers replaced by xalloc, so that
776 our invokers don't have to worry about reporting memory failures.
777 (make_node_op_equals): Remove.
778 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
780 (struct mode_change): Moved here from modechange.h.
781 (mode_append_entry): Remove.
782 (mode_compile): Remove MASKED_OPS arg, since it encouraged
783 apps to have incorrect behavior. Use simpler algorithm for head
784 and tail. Don't futz with umask; that's now the job of mode_adjust.
785 Detect more invalid usages rather than having somewhat-random behavior.
786 Don't insert an "a=" action, as that leads to incorrect behavior.
787 (mode_compile, mode_create_from_ref): Return NULL on error instead
788 of an enum, since now there's only one way to have an error. All
790 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
791 at the correct time. Simplify calculation of "+u" and its ilk.
792 Don't mishandle "+X".
793 (mode_free): Remove "register" and localize decls.
794 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
795 (struct mode_change): Move to modechange.c; callers don't
796 need to see this stuff.
797 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
798 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
799 (mode_change, mode_adjust): Reflect the new signatures noted above.
800 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
801 that might redefine system include files.
802 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
803 (my_usleep): Use NULL rather than (void *) 0.
804 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
805 Use siginterrupt to specify that system calls should be interrupted.
806 (rpl_nanosleep): Move initialization of suspended closer to call of
808 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
809 * readutmp.c: Likewise. Include signal.h, stdbool.h.
810 (desirable_utmp_entry): New function.
811 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
812 using x2nrealloc, to simplify logic.
813 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
814 size calculation. Do not assume utmp file is a regular file.
815 * readutmp.h (UT_PID): Moved here from ../src/who.c.
816 (READ_UTMP_CHECK_PIDS): New constant.
817 * save-cwd.c: Include unistd-safer.h.
818 (save_cwd): Use fd_safer.
819 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
820 [!_LIBC] Include "stat-macros.h" instead.
821 * unistd-safer.h (fd_safer): New decl.
823 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
825 * byteswap_.h: New file.
827 2005-04-25 Albert Chin <china@thewrittenword.com>
829 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
832 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
834 * getdate.y (zone): Allow relunit_snumber after tZONE, so
835 that "UTC +1 second" continues to work. Problem reported
837 (relunit_snumber): New rule.
840 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
842 * getdate.y (universal_time_zone_table): New constant.
843 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
844 universal_time_zone_table.
845 (lookup_zone): Prefer universal_time_zone_table to
846 local_time_zone_table, so that "GMT" time stamps are allowed in
847 London during the summer. Problem reported by Ian Abbott.
849 2005-04-12 Jim Meyering <jim@meyering.net>
851 * human.c (humblock): Set *options even when returning due to
852 xstrtoumax conversion failure. Thanks to a used-uninitialized
855 2005-04-09 Jim Meyering <jim@meyering.net>
857 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
858 -Wuninitialized: initialize tm0.tm_year.
860 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
862 * getdate.y (parser_control): rels_seen is now a boolean, not a
863 count, since there's no maximum. All uses changed.
864 Add member dsts_seen.
865 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
867 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
868 Use pc_rels_seen to decide whther a date is absolute.
870 * getdate.y (number): Don't overwrite year.
871 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
874 2005-04-02 Simon Josefsson <jas@extundo.com>
876 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
877 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
879 2005-03-27 Jim Meyering <jim@meyering.net>
881 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
883 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
885 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
886 "one's complement" -> "ones' complement" in comment, as per Knuth.
887 "value of type" -> "type or expression" in comment.
888 * mktime.c, strftime.c: Propagate intprops.h comment nits.
890 2005-03-26 Jim Meyering <jim@meyering.net>
893 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
894 Correct typos: s/or/of/.
896 2005-03-23 Jim Meyering <jim@meyering.net>
898 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
900 2005-03-21 Jim Meyering <jim@meyering.net>
902 Changes imported from coreutils.
904 * cycle-check.c: Don't include xalloc.h.
906 * path-concat.c: Don't include assert.h.
907 (path_concat): Remove assertion that would have triggered
908 for ABASE starting with more than one slash.
909 Reported by Andreas Schwab.
911 * path-concat.c (path_concat): Set *BASE_IN_RESULT
912 properly when ABASE is an absolute file name.
913 Correct the description of this function.
915 Add an assertion and a test driver.
916 This fixes a bug introduced on 2004-07-02.
917 Andreas Schwab reported the resulting failure of cp --parents:
918 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
920 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
922 * strftime.c (my_strftime): If the underlying strftime returns 0
923 (which shouldn't happen), generate nothing instead of returning 0
924 immediately, so that nstrftime (NULL, ...) doesn't return 0.
926 2005-03-16 Bruno Haible <bruno@clisp.org>
928 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
930 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
932 * strftime.c (my_strftime): Prepend space to format so that we can
933 reliably distinguish strftime failure from empty output on POSIX
936 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
938 * iconvme.c (SIZE_MAX): New macro, if not already defined.
939 (iconv_string): Don't guess a size-zero buffer, as that might cause
940 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
941 result would be 'too large', where 'too large' is (heuristically)
942 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
943 overflow concerns. This will prevent some unwanted malloc failures
944 when the inputs are very large.
946 2005-03-15 Bruno Haible <bruno@clisp.org>
948 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
951 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
954 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
956 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
958 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
959 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
961 * strtol.c: Likewise.
963 2005-03-14 Simon Josefsson <jas@extundo.com>
965 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
968 2005-03-14 Jim Meyering <jim@meyering.net>
970 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
971 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
972 to be nonzero so that we (and caller) can detect the difference
973 between a valid zero-length expansion and an error return, even
974 when the underlying strftime fails before writing anything into
977 2005-03-10 Jim Meyering <jim@meyering.net>
979 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
980 so that this module works on systems without fchdir.
982 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
984 Factor int-properties macros into a single file, except for
986 * intprops.h: New file.
987 * getloadavg.c: Include it instead of limits.h.
988 (INT_STRLEN_BOUND): Remove.
989 * human.c: Include intprops.h.
990 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
991 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
992 * inttostr.h: Include intprops.h instead of limits.h.
993 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
994 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
995 for consistency with intprops.h.
996 (time_t_is_integer, twos_complement_arithmetic): Use them.
997 * sig2str.h: Include <signal.h>, intprops.h.
998 (INT_STRLEN_BOUND): Remove.
999 * strftime.c (TYPE_SIGNED): Remove.
1000 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
1001 * strtol.c: Adjust comments to match intprops.h.
1002 * userspec.c: Include intprops.h.
1003 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
1004 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
1005 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
1006 instead of rolling our own expressions.
1007 * xstrtol.c: Include xstrtol.h first, to test interface.
1009 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
1011 (my_strftime): Do not mishandle years close to INT_MAX, by doing
1012 the right thing even if adding 1900 would overflow. Similarly
1013 for tm_mon + 1 and tm_yday + 1.
1014 Make %Y always equivalent to %C%y, and similarly for %G and %g.
1015 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
1016 (DO_SIGNED_NUMBER): New macro.
1017 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
1019 2005-03-07 Bruno Haible <bruno@clisp.org>
1021 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
1023 2005-03-03 Derek R. Price <derek@ximbiot.com>
1024 Bruno Haible <bruno@clisp.org>
1026 * pagealign_alloc.h: New file.
1027 * pagealign_alloc.c: New file.
1029 2005-01-28 Bruno Haible <bruno@clisp.org>
1031 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
1034 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
1036 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
1037 The workaround isn't strictly needed for POSIX conformance, and
1038 it's too much of a pain to configure and maintain. We'll ask
1039 people to fix their kernels instead.
1040 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
1041 (NANOSLEEP_BUG_WORKAROUND): Remove.
1042 (xnanosleep): Remove the workaround.
1044 2005-02-12 Bruno Haible <bruno@clisp.org>
1046 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
1048 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
1050 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
1051 * timespec.h (gettime): Return void, since it always
1052 succeeds now. All uses changed.
1053 * gettime.c (gettime) Likewise.
1054 [HAVE_NANOTIME]: Prefer nanotime.
1055 Assume gettimeofday succeeds, as POSIX requires.
1056 Assime time () succeeds, since other code already does.
1057 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
1058 (timespec_subtract): Remove.
1059 (NANOSLEEP_BUG_WORKAROUND): New constant.
1060 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
1061 things considerably. Use it only on GNU/Linux hosts, since the
1062 workaround shouldn't be needed elsewhere.
1064 2005-02-24 Bruno Haible <bruno@clisp.org>
1066 * gettext.h: Update from GNU gettext 0.14.2.
1068 2005-02-24 Bruno Haible <bruno@clisp.org>
1070 * localcharset.c: Update from GNU gettext 0.14.2.
1071 * config.charset: Update from GNU gettext 0.14.2.
1073 2005-02-22 Simon Josefsson <jas@extundo.com>
1075 * iconvme.h, iconvme.c: New files, from libc.
1077 2005-02-20 Neil Conway <neilc@samurai.com>
1079 * xgethostname.c (xgethostname): Check for ENOMEM, which is
1080 returned by OSX/Darwin if the specified buffer is not large
1081 enough for the hostname.
1083 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
1085 * memrchr.h: New file.
1086 * chdir-long.c: Include it.
1087 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
1088 Don't bother including stddef.h.
1090 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1092 * argp-help.c (__argp_help): Create a fake struct argp_state and
1093 pass it to _help, otherwise the latter coredumps trying to
1094 dereference state.root_argp.
1096 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
1098 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
1100 Include <sys/types.h>, for dev_t.
1101 (ME_DUMMY, ME_REMOTE): Move from here....
1102 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
1103 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
1105 Include mountlist.h first, to test the interface.
1107 2005-01-29 Bruno Haible <bruno@clisp.org>
1109 * progname.c (program_name): Initialize.
1110 Needed when linking statically on MacOS X.
1112 2005-01-28 Bruno Haible <bruno@clisp.org>
1114 * javacomp.sh.in: New file, from GNU gettext.
1115 * javacomp.h: New file, from GNU gettext.
1116 * javacomp.c: New file, from GNU gettext.
1118 2005-01-26 Bruno Haible <bruno@clisp.org>
1120 * javaexec.sh.in: New file, from GNU gettext.
1121 * javaexec.h: New file, from GNU gettext.
1122 * javaexec.c: New file, from GNU gettext.
1124 2005-01-26 Simon Josefsson <jas@extundo.com>
1126 * gai_strerror.c: Use GPL in header.
1128 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1130 * argp-help.c (hol_entry_help): Avoid using non-constant
1131 initializers for struct pentry_state.
1132 (__argp_error): Check return value of __asprintf
1133 (__argp_failure): Translate error message
1135 * argp-parse.c: Removed braces around the expansion of N_()
1137 2005-01-21 Jim Meyering <jim@meyering.net>
1139 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
1140 same value as for Solaris 9.
1142 * chdir-long.c (chdir_long): Rewrite to remove limitation on
1143 component length. This included changing the parameter to be
1144 of type `char *' rather than `char const *'.
1145 * chdir-long.h (chdir_long): Update prototype.
1147 * openat.c (fdopendir, fstatat): New functions.
1148 * openat.h: Include headers required for use of DIR and struct stat.
1149 [AT_SYMLINK_NOFOLLOW]: Define.
1150 (fdopendir, fstatat): Add prototypes.
1152 2005-01-21 Bruno Haible <bruno@clisp.org>
1154 * classpath.h: New file, from GNU gettext.
1155 * classpath.c: New file, from GNU gettext.
1157 2005-01-20 Simon Josefsson <jas@extundo.com>
1159 * version-etc-fsf.c: New file, with version_etc_copyright.
1160 * version-etc.c: Remove version_etc_copyright.
1161 * version-etc.h (version_etc_copyright): Use [] instead of * in
1162 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
1164 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
1166 * save-cwd.c (save_cwd): Remove code to support the case
1167 where fchdir is missing or flaky.
1169 2005-01-20 Simon Josefsson <jas@extundo.com>
1171 * base64.h (isbase64): Add.
1173 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
1174 using a unsigned prototype, don't inline.
1175 (base64_decode): Use it.
1177 2005-01-19 Bruno Haible <bruno@clisp.org>
1179 * sh-quote.h: New file, from GNU gettext.
1180 * sh-quote.c: New file, from GNU gettext.
1182 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
1184 Merge changes from coreutils, as described below in several
1185 changelogs dated today.
1187 * save-cwd.c: Include "save-cwd.h" before other include files.
1188 (O_DIRECTORY): Remove; not needed here, since "." must be
1189 a directory. All uses removed.
1190 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
1191 universal on Suns, and we also need to test for IRIX.
1192 Revamp code to use 'if' rather than '#if'.
1193 Avoid unnecessary comparison of cwd->desc to 0.
1195 * utimens.c (futimens): Robustify the previous patch, by checking
1196 for known valid error numbers rather than observed invalid ones.
1198 2005-01-18 Jim Meyering <jim@meyering.net>
1200 * version-etc.c (version_etc_copyright): Update copyright date.
1202 * utimens.c (futimens): Account for the fact that futimes
1203 can also fail with errno == ENOSYS or errno == ENOENT.
1204 Patch from Dmitry V. Levin.
1206 Change the name of the robust chdir function from chdir to chdir_long.
1207 * save-cwd.c: Include chdir-long.h rather than chdir.h.
1208 (restore_cwd): Use chdir_long, not chdir.
1209 * chdir-long.c: Renamed from chdir.c.
1210 * chdir-long.h: Renamed from chdir.h.
1211 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
1214 2005-01-18 Bob Proulx <bob@proulx.com>
1216 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
1217 offsetof() macro construct to avoid compile failure with native HP-UX
1218 11.0 ANSI C compiler.
1220 2005-01-06 Bruno Haible <bruno@clisp.org>
1222 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
1223 because stpncpy.m4 takes care of it.
1225 2004-01-24 Bruno Haible <bruno@clisp.org>
1227 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
1229 2003-10-09 Bruno Haible <bruno@clisp.org>
1231 * progreloc.c: Include xalloc.h instead of xmalloc.h.
1233 2005-01-06 Bruno Haible <bruno@clisp.org>
1235 * fwriteerror.h (fwriteerror): Change specification to include fclose.
1236 * fwriteerror.c: Include <stdbool.h>.
1237 (fwriteerror): At the end, close the file stream. Record whether
1238 stdout was already closed.
1240 2004-05-27 Bruno Haible <bruno@clisp.org>
1242 * execute.c (environ): Declare if needed.
1243 * pipe.c (environ): Likewise.
1244 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
1246 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
1248 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
1249 definitions to be after all include files, to avoid collisions.
1250 Problem reported by Bob Proulx.
1252 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
1254 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
1255 not needed. This removes a dependency on the gettext module.
1256 [defined _LIBC]: Do not include <libintl.h>; not needed.
1258 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
1260 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
1263 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
1265 * argp-parse.c: Include <stddef.h>.
1266 (alignof, alignto): New macros.
1267 (parser_init): Don't assume that void * is aligned sufficiently
1270 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
1271 need to extend the stack.
1272 (YYINITDEPTH): New macro, so that the initial stack isn't overly
1275 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1277 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
1279 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1281 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
1282 Remove now-obsolete comment about AIX.
1283 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
1284 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
1285 (YYMAXDEPTH): New macro.
1287 2004-12-18 Bruno Haible <bruno@clisp.org>
1289 * fatal-signal.c (fatal_signals): Make non-const.
1290 (init_fatal_signals): New function.
1291 (uninstall_handlers, install_handlers): Ignore signals that were set to
1293 (at_fatal_signal): Call init_fatal_signals.
1294 (init_fatal_signal_set): Likewise. Ignore signals that were set to
1296 Reported by Paul Eggert.
1298 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1300 * getdate.y (textint): New member "negative".
1301 (time_zone_hhmm): New function.
1302 Expect 14 shift-reduce conflicts, not 13.
1303 (o_colon_minutes): New rule.
1304 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
1305 (yylex): Set the "negative" member of signed numbers.
1307 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
1309 Changes imported from coreutils.
1310 * hard-locale.c: Assume <locale.h> exists.
1312 (GLIBC_VERSION): New macro.
1313 (hard_locale): Assume setlocale exists.
1314 Rewrite to avoid #ifdef.
1315 Use strdup rather than malloc + strcpy.
1316 * human.c: Assume <locale.h> exists.
1317 (human_readable): Assume localeconv exists.
1319 2004-12-01 Jakub Jelinek <jakub@redhat.com>
1321 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
1322 convert T2, not T. (Imported from libc.)
1324 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1326 * getcwd.c (is_ENAMETOOLONG): New macro.
1327 (__getcwd.c): Don't restore errno; glibc doesn't.
1328 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
1329 first, falling back to our code only if its results look suspicious.
1330 Ensure that the resulting buffer is only as large as necessary.
1332 * readutmp.c: Include readutmp.h first.
1333 Include <errno.h>, since readutmp.h no longer does that.
1334 * readutmp.h: Don't include <errno.h>,
1335 <sys/param.h>, <time.h>; not needed to establish interface.
1336 (errno): Remove decl.
1337 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
1338 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
1339 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
1341 2004-11-28 Simon Josefsson <jas@extundo.com>
1343 * base64.h, base64.c: New file.
1345 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
1347 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
1349 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1351 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1352 HP's ANSI C compiler.
1353 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1354 Declaring int functions causes warnings on some modern systems and
1355 shouldn't be needed to compile on ancient ones.
1356 * same.c (MIN) [defined MIN]: Don't define, since it's already
1359 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1360 with the following changes.
1361 (__set_errno): Parenthesize properly.
1362 Include <stdbool.h>.
1363 (MIN, MAX, MATCHING_INO): New macros.
1364 (__getcwd): Define with prototype, not K&R form.
1365 Use heuristics to allocate default buffer on stack if possible.
1366 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1367 behavior, and to avoid the PATH_MAX limit when computing
1369 Use MATCHING_INO to compare inode number to file.
1370 Check for arithmetic overflow in size calculations.
1371 Fix bug in reallocation of dot array that caused getcwd to fail
1372 on directories nested deeper than 75.
1373 Be more careful about saving errno on error.
1374 Do not use realloc; use only free+malloc, as this is a bit
1375 more flexible and avoids a needless copy operation.
1376 Do not inspect st_dev and st_ino for symbolic links; POSIX
1377 doesn't specify the latter.
1378 Check for closedir errors.
1379 Avoid needless casts.
1380 Use "#ifdef weak_alias" around weak_alias, to be like other
1382 The following changes to getcwd.c have effect only when used in
1383 gnulib; they have no effect inside glibc proper.
1384 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1385 as alloca isn't used.
1386 (alloca, __alloca): Likewise.
1387 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1388 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1389 unconditionally, as gnulib assumes C89 or better.
1390 Do not include <sys/param.h>.
1391 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1392 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1394 (NULL) [!defined NULL]: Remove; we assume C89 or better.
1395 Include <dirent.h> in a way that is compatible with modern Autoconf.
1396 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1397 New macros, if not already defined.
1398 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1399 Use "_LIBC", not "defined _LIBC", for consistency.
1400 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1402 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1403 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
1404 * xgetcwd.c: David MacKenzie's old code was removed, so give
1405 credit only to Jim Meyering and adjust the copyright dates.
1406 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1407 <stdlib.h>, <unistd.h>, "pathmax.h".
1408 Instead, include "xgetcwd.h" (first) and "getcwd.h".
1409 (INITIAL_BUFFER_SIZE): Remove.
1410 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1412 2004-11-23 Jim Meyering <jim@meyering.net>
1414 * getopt_.h: Remove trailing blanks.
1416 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1418 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1419 (futimens): New function, which uses futimes if available.
1420 (futimens, utimens): Support timespec==NULL, with same semantics
1421 as utime and utimens.
1422 * utimens.h (futimens): New decl.
1424 2004-11-23 Jim Meyering <jim@meyering.net>
1426 * __fpending.c: Add comment.
1428 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1430 * getopt_.h: Re-addition of __getopt_argv_const caused
1431 redefinition warnings. To avoid them, include the defines
1432 in `#if !defined __need_getopt ... #endif'. The only place
1433 where __getopt_argv_const is used is in definitions
1434 of getopt_long and getopt_long_only below, which are as well
1435 protected by `#ifndef __need_getopt'.
1436 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1437 __need_getopt after including <stdio.h> and <unistd.h> These
1438 headers might have defined it.
1440 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1442 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1444 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1445 optopt): Use them instead of invoking ## directly; otherwise, the
1446 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1448 2004-11-19 Bruno Haible <bruno@clisp.org>
1450 * strtok_r.c: Move comments from here...
1451 * strtok_r.h: ... to here.
1453 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1455 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1456 might fail. Problem reported by Yoann Vandoorselaere.
1457 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1458 that mishandle size_t overflow.
1460 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1462 * canon-host.c: Include "strdup.h".
1463 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1464 Use strdup instead of malloc/strcpy to duplicate strings.
1466 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1467 (human_space_before_unit): New constant.
1468 * human.c (human_readable): Support it.
1470 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1471 (xgetcwd): Set errno correctly when failing.
1472 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1473 the failure is actually due to a PATH_MAX problem.
1475 Further getopt changes to make it more likely that glibc will
1476 buy the changes back.
1477 * getopt.c (POSIXLY_CORRECT): New constant.
1478 (getopt): Use it, so to preserve glibc semantic
1479 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1480 when compiling for libc.
1481 * getopt_.h (__getopt_argv_const): Bring it back.
1482 (getopt_long, getopt_long_only): Use it.
1484 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1485 New arg POSIXLY_CORRECT. All callers changed.
1486 (getopt): Argv is now char * const *, as per standard.
1487 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1488 not char *__getopt_argv_const *.
1489 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1490 _getopt_long_only_r): Likewise.
1491 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1492 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1493 _getopt_long_r, _getopt_long_only_r): Likewise.
1494 * getopt_.h (__getopt_argv_const): Remove.
1495 (getopt): Argv is now char * const *, as per standard.
1497 * getdate.y (tORDINAL): New token.
1498 (day, relunit): Allow it for relative times.
1499 (relative_time_table): Use tORDINAL for ordinals.
1501 2004-11-15 Jim Meyering <jim@meyering.net>
1503 * closeout.c: Include "__fpending.h" once again.
1504 Include <stdbool.h>.
1505 (close_stdout): Don't fail just because stdout was closed initially,
1506 since some programs don't write to stdout in the normal course of
1507 operation (other than --version and --help), and we don't want this
1508 function to make e.g. `touch file >&-' fail.
1509 But do fail if it was closed and someone has tried to write to it.
1510 E.g., `printf foo >&-' must fail.
1512 2004-11-11 Simon Josefsson <jas@extundo.com>
1514 * strtok_r.h, strtok_r.c: New file.
1516 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1518 * getopt_.h (__getopt_argv_const): New macro, to be used so that
1519 we can stop lying to compilers about the constness of argv when we
1520 are compiled outside glibc.
1521 (getopt, getopt_long, getopt_long_only): Use it.
1522 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1524 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1525 _getopt_long_only_r): Likewise.
1526 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1527 _getopt_long_only_r): Likewise.
1529 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1530 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1531 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1532 the other external symbols.
1533 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1534 declaration, since the above renaming now works around collisions.
1536 2004-11-11 Jim Meyering <jim@meyering.net>
1538 * linebreak.c: Remove trailing blanks.
1539 * alloca_.h: Likewise.
1540 * acosl.c: Likewise.
1541 * euidaccess.c: Likewise.
1542 * allocsa.h: Likewise.
1544 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1546 * mktime.c (SHR): New macro, which is a portable
1547 substitute for >> that should work even on Crays.
1548 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1549 Problem reported by Mark D. Baushke in
1550 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1551 * getdate.y (SHR): Likewise.
1553 * strftime.c (SHR): Likewise.
1555 * quotearg.c (struct quoting_options): Use unsigned int for
1556 quote_these_too, so that right shifts are well defined. All uses
1559 2004-11-10 Simon Josefsson <jas@extundo.com>
1561 * getaddrinfo.h, getaddrinfo.c: New files.
1563 2004-11-10 Jim Meyering <jim@meyering.net>
1565 Ensure that no close failure goes unreported.
1566 * closeout.c (close_stdout): Always close stdout. I.e., don't
1567 return early when it seems there's nothing to flush.
1568 Don't include __fpending.h.
1570 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1572 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1574 2004-11-05 Bruno Haible <bruno@clisp.org>
1576 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1577 Reported by Mark D. Baushke <mdb@cvshome.org>.
1579 2004-11-04 Bruno Haible <bruno@clisp.org>
1581 2004-09-11 Bruno Haible <bruno@clisp.org>
1582 * allocsa.valgrind: New file.
1583 2004-02-06 Bruno Haible <bruno@clisp.org>
1584 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1585 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1586 Reported by Christopher Seip <chris.seip@hp.com>.
1588 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1590 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1591 with errno == ERANGE if the buffer is too small.
1592 Problem reported by Mark D. Baushke.
1594 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1596 * xreadlink.c (MAXSIZE): New macro.
1597 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1598 size does not exceed MAXSIZE. Avoid cast.
1599 As suggested by Mark D. Baushke in
1600 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1601 if readlink fails with buffer size just under MAXSIZE, try again
1604 2004-11-02 Derek R. Price <derek@ximbiot.com>
1605 and Paul Eggert <eggert@cs.ucla.edu>
1607 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1608 (get_date): Overparenthesize to avoid GCC warning.
1610 2004-11-02 Bruno Haible <bruno@clisp.org>
1612 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1613 function returns void.
1615 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1617 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1618 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1621 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1623 * getdate.y: Add support for TZ="foo" within a date string.
1624 Fix some bugs near time_t boundaries. Reject dates with
1625 out-of-range components, e.g., "Sept 31".
1626 Include <stdlib.h>, "setenv.h", "xalloc.h".
1627 (ISDIGIT_LOCALE): Remove; unused.
1628 Note that the TZ and time functions used here are not reentrant.
1629 (mktime_ok, get_tz): New functions.
1630 (TZBUFSIZE): New constant.
1631 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1632 This requires that we sometimes generate our own TZ="XXX..." setting.
1634 2004-10-27 Derek R. Price <derek@ximbiot.com>
1636 * mktime.c (not_equal_tm): Remove redundant check.
1638 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1640 * getdate.y: Use Bison 1.875 features, and some minor
1641 code cleanups. This change does not affect semantics.
1642 Don't include <stdlib.h>; no longer needed.
1643 Don't include unlocked-io.h; only the "#if TEST" code uses
1644 stdio, and performance isn't crucial there.
1645 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1646 Bison 1.875 features as described below.
1647 All uses of "PC." replaced by "pc->".
1648 (YYSTYPE): Add a forward declaration.
1649 (yylex, yyerror): Use full prototypes in forward decls.
1650 Use "%pure-parser" rather than obsolescent "%pure_parser".
1651 Use %parse-param and %lex-param instead of obsolescent
1652 YYPARSE_PARAM and YYLEX_PARAM.
1653 (meridian_table, month_and_day_table, time_units_table,
1654 relative_time_table, time_zone_table, military_table,
1655 lookup_zone, lookup_word, get_date):
1656 Use NULL instead of 0 where appropriate.
1657 (to_hour): Avoid abort (), to avoid a dependency on
1659 (yyerror, yylex): Now accepts parser_control * arg.
1660 (main) [TEST]: Use '\0' rather than 0 for char.
1662 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1664 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1665 It's now the caller's responsibility to handle the case where
1666 !HAVE_GETPAGESIZE && !defined getpagesize.
1668 * mktime.c (leapyear): Arg is long int, not int.
1670 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1672 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1674 2004-10-12 Simon Josefsson <jas@extundo.com>
1676 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1677 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1680 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1682 * vsnprintf.h: New file.
1683 * vsnprintf.c: New file.
1685 2004-10-07 Bruno Haible <bruno@clisp.org>
1687 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1688 into the provided buffer.
1690 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1692 * diacrit.c, diacrit.h: Add GPL notice.
1694 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1695 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1696 * logl.c (logl): Keep the code as similar to glibc as possible.
1697 This avoids a potential constant-folding bug.
1699 2004-10-05 Bruno Haible <bruno@clisp.org>
1701 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1703 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1705 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1706 * xmalloc.c (xmemdup): Likewise.
1707 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1708 XFREE): Remove these long-obsolescent macros.
1709 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1710 * xstrdup.c: Remove.
1712 * regex.c (re_comp): Cast gettext return value to char *,
1713 Problem reported by Martin Neitzel via Mark D. Baushke.
1715 2004-10-04 Simon Josefsson <jas@extundo.com>
1717 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1718 '#ifdef USE_UNLOCKED_IO'.
1720 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1722 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1723 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1724 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1725 regex.c, sha1.c, version-etc.c, yesno.c:
1726 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1727 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1728 the includer's responsibility.
1730 Sync from coreutils.
1732 * modechange.c (mode_compile): Don't decrement a pointer that
1733 points to the start of a string, as the C Standard says the
1734 resulting behavior is undefined.
1736 * backupfile.h (enum backuptype): Rename none -> no_backups,
1737 simple -> simple_backups, numbered_existing ->
1738 numbered_existing_backups, numbered -> numbered_backups
1739 to avoid shadowing problems. All uses changed.
1740 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1741 * backupfile.c (check_extension, numbered_backup):
1742 Rename locals to avoid shadowing 'basename'.
1743 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1746 * .cppi-disable: Add getopt_.h, getopt_int.h.
1747 * .cvsignore: Add getopt.h.
1749 2004-10-04 Simon Josefsson <jas@extundo.com>
1751 * memmem.h: New file.
1752 * memmem.c: New file, taken from glibc.
1754 2004-10-02 Jim Meyering <jim@meyering.net>
1756 * dirfd.h, getpagesize.h: Add copyright notice.
1758 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1760 * snprintf.c: Remove comments as to why each header is needed.
1762 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1764 * strsep.h: New file.
1765 * strsep.c: New file.
1767 2004-10-01 Simon Josefsson <jas@extundo.com>
1769 * snprintf.c (snprintf): Handle size==0.
1771 2004-10-01 Simon Josefsson <jas@extundo.com>
1772 Bruno Haible <bruno@clisp.org>
1774 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1775 (snprintf): Declare 'args'.
1777 2004-09-30 Simon Josefsson <jas@extundo.com>
1779 * snprintf.h, snprintf.c: New files.
1781 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1783 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1784 (hol_entry_help): Never translate an empty string.
1785 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1786 * argp.h (OPTION_NO_TRANS): New option.
1788 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1790 * xvasprintf.c: Include xalloc.h.
1791 (xvasprintf): Use xalloc_die, not xmalloc_die.
1793 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1795 * dummy.c: Change copyright notice to FSF, and license to GPL.
1797 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1799 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1800 Problem reported by Bruno Haible in:
1801 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1803 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1805 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1806 in case some system header has #define'd it. Problem reported by
1807 Soeren D. Schulze in
1808 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1810 2004-09-08 Bruno Haible <bruno@clisp.org>
1812 * stdint_.h.in: New file, taken from GNU clisp.
1814 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1816 * xvasprintf.h: New file.
1817 * xvasprintf.c: New file.
1818 * xasprintf.c: New file.
1820 2004-09-08 Bruno Haible <bruno@clisp.org>
1822 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1824 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1826 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1828 Import from coreutils.
1829 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1830 strings on unbounded length. alloca's performance benefits aren't
1831 that important here.
1833 (parse_with_separator): New function, with most of the internals
1834 of the old parse_user_spec. Allow user to omit both user and group,
1835 for compatibility with FreeBSD.
1836 Clone only the user name, not the entire spec.
1837 Do not set *uid, *gid unless entirely successful.
1838 Avoid memory leak in some failing cases.
1839 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1840 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1841 (parse_user_spec): Rewrite to use parse_with_separator.
1843 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1845 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1846 its complicated substitute.
1847 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1848 and program_invocation_name.
1849 (__argp_basename) [!_LIBC]: Remove; the only use was
1850 replaced by its body.
1851 (__argp_short_program_name): Change condition from
1852 !defined __argp_short_program_name to
1853 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1854 to match argp-namefrob.h.
1855 (__argp_failure): Don't assume strerror_r returns char *.
1856 * argp-parse.c (N_): Define unconditionally.
1857 (argp_default_options): Fill out initializers with 0 to avoid
1860 2004-08-12 Simon Josefsson <jas@extundo.com>
1862 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1863 * getopt_.h: Renamed from getopt.h.
1865 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1867 Merge from coreutils.
1869 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1870 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1871 for Reliant Unix 5.43.
1873 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1874 (union fooround): Use uintmax_t, not long int.
1875 The rest is a merge from libc:
1876 [defined _LIBC]: Include <shlib-compat.h>.
1877 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1879 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1881 * strverscmp.c: Convert to UTF-8.
1883 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1885 * obstack.h (obstack_empty_p):
1886 Don't assume that chunk->contents is suitably aligned.
1887 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1888 Likewise. Problem reported by Benno in
1889 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1891 * chown.c (rpl_chown): Work even if the file is writeable but not
1892 readable. This could be improved further but it'd take some work.
1894 2004-08-08 Simon Josefsson <jas@extundo.com>
1896 * xgethostname.c: Don't include error.h (not used).
1899 * getpass.c: Include getpass.h first.
1901 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1903 * xalloc-die.c: New files.
1904 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1906 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1907 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1908 (_, N_, xalloc_die): Move to xalloc-die.c.
1909 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1910 so that we needn't mess with xalloc_msg_memory_exhausted.
1912 * sha1.h: Renamed from sha.h.
1913 (SHA1_H): Renamed from _SHA_H.
1914 (sha1_ctx): Renamed from sha_ctx.
1915 (sha1_init_ctx): Renamed from sha_init_ctx.
1916 (sha1_process_block): Renamed from sha_process_block.
1917 (sha1_process_bytes): Renamed from sha_process_bytes.
1918 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1919 (sha1_read_ctx): Renamed from sha_read_ctx.
1920 (sha1_stream): Renamed from sha_stream.
1921 (sha1_buffer): Renamed from sha_buffer.
1922 * sha1.c: Likewise; renamed from sha.c.
1923 Do not include <sys/types.h>.
1924 Include <stddef.h> rather than <stdlib.h>.
1926 2004-08-08 Bruno Haible <bruno@clisp.org>
1928 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1929 FILESYSTEM_PREFIX_LEN.
1930 * progreloc.c: Likewise.
1931 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1933 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1936 * argp-help.c (make_hol, hol_append): Don't assume that
1937 SIZE_MAX is a valid preprocessor constant.
1938 (__argp_basename): Change from "#ifndef _LIBC"
1939 to "#ifndef __argp_short_program_name", so that
1940 we don't compile these functions for tar.
1942 More merges from coreutils.
1943 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1944 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1946 * addext.c: Remove; no longer needed.
1947 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1948 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1949 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1950 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1951 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1952 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1953 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1954 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1955 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1956 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1957 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1958 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1959 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1960 Import changes from coreutils.
1962 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1964 Merge from coreutils.
1966 * .gdb-history: Remove; this doesn't belong here.
1968 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1969 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1970 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1972 * dirname.h: Include <stdbool.h>.
1973 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1974 for consistency with POSIX terminology. All uses changed.
1975 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1976 (strip_trailing_slashes): Use bool for booleans.
1977 * stripslash.c (strip_trailing_slashes): Likewise.
1979 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1980 sometimes returns a positive errno value even when it succeeds.
1981 (print_errno_message) [!LIBC]: Fall back on strerror if
1984 * path-concat.c (mempcpy): Don't define if a system header defines it.
1985 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1986 (longest_relative_suffix): New function.
1987 (path_concat): Use it. Assume first argument is not NULL.
1988 Port to DOS. Omit redundant separators.
1989 Report an error instead of returning NULL.
1990 Use mempcpy instead of memcpy.
1991 (xpath_concat): Remove: not declared or used.
1993 * same.h: Include <stdbool.h>
1994 (same_name): Return bool, not int.
1995 * same.c (same_name): Likewise.
1996 (errno): Don't declare; we assume C89 or better now.
1998 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1999 if not already defined.
2001 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
2002 * dup-safer.c (errno): Likewise.
2004 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
2006 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
2009 2004-08-03 Simon Josefsson <jas@extundo.com>
2011 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
2012 * progname.h: Don't include stdbool.h.
2014 2004-08-02 Simon Josefsson <jas@extundo.com>
2016 * getsubopt.h: New file, with comments from Bruno Haible.
2017 * getsubopt.c: New file, from glibc, but slightly modified based on
2018 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
2020 2004-08-01 Simon Josefsson <jas@extundo.com>
2022 * xgetdomainname.c: Include stdlib.h, for free().
2024 2004-07-16 Simon Josefsson <jas@extundo.com>
2026 * dummy.c: New file.
2028 2004-07-16 Bruno Haible <bruno@clisp.org>
2030 * backupfile.h: Add extern "C" for C++.
2031 * closeout.h: Likewise.
2032 * copy-file.h: Likewise.
2033 * findprog.h: Likewise.
2034 * full-write.h: Likewise.
2035 * pathname.h: Likewise.
2036 * progname.h: Likewise.
2037 * stpcpy.h: Likewise.
2038 * stpncpy.h: Likewise.
2039 * strcase.h: Likewise.
2040 * strstr.h: Likewise.
2041 * xalloc.h: Likewise.
2043 * mbswidth.h: Add extern "C" for C++.
2044 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
2046 2004-07-09 Simon Josefsson <jas@extundo.com>
2048 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
2049 failed without this.)
2051 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
2053 * fchown-stub.c: New file.
2055 2004-06-24 Jim Meyering <jim@meyering.net>
2057 * obstack.h (obstack_base): Cast to (void *), per documentation.
2059 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
2061 * argz.c, argz_.h: New files, which are autoupdated from libtool.
2063 2004-06-01 Jim Meyering <jim@meyering.net>
2065 * calloc.c: New file.
2067 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
2069 * getdate.y (yylex): Allow space between sign and number.
2070 Problem reported by Dan Jacobson.
2072 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
2073 and Jim Meyering <jim@meyering.net>
2075 Merge from coreutils CVS.
2077 * stat-macros.h: New file, with contents from file-type.h
2078 and coreutils' system.h.
2079 * file-type.c: Include "stat-macros.h".
2080 * file-type.h (file_type): Move all macro definitions to new file,
2083 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
2084 Wrap old code with this conditional.
2085 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
2086 function that does not dereference symlinks.
2087 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
2089 * xreadlink.c: Include xreadlink.h first, to catch .h file
2090 dependency problems.
2091 (xreadlink): Accept new arg SIZE, for efficiency.
2092 All decls and uses changed.
2093 * xreadlink.h: Include <stddef.h>, for size_t.
2095 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
2096 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
2098 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
2100 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
2102 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
2103 macros to be defined.
2104 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
2105 the allocator returns NULL because the requested size is zero.
2107 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
2109 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
2110 var. Add comment explaining why libc still defines it. This
2111 merges the following patch from glibc:
2112 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
2114 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
2116 * obstack.c (_obstack): Remove unused variable. It hasn't been
2117 present in glibc since revision 1.1 of this file.
2118 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
2119 obstack_alignment_mask, obstack_alloc, obstack_base,
2120 obstack_blank, obstack_blank_fast, obstack_chunk_size,
2121 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
2122 obstack_grow0, obstack_init, obstack_int_grow,
2123 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
2124 obstack_next_free, obstack_object_size, obstack_ptr_grow,
2125 obstack_ptr_grow_fast, obstack_room): Remove declarations of
2126 nonexistent functions.
2128 2004-05-17 Derek R. Price <derek@ximbiot.com>
2129 Paul Eggert <eggert@cs.ucla.edu>
2131 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
2133 2004-05-14 Bruno Haible <bruno@clisp.org>
2135 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
2136 that consists of a '.' followed by an empty digit string.
2137 Patch by Tor Lillqvist <tml@iki.fi>.
2139 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
2141 Port obstack to the AS/400, where pointers are 16 bytes wide and
2142 you cannot cast an integer to a valid pointer. This patch is
2143 currently waiting to be integrated into glibc; see
2144 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
2146 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
2147 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
2148 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
2149 (struct obstack): temp member is now a union of a pointer and
2150 an integer, instead of an integer. All integer uses changed.
2151 This does not affect the physical layout of struct obstack,
2152 except on hosts (like the AS/400) where the size or alignment of
2153 void * is greater than that of ptrdiff_t.
2154 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
2155 __STDC__)]: Store temporary in pointer member of union, not
2157 * obstack.c: Include <stddef.h>, for offsetof.
2158 (struct fooalign): Remove; it doesn't need a name.
2159 (union fooround): Change double to long double, and add void *.
2160 (DEFAULT_ALIGNMENT): Use offsetof to compute.
2161 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
2162 not a macro. Hence the values are always int; so remove all
2163 casts-to-int in uses.
2165 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
2166 Derek Price <derek@ximbiot.com>
2168 * alloca.c: Include <alloca.h>, to get our interface.
2169 * alloca_.h: Use __alloca on AIX, so that we don't have to
2170 include <alloca.h> first. Use C89 prototype for alloca; this
2171 requires including <stddef.h> for size_t. Use extern "C" if C++.
2172 Use #elif for simplicity, since we can assume C89 now.
2173 Don't try to source the system alloca.h since it will not be found
2174 and to prevent recursively including its replacement.
2175 * fnmatch.c: Include <alloca.h> instead of opencoding.
2176 * regex.c: Likewise.
2178 2004-05-16 Derek Price <derek@ximbiot.com>
2179 Paul Eggert <eggert@cs.ucla.edu>
2181 getline cleanup. This changes the getndelim2 API: both order of
2182 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
2185 * getline.c: Don't include stddef.h or stdio.h, since our
2186 interface does that.
2187 (getline): Always use getdelim, so that we don't have two
2188 copies of this code.
2189 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
2191 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
2192 (GETNDELIM2_MAXIMUM): New macro.
2193 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
2194 instead of the old practice of delim2==0. All callers changed.
2195 Return -1 on overflow, instead of returning junk.
2196 Do not set *linesize unless allocation succeeds.
2197 * getndelim2.h: Do not include stddef.h; no longer needed, now
2198 that we include sys/types.h.
2199 * getnline.h: Likewise.
2200 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
2201 (getndelim2): Reorder arguments.
2202 * getnline.c (getnline, getndelim):
2203 Don't discard the NMAX argument.
2204 (getnline): Invoke getndelim, to avoid code duplication.
2205 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
2206 of (size_t) -1 by callers of the getnline family.
2208 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
2210 * nanosleep.c (suspended): Change its type from int to
2211 sig_atomic_t volatile.
2212 (first_call): Make it private to rpl_nanosleep, and have it
2213 be zero initially as that's a bit faster.
2214 (my_usleep): Round up fractional times instead of truncating them,
2215 as this is the usual meaning for 'sleep'.
2217 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
2219 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
2220 (ENOSYS): Define if not defined.
2221 (settime): Fall back on stime if it exists and settimeofday fails.
2222 But don't bother with fallbacks if a method fails with errno == EPERM.
2224 2004-05-11 Jim Meyering <jim@meyering.net>
2226 Prior to this change, the save_cwd caller required read access to the
2227 current directory on most systems (ones with the fchdir function).
2229 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
2230 fails, try write-only, and finally, resort to using xgetcwd.
2232 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
2234 * obstack.c, obstack.h: Import changes from libc.
2236 2004-04-28 Bruno Haible <bruno@clisp.org>
2238 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
2239 implicitly appends .exe to executables.
2240 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
2241 accepts Windows pathnames.
2242 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2243 Cygwin like Windows, since it now accepts Windows pathnames.
2244 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2245 Cygwin like Windows, since it now accepts Windows pathnames.
2246 Reported by Derek Robert Price <derek@ximbiot.com>.
2248 2004-04-20 Jim Meyering <jim@meyering.net>
2250 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
2252 2004-04-20 Jim Meyering <jim@meyering.net>
2253 Bruno Haible <bruno@clisp.org>
2255 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
2256 memory when realloc fails.
2258 2004-04-18 Jim Meyering <jim@meyering.net>
2260 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
2261 don't leak memory and do call END_UTMP_ENT.
2263 2004-04-11 Paul Eggert <eggert@twinsun.com>
2265 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
2266 (CHAR_BIT): Remove, since we assume C89.
2267 Include <stdint.h> if available, as per current Autoconf CVS advice.
2269 2004-03-30 Paul Eggert <eggert@twinsun.com>
2271 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
2272 not bool, to be more consistent with Unix conventions.
2273 Suggested by Bruno Haible.
2275 Merge from coreutils.
2277 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
2280 * getdate.h: Include stdbool.h, and timespec.h instead of
2281 the usual <time.h> dance.
2282 (get_date): Change signature to support fractional time stamps.
2283 All callers changed.
2284 * getdate.y: Include "getdate.h" first, as we can now
2285 assume C89 and don't need to worry about 'const'.
2286 Similarly, include "unlocked-io.h" near start, not in middle.
2288 (textint.value): Use long int rather than int.
2289 (textint.digits): Use size_t rather than int.
2290 (BILLION, LOG10_BILLION): New constants.
2291 (parser_control): New member rel_ns. Members day_ordinal,
2292 time_zone, month, day, hour, minutes, rel_year, rel_month,
2293 rel_day, rel_hour, rel_minutes, rel_seconds
2294 are now long int, not int. Member seconds is now struct timespec,
2295 not int. New member timespec_seen. Members dates_seen, days_seen,
2296 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
2298 (%union.intval): Now long int, not int.
2299 New member timespec.
2300 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
2301 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
2302 (spec): Now is a timespec or an item list.
2303 (timespec, items): New nonterminals.
2304 (time, rel, relunit, number, get_date):
2305 Add support for fractional seconds.
2306 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
2307 (gmtime, localtime, mktime): Remove decls; not needed with C89.
2308 (to_hour): First arg is now long int, not int.
2309 (to_year): Returns long int, not int.
2310 Don't treat year -70 like 70.
2311 (tm_diff): Returns long int, not int.
2312 (lookup_word): Use bool instead of int when appropriate.
2313 (yylex): Use size_t for count, not int.
2314 Detect overflow when parsing large integer constants.
2315 Add support for fractions.
2316 (get_date): Make pointers 'const' if possible.
2317 Use more-portable code to detect integer overflow.
2318 (main) [TEST]: Adjust to above changes. Test for localtime failure.
2319 Don't use ctime; it's not reliable if the year has >4 digits.
2321 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
2322 This is for compatibility with BSD.
2324 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
2325 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
2326 From coreutils' system.h.
2328 * userspec.c: Don't include "posixver.h".
2329 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
2330 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
2331 compatible extension. Simplify code by removing a boolean int
2332 that was always nonzero if a string was nonnull.
2334 2004-03-30 Jim Meyering <jim@meyering.net>
2336 Merge from coreutils.
2338 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
2340 * readtokens.c (readtoken): Don't leak 64 bytes when reading
2341 an empty input stream.
2343 * readtokens.c: Include <stdbool.h>.
2344 (readtoken): Use `size_t' rather than int/long.
2345 All callers adjusted.
2346 Use `bool' rather than `int' where appropriate.
2347 Use memset rather than an explicit loop.
2348 Use x2nrealloc rather than xrealloc.
2349 Allow the use of `\0' as a delimiter.
2350 (readtokens): Likewise.
2351 * readtokens.h (readtoken, readtokens): Update prototypes.
2353 2004-03-30 Bruno Haible <bruno@clisp.org>
2355 * getloadavg.c (getloadavg): Don't assume setlocale returns
2358 2004-03-29 Paul Eggert <eggert@twinsun.com>
2360 Merge changes to getloadavg.c from coreutils and Emacs.
2362 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
2363 Define to an expression, not to the empty string.
2364 Include cloexec.h and xalloc.h.
2365 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
2366 Use set_cloexec_flag rather than rolling our own.
2367 * cloexec.c, cloexec.h: New files.
2369 2004-03-18 Paul Eggert <eggert@twinsun.com>
2371 * getopt.h: Sync with libc CVS.
2373 2004-03-18 Paul Eggert <eggert@twinsun.com>
2374 Bruno Haible <bruno@clisp.org>
2376 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
2377 not on all platforms that have <wchar.h>.
2378 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2380 2004-03-09 Paul Eggert <eggert@twinsun.com>
2382 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
2384 * getopt_int.h: New file, also synced from libc.
2386 2004-03-07 Paul Eggert <eggert@twinsun.com>
2388 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
2389 '#if' expressions. Unlike the code it replaces, it does not
2390 depend on (defined _SC_PAGESIZE). However, it does depend on
2391 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
2392 first reported by Jason Andrade in
2393 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
2395 2004-01-18 Simon Josefsson <jas@extundo.com>
2397 * strdup.h: New file.
2398 * strdup.c: Include it.
2399 * path-concat.c: Include strdup.h. Drop strdup declaration.
2400 * userspec.c: Include strdup.h. Drop strdup declaration.
2402 2004-02-06 Karl Berry <karl@gnu.org>
2404 * config.charset: update from gettext 0.14.1.
2406 2004-02-05 Paul Eggert <eggert@twinsun.com>
2408 Add comments and code, prompted by suggestions from Bruno Haible
2410 * quotearg.h (quotearg_alloc): New decl. Improve the comments
2411 describing the enum quoting_style values.
2412 * quotearg.c (quotearg_alloc): New function.
2413 (quotearg_buffer_restyled): Treat lone { and } as special.
2414 Treat = as special. Work around bug with older shells
2415 that "see" a '\' that is really the 2nd byte of a multibyte char.
2416 Quote empty string with shell_quoting_style.
2418 2004-02-03 Bruno Haible <bruno@clisp.org>
2420 * pipe.h: New file, from GNU gettext.
2421 * pipe.c: New file, from GNU gettext.
2423 2004-01-27 Bruno Haible <bruno@clisp.org>
2425 * execute.h: New file, from GNU gettext.
2426 * execute.c: New file, from GNU gettext.
2427 * w32spawn.h: New file, from GNU gettext.
2429 2004-01-23 Paul Eggert <eggert@twinsun.com>
2431 Exit-status fix from coreutils.
2433 Use exit_failure consistently in place of EXIT_FAILURE,
2434 so that program exit statuses are consistent on failure.
2436 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2437 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2438 * argmatch.h: Comment fix to match the above.
2439 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2440 Now a macro referring to exit_failure, instead of a separate
2441 variable. Include "exitfail.h" to get it.
2442 * xstrtol.h: Include "exitfail.h".
2443 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2445 * long-options.c (parse_long_options): Use prototype
2446 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2449 2004-01-21 Jim Meyering <jim@meyering.net>
2451 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2452 so as not to conflict with a different-sized __mktime_internal
2453 function in GNU libc.
2454 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2455 Problem building statically-linked `ls' reported by Michael Brunnbauer.
2457 2004-01-18 Paul Eggert <eggert@twinsun.com>
2459 Merge from diffutils.
2461 * file-type.c (file_type): Add typed memory objects.
2462 * file-type.h (S_TYPEISTMO): New macro.
2464 * c-stack.h (c_stack_action): Remove argv argument.
2465 * c-stack.c (c_stack_action): Likewise. All uses changed.
2466 (die): Don't calculate message unless segv_action returns.
2467 (get_stack_location, min_address_from_argv, max_address_from_argv,
2468 volatile stack_base, volatile_stack_size): Remove.
2469 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2470 that every segmentation violation is a stack overflow. (Ouch!)
2471 See Debian bug 136249 (still outstanding) for more info about why
2472 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2474 2003-11-30 Bruno Haible <bruno@clisp.org>
2476 Safer stack allocation.
2477 * setenv.c: Include allocsa.h.
2478 (alloca): Remove fallback definition.
2479 (freea): Remove macro.
2480 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2483 2003-10-17 Bruno Haible <bruno@clisp.org>
2485 * binary-io.h: Avoid warnings on Cygwin.
2487 2003-12-28 Bruno Haible <bruno@clisp.org>
2489 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2490 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2492 2003-11-28 Bruno Haible <bruno@clisp.org>
2494 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2496 2003-11-27 Bruno Haible <bruno@clisp.org>
2498 * wait-process.c: On Windows, include windows.h. Needed on mingw.
2500 2003-11-17 Bruno Haible <bruno@clisp.org>
2502 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2504 2003-11-24 Bruno Haible <bruno@clisp.org>
2506 * xallocsa.h: New file, from GNU gettext.
2507 * xallocsa.c: New file, from GNU gettext.
2509 2003-11-24 Bruno Haible <bruno@clisp.org>
2511 * allocsa.h: New file, from GNU gettext.
2512 * allocsa.c: New file, from GNU gettext.
2514 2003-11-24 Bruno Haible <bruno@clisp.org>
2516 * eealloc.h: New file.
2518 2004-01-15 Jim Meyering <jim@meyering.net>
2520 Merge from coreutils.
2522 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2523 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2524 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2526 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2527 optional configure-time default.
2529 * version-etc.c (version_etc_copyright): Update copyright date.
2531 * xreadlink.c (xreadlink): Correct outdated comment.
2533 2004-01-15 Paul Eggert <eggert@twinsun.com>
2535 Merge from coreutils.
2537 * posixver.c: Include posixver.h.
2539 * same.c: Include <stdbool.h>, <limits.h>.
2540 (_POSIX_NAME_MAX): Define if not defined.
2542 (same_name): If file names are silently truncated, report
2543 that the file names are the same if they are the same after
2544 the silent truncation.
2546 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2547 conversion function.
2548 * xstrtod.c (xstrtod): Likewise. All callers changed to
2549 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2552 2004-01-14 Paul Eggert <eggert@twinsun.com>
2554 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2555 with like-named macro in fnmatch.c.
2556 (EXT): Use an internal constant instead.
2558 Merge fnmatch patches from glibc.
2559 * fnmatch.c (mbsinit): Remove define.
2560 Add libc_hidden_ver (__fnmatch, fnmatch).
2561 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2562 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2564 2003-12-14 Karl Berry <karl@gnu.org>
2566 * config.charset: update from gettext-runtime.
2568 2003-12-03 Paul Eggert <eggert@twinsun.com>
2570 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2571 Bug reported by Alfred M. Szmidt.
2573 2003-11-29 Karl Berry <karl@gnu.org>
2575 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2577 2003-11-23 Paul Eggert <eggert@twinsun.com>
2578 Bruno Haible <bruno@clisp.org>
2580 * printf-parse.h: Don't include sys/types.h.
2581 (ARG_NONE): New macro.
2582 (char_directive): Change type of *arg_index fields to size_t.
2583 * printf-parse.c: Don't include sys/types.h.
2584 (SSIZE_MAX): Remove macro.
2585 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2586 Remove unnecessary overflow check.
2587 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2590 2003-11-24 Paul Eggert <eggert@twinsun.com>
2592 * alloca.c: Remove dependency on xalloc module.
2593 (xalloc_die): Remove.
2594 (memory_full) [!defined emacs]: New macro.
2595 [!defined emacs]: Don't include xalloc.h.
2596 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2597 address arithmetic overflows. Change datatypes a bit to avoid
2600 2003-11-22 Jim Meyering <jim@meyering.net>
2602 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2604 2003-11-17 Bruno Haible <bruno@clisp.org>
2606 * vasnprintf.c (alloca): Remove fallback definition.
2607 (freea): Remove definition.
2608 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2609 Reported by Paul Eggert.
2611 2003-11-17 Jim Meyering <jim@meyering.net>
2613 On systems without utime and without a utimes function capable of
2614 dealing with a NULL struct utimbuf* argument, this utime replacement
2615 could -- in unusual circumstances -- leak a file descriptor.
2616 * utime.c: Include <unistd.h> and <errno.h>.
2617 (utime_null): Be sure to close `fd' and to preserve errno.
2618 Reported by Geoff Collyer via Arnold Robbins.
2620 2003-11-16 Paul Eggert <eggert@twinsun.com>
2621 Bruno Haible <bruno@clisp.org>
2623 Protect against address arithmetic overflow.
2624 * printf-args.h: Include stddef.h.
2625 (arguments): Change type of field 'count' to size_t.
2626 * printf-args.c (printf_fetchargs): Use size_t instead of
2627 'unsigned int' where appropriate.
2628 * printf-parse.h: Include sys/types.h.
2629 (char_directive): Change type of *arg_index fields to ssize_t.
2630 (char_directives): Change type of fields 'count', max_*_length to
2632 * printf-parse.c: Include sys/types.h and xsize.h.
2633 (SSIZE_MAX): Define fallback value.
2634 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2635 instead of 'int' where appropriate. Check a_allocated, d_allocated
2636 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2637 * vasnprintf.c: Include xsize.h.
2638 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2639 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2640 overflow. Avoid wraparound when converting a width or precision from
2643 2003-11-16 Bruno Haible <bruno@clisp.org>
2645 Update from GNU gettext.
2646 * printf-parse.c: Generalize to it can be compiled for wide strings.
2647 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2648 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2649 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2650 SNPRINTF): New macros.
2651 Don't include <alloca.h> if the file is used inside libintl.
2652 (local_wcslen): New function, for Solaris 2.5.1.
2653 (VASNPRINTF): Use it instead of wcslen.
2655 2003-11-16 Bruno Haible <bruno@clisp.org>
2657 * xsize.h (xmax): New function.
2658 (xsum, xsum3, xsum4): Declare as "pure" functions.
2660 2003-11-12 Paul Eggert <eggert@twinsun.com>
2662 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2663 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2664 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2665 heuristic is just as accurate as far as we know, and it removes a
2666 dependency on size_max.m4 and ptrdiff_max.m4.
2668 2003-11-12 Paul Eggert <eggert@twinsun.com>
2670 * xstrtol.c (__xstrtol): Remove "break" immediately after
2671 "return", to pacify some unknown compiler. Problem reported
2674 2003-11-11 Bruno Haible <bruno@clisp.org>
2676 * xsize.h (SIZE_MAX): Remove fallback definition.
2677 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2680 2003-11-10 Paul Eggert <eggert@twinsun.com>
2682 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2683 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2684 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2686 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2687 not (size_t) -1, since it's defined here.
2689 2003-11-06 Paul Eggert <eggert@twinsun.com>
2691 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2692 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2693 Reject sizes of exactly SIZE_MAX bytes.
2694 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2695 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2697 2003-11-05 Bruno Haible <bruno@clisp.org>
2699 * xsize.h: Include limits.h, to avoid a possible collision with
2700 SIZE_MAX defined in <limits.h> on Solaris.
2702 2003-11-04 Bruno Haible <bruno@clisp.org>
2704 * xsize.h: New file.
2705 * linebreak.c: Include xsize.h.
2706 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2707 argument for overflow.
2708 Suggested by Paul Eggert.
2710 2003-10-31 Bruno Haible <bruno@clisp.org>
2712 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2713 to avoid (extremely rare) race condition.
2714 Suggested by Paul Eggert.
2716 2003-11-03 Jim Meyering <jim@meyering.net>
2718 * userspec.c: Include "userspec.h".
2719 * userspec.h: New file.
2721 2003-10-31 Paul Eggert <eggert@twinsun.com>
2723 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2724 * mountlist.c (SIZE_MAX): Define if not defined already.
2725 (read_filesystem_list): Set and use me_type_malloced.
2726 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2727 whatever the type happens to be), for brevity and consistency.
2728 Check for size calculation overflow on Alphas running OSF/1.
2730 2003-10-31 Jim Meyering <jim@meyering.net>
2732 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2734 * linebuffer.c: Include <string.h> for declaration of memset.
2736 2003-10-30 Paul Eggert <eggert@twinsun.com>
2737 Bruno Haible <bruno@clisp.org>
2739 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2740 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2742 2003-10-29 Paul Eggert <eggert@twinsun.com>
2744 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2745 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2747 * quotearg.c (quotearg_n_options): Use it.
2748 * group-member.c: Include <stdbool.h>.
2749 (free_group_info): Arg is now const *; don't free arg.
2750 (get_group_info): Now returns bool and accepts struct group_info *,
2751 rather than returning a malloc'ed struct group_info *.
2752 All uses changed. Check for overflow in internal size calculation.
2754 * getusershell.c (readname): Simplify the code by using x2nrealloc
2755 rather than xmalloc/xrealloc.
2756 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2757 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2758 conformance bug: the old code used a pointer after freeing the
2759 storage that it addressed.
2760 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2761 rather than doing it by hand.
2762 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2763 the buffer preserved. Use free and xmalloc instead.
2764 * quotearg.c (quotearg_n_options): Likewise.
2765 Use a simpler test for size overflow. Don't use xalloc_oversized
2766 because unsigned int might be wider than size_t (!); this suggests
2767 that we should switch from unsigned int to size_t for slot numbers.
2769 2003-10-27 Bruno Haible <bruno@clisp.org>
2771 * stdbool_.h: Better support for BeOS.
2773 2003-10-27 Paul Eggert <eggert@twinsun.com>
2775 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2776 to allocate the returned structure. Do not allocate a subarray,
2777 as x2nrealloc will do that.
2778 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2779 instead of xnrealloc.
2780 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2782 2003-10-26 Paul Eggert <eggert@twinsun.com>
2784 * xalloc.h (xalloc_oversized): New static inline function, for
2785 callers that want to do their own size-overflow checking. Include
2786 <stdbool.h>, since xalloc_oversized returns bool.
2787 * xalloc.c (array_size_overflow): Remove. All callers changed
2788 to use xalloc_oversized.
2790 Add two functions x2realloc, x2nrealloc, for programs that grow
2791 arrays dynamically by doubling their sizes.
2792 * xalloc.h (x2realloc, x2nrealloc): New decls.
2793 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2796 Port to C99 semantics for 'inline' of external functions.
2797 Bug reported by Bruno Haible.
2798 * xmalloc.c (xnmalloc_inline): New static inline function,
2799 with the old contents of xnmalloc.
2800 (xnmalloc, xmalloc): Use it.
2801 (xnrealloc_inline): New static inline function,
2802 with the old contents of xnrealloc.
2803 (xnrealloc, xrealloc): Use it.
2805 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2807 2003-10-25 Paul Eggert <eggert@twinsun.com>
2809 Fix several address-calculation bugs in the hash modules,
2810 plus some minor code cleanup.
2812 * hash.h: Include <stdbool.h>, for bool.
2813 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2814 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2815 hash_get_n_entries, hash_get_max_bucket_length,
2816 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2817 hash_rehash): Use size_t rather than unsigned.
2818 * hash.c (struct hash_table, hash_get_n_buckets,
2819 hash_get_n_buckets_used, hash_get_n_entries,
2820 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2821 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2822 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2824 (SIZE_MAX): Define if not defined.
2825 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2826 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2828 Use const * when possible.
2829 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2830 (check_tuning): Fix bug: if tuning parameters were very close to
2831 0 or 1, rounding errors could have caused subscript violations.
2832 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2833 (hash_initialize): Add 'fail:' label
2834 to free table and return NULL, and use it to simplify code.
2835 Use calloc rather than clearing the storage ourself.
2836 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2837 buffer size calculations.
2838 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2839 Include <stddef.h>, for size_t.
2840 * hash-pjw.c (hash_pjw): Likewise.
2841 Switch to method described by Bruno Haible.
2842 Include <limits.h>, for CHAR_BIT.
2843 (SIZE_BITS): New macro.
2845 2003-10-21 Paul Eggert <eggert@twinsun.com>
2847 * getndelim2.c (getndelim2): When size calculation overflows,
2848 ceiling the allocation at NMAX bytes rather than silently
2849 discarding input bytes before NMAX is reached. This makes
2850 a difference only if NMAX exceeds SIZE_MAX / 2.
2852 * obstack.c: Merge from glibc.
2853 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2854 Add libc_hidden_def (_obstack_newchunk).
2855 (_obstack_free) [! defined _LIBC]: Remove.
2856 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2857 a clone of the function body.
2858 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2859 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2861 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2862 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2865 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2866 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2867 Don't use lvalue casts, as GCC plans to remove support for them
2868 in GCC 3.5. Reported by Joseph S. Myers. This bug
2869 was also present in the non-GCC version, indicating that this
2870 code had always been buggy and had never been widely used.
2871 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2872 Use the fast variant of each macro, rather than copying the
2873 definiens of the fast variant; that way, we'll be more likely to
2874 catch future bugs in the fast variants.
2876 2003-10-20 Bruno Haible <bruno@clisp.org>
2878 * wait-process.h: New file, from GNU gettext.
2879 * wait-process.c: New file, from GNU gettext.
2881 2003-10-19 Jim Meyering <jim@meyering.net>
2883 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2885 2003-10-16 Paul Eggert <eggert@twinsun.com>
2887 * getgroups.c: Include <errno.h>, <stdlib.h>.
2888 (getgroups): First arg is int, not size_t.
2889 Don't let 'free' mangle errno.
2891 2003-10-16 Jim Meyering <jim@meyering.net>
2893 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2895 2003-10-15 Paul Eggert <eggert@twinsun.com>
2897 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2899 (new_exclude, add_exclude_file): Initial size no longer needs to
2901 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2902 our own address arithmetic overflow checking.
2904 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2905 (fnmatch): Do not alloca more than 2000 wide characters;
2906 instead, use malloc for large buffers.
2907 Check for address arithmetic overflow, and return -1
2908 with errno set to ENOMEM in that case.
2909 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2910 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2911 instead, return -1. Check for address arithmetic overflow.
2913 2003-10-14 Paul Eggert <eggert@twinsun.com>
2915 Handle invalid suffixes and overflow independently, so that
2916 callers can treat them independently as needed. Fix some bugs in
2917 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2918 suffix for a human-readable blocksize. The major caller-visible
2919 change is the addition of a new
2920 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2921 that both overflow and suffix chars were found.
2923 * human.c (humblock): Don't check separately for invalid suffix
2924 char; that is xstrtoumax's job (now that its bug is fixed).
2925 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2926 INTMAX_MAX]: New macros.
2927 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2928 TYPE_MAXIMUM): New macros.
2929 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2930 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2931 if overflow occurs, as it's what __strtol does and it's more useful
2933 (__xstrtol): If __strtol reports some error other than ERANGE,
2934 reflect it to the caller as LONGINT_INVALID. If it reports
2935 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2936 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2937 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2939 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2940 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2941 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2942 [defined UINTMAX_MAX]: New macros.
2944 2003-10-14 Bruno Haible <bruno@clisp.org>
2946 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2947 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2948 Also use volatile where needed.
2950 2003-10-12 Paul Eggert <eggert@twinsun.com>
2952 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2953 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2954 and define in terms of the other primitives.
2955 * xmalloc.c: Include stdbool.h; do not include exit.h.
2956 (SIZE_MAX): Define if not already defined.
2957 (array_size_overflow): New function.
2958 (xalloc_die): Abort instead of exiting if 'error' returns.
2959 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2960 (xmalloc, xrealloc): Use them.
2961 (xcalloc): Check for address arithmetic overflow.
2962 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2963 a bit faster than strcpy.
2965 2003-10-08 Paul Eggert <eggert@twinsun.com>
2967 Merge getpass from libc, plus a few fixes.
2969 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2970 Include <stdbool.h>.
2971 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2972 __fsetlocking to empty.
2973 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2974 do include <bits/libc-lock.h>.
2975 Do not include <fcntl.h>; not needed.
2976 [_LIBC]: Include <wchar.h>.
2977 (NOTCANCEL_MODE): New macro.
2978 (flockfile, funlockfile) [_LIBC]: New macros.
2979 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2980 [!_LIBC]: New macros.
2981 (call_fclose): New function.
2982 (getpass): Use it. Save tty stream separately; this simplifies the
2983 code and makes it more reliable if stdin happens to equal stdout.
2984 Invoke __fsetlocking on tty.
2985 Handle thread cancellation if needed.
2986 Namespace cleanup (use __tcgetattr, __getline).
2987 Use bool for Booleans.
2988 [USE_IN_LIBIO]: Handle wide streams.
2989 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2990 stream might go where.
2992 * unlocked-io.h: Include <stdio.h>, so that the caller
2993 doesn't have to include <stdio.h> before us.
2994 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2995 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2996 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2997 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2998 if not declared, so that we can use getpass.c code from libc without
3000 (flockfile, ftrylockfile, funlockfile): New macros.
3002 2003-10-06 Bruno Haible <bruno@clisp.org>
3004 * version-etc-2.h: Remove file.
3005 * version-etc-2.c: Remove file.
3007 2003-09-25 Jim Meyering <jim@meyering.net>
3008 Bruno Haible <bruno@clisp.org>
3010 This lets translators provide better translations for the
3011 "Written by ..." part of --version output.
3012 * version-etc.h: Include stdarg.h.
3013 (version_etc_copyright): Declare as readonly.
3014 (version_etc): Make this function variadic with a NULL-terminated list
3015 of author name strings.
3016 (version_etc_va): New declaration.
3017 * version-etc.c: Include stdarg.h, stdlib.h.
3018 (version_etc_copyright): Declare as readonly.
3019 (version_etc_va): New function. Provide a different translatable string
3020 for each possible number of authors < 10. Abbreviate when there are 10
3022 (version_etc): Make this function variadic. Call version_etc_va.
3023 Suggestion from Gary V. Vaughan.
3025 * long-options.h (parse_long_options): Change prototype: the authors
3026 string is moved to the end and becomes variadic.
3027 * long-options.c: Include stdarg.h.
3028 (parse_long_options): Make this function variadic, too.
3029 Call version_etc_va, not version_etc.
3031 2003-10-06 Bruno Haible <bruno@clisp.org>
3033 * fatal-signal.h: New file, from GNU gettext.
3034 * fatal-signal.c: New file, from GNU gettext.
3036 2003-10-04 Karl Berry <karl@gnu.org>
3038 * argp*: update from libc.
3040 2003-10-01 Larry Jones <lawrence.jones@eds.com>
3042 * getpass.c (getpass): Use a no-op fseek when switching from input to
3043 output mode on the same stream.
3045 2003-09-29 Paul Eggert <eggert@twinsun.com>
3047 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
3048 Fix arg typo in previous patch.
3050 2003-09-28 Jim Meyering <jim@meyering.net>
3052 * error.c: Correct cpp indentation.
3054 2003-09-27 Paul Eggert <eggert@twinsun.com>
3056 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
3057 Omit the special code that used __typeof__, since we worry that
3058 it could be more trouble than it's worth. See:
3059 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
3060 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
3064 2003-09-26 Jim Meyering <jim@meyering.net>
3066 * error.c (error_tail): Move some declarations
3067 into inner scope where the local variables are used.
3069 2003-09-26 Bruno Haible <bruno@clisp.org>
3071 * stpncpy.h (gnu_stpncpy): New declaration.
3072 (stpncpy): Define as alias for gnu_stpncpy.
3073 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
3075 2003-09-26 Paul Eggert <eggert@twinsun.com>
3077 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
3078 (error_tail): Do not loop, reallocating temporary buffer, since
3079 the output cannot contain more wide characters than the input
3080 contains bytes, the size must be big enough already. This avoids
3081 one potential size overflow calculation. Check for size overflow
3082 when calculating temporary buffer size. Free temporary buffer
3083 when done, if it was allocated with malloc; this plugs a memory
3084 leak. Remove casts from void * to pointers, that are no longer
3085 needed now that we're assuming C89 or better.
3087 Merge error changes from glibc.
3089 * error.c, error.h: Update copyright notice header to match glibc.
3090 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
3091 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
3092 Disable cancellation while printing error.
3093 * error.h: Prepend __ to parameter names.
3095 2003-09-25 Karl Berry <karl@gnu.org>
3097 * argp-fmtstream.c, argp-help.c: update from libc.
3099 2003-09-25 Bruno Haible <bruno@clisp.org>
3101 * version-etc-2.h: New file, from version-etc.h with modifications.
3102 * version-etc-2.c: New file, from version-etc.c with modifications.
3104 2003-09-25 Simon Josefsson <jas@extundo.com>
3106 * xgetdomainname.h: New file.
3107 * xgetdomainname.c: New file.
3109 2003-09-25 Simon Josefsson <jas@extundo.com>
3110 Bruno Haible <bruno@clisp.org>
3112 * getdomainname.h: New file.
3113 * getdomainname.c: New file.
3115 2003-09-24 Paul Eggert <eggert@twinsun.com>
3117 * linebuffer.c (freebuffer): Don't free the argument, just
3118 the buffer associated with the argument. Bug reported by
3121 2003-09-19 Karl Berry <karl@gnu.org>
3123 * argp.h: update from libc.
3125 2003-09-16 Paul Eggert <eggert@twinsun.com>
3127 * linebuffer.c (readlinebuffer): Return NULL immediately upon
3128 input error, instead of returning NULL the next time we are called
3129 (and therefore losing track of errno).
3131 2003-09-15 Paul Eggert <eggert@twinsun.com>
3133 * getndelim2.c (getndelim2): Don't trash errno when a read
3134 fails, so that the caller gets the proper errno.
3136 * readutmp.c (read_utmp): Likewise.
3137 Check for fstat error. Close stream and free storage
3140 2003-09-14 Bruno Haible <bruno@clisp.org>
3142 * fwriteerror.h: New file.
3143 * fwriteerror.c: New file.
3145 2003-09-14 Jim Meyering <jim@meyering.net>
3147 * getloadavg.c: Correct cpp indentation.
3148 * strdup.c: Likewise.
3149 * vasnprintf.c: Likewise.
3151 2003-09-12 Paul Eggert <eggert@twinsun.com>
3153 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
3154 * obstack.c [!defined _LIBC]: Likewise.
3155 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
3156 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
3157 * exitfail.c: Don't include stdlib.h; no longer needed.
3159 More changes to assume C89 or better.
3161 * error.c (error_tail): Assume vprintf.
3163 * argmatch.c (getenv): Remove decl.
3164 * progreloc.c (get_full_program_name): Define via prototype.
3165 * setenv.c (clearenv): Likewise.
3166 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
3168 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
3169 (malloc, memcpy): Remove decls.
3170 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
3171 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
3172 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
3173 (memcpy): Remove macro.
3174 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
3175 (__P): Remove. All uses removed.
3176 (PTR): Remove. All uses changed to void *.
3177 (CHAR_BIT, NULL): Remove.
3178 (spaces, zeros, memset_space, memset_zero)
3179 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
3181 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
3182 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
3183 Define with prototype.
3184 Remove now-unnecessary prototype decl.
3185 (extra_args_spec): Assume ANSI C. All uses changed.
3186 (extra_args_spec_iso): Remove.
3187 (my_strftime, emacs_strftimeu): Define via prototype.
3188 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
3190 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
3191 * strtoimax.c: Include <stdlib.h> unconditionally.
3192 (strtoul, strtol): Remove decls.
3193 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
3195 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
3196 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
3197 (LOCALE_PARAM_PROTO): New macro.
3198 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
3199 (INTERNAL (strtol), strtol): Define with a prototype.
3200 (PARAMS): Remove. All uses removed.
3201 * tempname.c: Include <string.h> unconditionally.
3202 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
3203 * xgethostname.c (main): Define with a prototype.
3204 * xmalloc.c: Include "xalloc.h" first, to check interface.
3205 Include <stdlib.h> unconditionally.
3206 (calloc, malloc, realloc, free): Remove decls.
3207 * xstrtod.c: Include "xstrtod.h" first, to check interface.
3208 Include <stdlib.h> unconditionally. Sort include file names.
3210 (xstrtod): Define with a prototype.
3211 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
3212 (strtol, strtoul): Remove decls.
3214 2003-09-11 Paul Eggert <eggert@twinsun.com>
3216 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
3217 Include <stdlib.h>, <string.h> unconditionally.
3218 Remove now-unnecessary cast to char *.
3219 * strnlen.c: Include <string.h> unconditionally.
3220 * yesno.c (yesno): Define with a prototype.
3222 2003-09-10 Bruno Haible <bruno@clisp.org>
3224 * strcspn.c: Include <string.h> unconditionally.
3225 * strpbrk.c: Include <string.h> unconditionally.
3226 * strstr.c: Include <string.h> unconditionally.
3227 * unicodeio.c: Include <string.h> unconditionally.
3228 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
3229 * unsetenv.c: Likewise.
3230 * xreadlink.c: Include <stdlib.h> unconditionally.
3231 * yesno.c: Include <stdlib.h> unconditionally.
3232 (rpmatch): Add prototype.
3234 2003-09-10 Jim Meyering <jim@meyering.net>
3236 * error.c: Correct indentation of cpp directives.
3238 2003-09-09 Paul Eggert <eggert@twinsun.com>
3242 * acosl.c (main): Use a prototype.
3243 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
3246 * getloadavg.c (getloadavg, main): Define via prototypes.
3248 * getopt.h (struct option.name): Assume C89, and use 'const'.
3249 (getopt, etopt_long, getopt_long_only, _getopt_internal)
3250 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
3252 * getopt.c (const): Remove macro.
3253 Include <string.h> unconditionally.
3254 (my_index): Remove; all uses changed to strchr.
3255 (strlen): Remove decl.
3256 (exchange): Remove forward decl; no longer needed.
3257 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
3258 Define with prototype.
3259 * getopt1.c (const): Remove macro.
3260 (getopt_long, getopt_long_only, main): Define with prototype.
3262 * getugroups.c: Include <string.h> unconditionally.
3264 * getusershell.c: Include <stdlib.h> unconditionally.
3265 (getusershell, setusershell, endusershell, readname, main):
3266 Define with prototypes.
3268 * group-member.c: Include group-member.h first.
3269 Include <stdlib.h> unconditionally.
3271 * hard-locale.c: Include hard-locale.h first.
3272 Include <stdlib.h>, <string.h> unconditionally.
3274 * hash.c (free, malloc): Remove decls.
3275 Include <stdlib.h> unconditionally.
3277 * human.c: Include <stdlib.h>, <string.h> unconditionally.
3278 (getenv): Do not declare.
3280 * idcache.c: Include <string.h> unconditionally.
3282 * long-options.c: Include long-options.h first, to test interface.
3283 Include <stdlib.h> unconditionally.
3285 * makepath.c: Include makepath.h first, to test interface.
3286 Include <stdlib.h> and <string.h> unconditionally.
3288 * linebuffer.c: Include <stdlib.h>.
3289 (free): Remove decl.
3291 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
3292 rpl_malloc returns void *, not char *.
3293 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
3295 * md5.h: Include <limits.h> unconditionally.
3296 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
3297 (__P): Remove; all uses removed.
3298 * md5.c: Include "md5.h" first.
3299 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
3300 md5_buffer, md5_process_bytes, md5_process_block):
3301 Define with prototypes.
3302 * sha.h (__P): Remove all uses. (It wasn't defined??)
3303 * sha.c: Include "sha.h" first.
3304 Include <stdlib.h>, <string.h> unconditionally.
3306 * memchr.c (__ptr_t): Remove; all uses changed to void *.
3307 * memcmp.c (__ptr_t): Likewise.
3308 * memrchr.c (__ptr_t): Likewise.
3309 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
3310 Include <string.h> unconditionally.
3311 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
3312 * memchr.c: Include <stdlib.h> unconditionally.
3313 * memchr.c (LONG_MAX): Remove.
3314 * memrchr.c (LONG_MAX): Likewise.
3315 * memchr.c (__memchr): Define via a prototype.
3316 * memrchr.c (__memrchr): Likewise.
3317 * memcmp.c (__P): Remove, and remove all uses.
3318 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
3319 Remove forward decls; no longer needed.
3320 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
3321 Use types required by C89 in prototype.
3323 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
3324 * savedir.c: Likewise.
3325 * mkdir.c (free): Remove decl.
3326 * rmdir.c (rmdir): Define with a prototype.
3327 * savedir.c: Include savedir.h first, to test interface.
3329 * mktime.c (STDC_HEADERS): Remove.
3330 Include <stdlib.h>, <string.h> unconditionally.
3332 * modechange.c: Include <stdlib.h> unconditionally.
3333 (malloc): Remove decl.
3335 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
3336 (free): Remove decl.
3338 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
3339 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
3340 (This type really should be intptr_t, but that's a C99ism.)
3341 (_obstack_memcpy): Remove: all uses changed to memcpy.
3342 Include <string.h> unconditionally.
3343 (struct obstack): Assume __STDC__ for types of members
3344 chunkfun, freefun, extra_arg.
3345 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
3346 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
3347 obstack_begin, obstack_specify_allocation,
3348 obstack_specify_allocation_with_arg, obstack_chunkfun,
3349 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
3350 Remove unprototyped decls and the macros that use them.
3351 * obstack.c (POINTER): Remove. All uses changed to void *.
3352 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
3353 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
3354 (defined __STDC__ && __STDC__)]:
3355 Remove nonprototyped code.
3356 Include <stdlib.h> unconditionally.
3357 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
3358 _obstack_allocated_p, _obstack_free, obstack_free,
3359 _obstack_memory_used, print_and_abort):
3360 Define using prototypes.
3361 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
3362 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
3363 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
3364 obstack_next_free, obstack_object_size, obstack_room) [0]:
3365 Remove unused, unprototyped code.
3367 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
3369 * physmem.c (physmem_total, physmem_available, main): Define
3372 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
3373 (main): Define with a prototype.
3375 * posixver.c (getenv): Remove decl.
3377 * putenv.c (malloc): Returns void *, not char *.
3378 Include <string.h> unconditionally.
3379 (strchr, memcpy, NULL): Do not define.
3381 * readtokens.c: Include readtokens.h first, to test interface.
3382 Include <stdlib.h>, <string.h> unconditionally.
3383 (init_tokenbuffer): Define with a prototype.
3385 * regex.c (PARAMS): Remove. All uses removed.
3386 All uses of _RE_ARGS removed, too.
3387 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3389 (bzero): Assume memset exists.
3390 (memcmp, memcpy, NULL): Remove.
3391 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
3392 char, or assignments to local vars of type signed char.
3393 (init_syntax_once, PREFIX(extract_number_and_incr),
3394 PREFIX(print_partial_compiled_pattern),
3395 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
3396 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
3397 PREFIX(regex_grow_registers), PREFIX(regex_compile),
3398 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
3399 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
3400 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
3401 wcs_compile_range, byte_compile_range, truncate_wchar,
3402 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
3403 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
3404 count_mbs_length, wcs_re_match_2_internal,
3405 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3406 PREFIX(alt_match_null_string_p),
3407 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3408 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3409 regfree, PREFIX(extract_number)): Define with prototype. Remove
3410 now-unnecessary declaration, if any.
3411 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3413 Remove now-unnecessary casts among pointer types.
3414 * regex.h (_RE_ARGS): Remove. All uses removed.
3416 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3417 (free): Remove decl.
3419 * rpmatch.c: Include <stdlib.h> unconditionally.
3421 * same.c: Include <stdlib.h>, <string.h> unconditionally.
3422 (free): Remove decl.
3424 * save-cwd.c: Include <stdlib.h> unconditionally.
3425 * xgetcwd.c: Likewise.
3427 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3428 (free): Remove decl.
3430 * strchrnul.c (strchrnul): Define with a prototype.
3431 Fix bug: c_in was not converted to char before searching.
3433 The following changes are not K&R related:
3435 * group-member.h: Include <sys/types.h>, so that this file is
3437 * makepath.h: Likewise.
3439 * getusershell.c (readname, default_index, line_size, readname):
3440 Use size_t, not int, for sizes.
3441 (readname): If the size overflows, report an error instead of
3444 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3446 * getndelim2.c: Assume stdlib.h per the C89 spec.
3448 2003-09-08 Paul Eggert <eggert@twinsun.com>
3450 Assume C89 or better; remove K&R cruft.
3451 A few of these changes were first proposed by Derek Robert Price
3452 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3454 * addext.c: Include <string.h> unconditionally.
3455 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3456 Don't declare getenv or malloc.
3458 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3459 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3461 (find_stack_direction, alloca): Use prototypes.
3463 * atexit.c (atexit): Define using a prototype.
3465 * basename.c, dirname.c, stripslash.c:
3466 Include <string.h> unconditionally.
3468 * bcopy.c: Include <stddef.h>.
3469 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3471 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3473 * error.h (error, error_at_line, error_print_progname)
3474 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3475 * error.c: Include error.h first, to check interface.
3476 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3477 (VA_START): Remove; all uses changeed to va_start.
3478 (exit, strerror): Remove decls.
3479 (error_print_progname): Prototype uncondionally.
3480 Don't include <errno.h>; no longer needed.
3481 (private_strerror): Remove.
3482 (error_tail): Always define.
3483 (error, error_at_line): Assume C89 or better; always use prototypes.
3484 * fatal.c: Include "fatal.h" first, to test interface.
3485 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3486 (VA_START): Remove; all uses changed to va_start.
3487 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3489 (exit): Remove decl.
3490 (fatal): Prototype unconditionally. Assume va_start works.
3491 Abort at end, to pacify gcc.
3493 * euidaccess.c (main): Define with a prototype.
3495 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3497 * exitfail.c: Include <stdlib.h> unconditionally.
3499 * fnmatch_.h (__P): Remove. All uses changed to assume
3501 * fnmatch.c: Include fnmatch.h first, to test interface.
3502 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3503 (getenv): Remove decl.
3504 (fnmatch): Define using a prototype.
3505 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3506 (FCT): Define using a prototype.
3508 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3510 * gethostname.c: Include <stddef.h>.
3511 (gethostname): Define with prototype. Length is size_t, not int.
3513 2003-09-08 Paul Eggert <eggert@twinsun.com>
3515 * getversion.c: Remove; was migrated to backupfile.c in 1997.
3516 getversion.c should have been removed then, but was accidentally
3519 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3520 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3522 2003-09-07 Paul Eggert <eggert@twinsun.com>
3524 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3525 copy_tm_result. Bug reported by Simon Josefsson in
3526 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3528 2003-09-06 Paul Eggert <eggert@twinsun.com>
3530 * time_r.c, time_r.h: New files.
3532 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3534 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3535 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3537 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3539 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3540 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3543 * timegm.c: Switch to glibc implementation, with the following changes:
3544 [defined HAVE_CONFIG_H]: Include <config.h>.
3545 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3546 (__mktime_internal) [!defined _LIBC]: New decl.
3547 (__gmtime_r) [!defined _LIBC]: New macro and function.
3548 (timegm): Use a prototype, since gnulib assumes C89.
3549 Do not bother declaring tmp to be const, as it's not really usefu.
3550 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3551 (timegm): Declare only if HAVE_DECL_TIMEGM.
3553 2003-09-03 Paul Eggert <eggert@twinsun.com>
3555 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3556 Bug reported by Lute Kamstra in
3557 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3559 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3560 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3561 course with correspondingly smaller numbers for tomorrow and
3562 yesterday. From Tadayoshi Funaba. Originally installed into
3563 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3566 2003-08-31 Simon Josefsson <jas@extundo.com>
3568 * timegm.h: New file.
3569 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3571 2003-08-31 Karl Berry <karl@gnu.org>
3573 * argp.h: update from libc.
3575 2003-08-28 Bruno Haible <bruno@clisp.org>
3577 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3578 warning on QNX, which defines O_BINARY to 000000.
3580 2003-08-24 Bruno Haible <bruno@clisp.org>
3582 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3583 MSVC7 <stdio.h> is included later.
3585 2003-08-20 Bruno Haible <bruno@clisp.org>
3587 * progname.h: New file, from GNU gettext.
3588 * progname.c: New file, from GNU gettext.
3589 * progreloc.c: New file, from GNU gettext.
3591 2003-08-19 Bruno Haible <bruno@clisp.org>
3593 * xstrdup.c: Assume <string.h> exists.
3595 2003-08-18 Jim Meyering <jim@meyering.net>
3597 * setenv.h: Indent nested cpp directive.
3598 * vasnprintf.c: Remove trailing blanks.
3600 2003-08-17 Simon Josefsson <jas@extundo.com>
3601 Bruno Haible <bruno@clisp.org>
3603 * xstrndup.h: New file.
3604 * xstrndup.c: New file.
3606 2003-08-17 Bruno Haible <bruno@clisp.org>
3608 * strndup.h: New file.
3610 2003-08-16 Paul Eggert <eggert@twinsun.com>
3612 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3613 space, undoing this 2003-08-12 change:
3614 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3616 2003-08-16 Jim Meyering <jim@meyering.net>
3618 Merge from coreutils.
3619 * xstrtoimax.c: #else #if -> #elif.
3620 * xstrtoumax.c: Likewise.
3622 2003-08-15 Paul Eggert <eggert@twinsun.com>
3624 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3625 rather than tab, after '#' in shell-script copyright notices.
3626 Suggested by Bruno Haible.
3628 2003-08-15 Jim Meyering <jim@meyering.net>
3629 and Paul Eggert <eggert@twinsun.com>
3631 Merge from coreutils.
3632 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3633 member but strut utmpx does not. Needed for AIX 4.3.3.
3634 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3636 2003-08-15 Jim Meyering <jim@meyering.net>
3638 Merge from coreutils.
3639 * xgethostname.c: Include <stdlib.h>.
3640 (xghostname): Don't exit for anything other than memory-related
3641 failure; just return NULL.
3642 * userspec.c: Include "posixver.h".
3643 (parse_user_spec): Accept `.' as a separator only
3644 in pre-POSIX-200112 mode.
3645 * strtoimax.c: Use #elif rather than #else #if.
3646 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3647 Remove function, now that we can rely on a working tzset function.
3648 [!_LIBC]: Ensure that the required autoconf test has been run.
3649 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3650 Use underlying_strftime for %r.
3651 * sha.c: Merge in some clean-up and optimization changes from glibc.
3652 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3653 Ensure that it is a multiple of 64.
3654 Rearrange loop exit tests so as to avoid performing an
3655 additional fread after encountering an error or EOF.
3656 * realloc.c: Update copyright date.
3658 2003-08-14 Jim Meyering <jim@meyering.net>
3660 Merge from coreutils.
3661 * obstack.h: Whitespace changes.
3662 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3663 and xcalloc return values.
3664 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3665 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3666 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3667 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3668 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3670 Use mntctl's return value to drive the entry-processing loop, since
3671 we can't rely on the value of the vmt_length member in the last
3672 entry. On some systems doing so could result in exhausting
3673 virtual memory. Based in part on a patch from Mike Jetzer.
3675 2003-08-14 Jim Meyering <jim@meyering.net>
3676 and Paul Eggert <eggert@twinsun.com>
3678 Merges from coreutils, plus other fixes.
3679 * physmem.c: Merge in portability changes from gcc/libiberty
3680 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3681 for credits and details. Thanks to Kaveh Ghazi for helping
3682 to keep these files in sync.
3683 (ARRAY_SIZE): Define it.
3684 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3685 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3686 (memcasecmp): Don't assume size_t fits in unsigned int.
3687 Remove casts and duplicate code.
3688 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3689 (memcpy): Remove definition.
3690 Merge in some clean-up and optimization changes from glibc.
3691 [BLOCKSIZE]: Move definition to top of file.
3692 Ensure that it is a multiple of 64.
3693 Rearrange loop exit tests so as to avoid performing an
3694 additional fread after encountering an error or EOF.
3695 * md5.h (md5_uintptr): Define.
3696 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3697 return to the initial working directory. Preserve errno
3699 * idcache.c: Include "xalloc.h".
3700 (xmalloc, xrealloc): Remove decls.
3701 (getuser): Remove casts no longer required in C89.
3702 * human.c: Include stdio.h, for sprintf.
3703 * group-member.c: Include "xalloc.h".
3704 (xmalloc, xrealloc): Remove decls.
3705 (get_group_info): Remove casts no longer required in C89.
3706 * getusershell.c (readname): Remove casts no longer required in C89.
3707 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3708 * getline.c: Whitespace fix, from coreutils.
3710 2003-08-13 Paul Eggert <eggert@twinsun.com>
3712 * exclude.c: Include <ctype.h>
3713 (IN_CTYPE_DOMAIN): New macro.
3715 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3718 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3719 Undo previous (whitespace-only) change.
3721 2003-08-12 Paul Eggert <eggert@twinsun.com>
3723 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3724 Normalize leading white space and remove trailing white space.
3725 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3726 notice, as per ../config/srclist-update.
3728 Merge from coreutils.
3729 * euidaccess.h: New file.
3730 * euidaccess.c: Include it.
3731 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3732 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3733 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3735 2003-08-11 Bruno Haible <bruno@clisp.org>
3737 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3738 (vasnprintf): Use it instead of wcslen.
3740 2003-08-11 Bruno Haible <bruno@clisp.org>
3742 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3743 value to ensure that _Bool promotes to int. Use #define for _Bool when
3744 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3746 2003-08-10 Karl Berry <karl@gnu.org>
3748 * regex.h: update from libc (whitespace fix).
3750 2003-08-09 Paul Eggert <eggert@twinsun.com>
3752 Merge some files from coreutils. These changes were
3753 originally made by Jim Meyering.
3754 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3755 many older Unixes require this.
3756 * alloca.c (alloca): Remove cast to argument of free;
3757 no longer needed in C89.
3758 * alloca_.h, regex.h: Fix white space to match
3759 what GNU indent does.
3761 2003-08-05 Paul Eggert <eggert@twinsun.com>
3763 * bumpalloc.h: Remove.
3765 2003-08-04 Paul Eggert <eggert@twinsun.com>
3767 * getloadavg.c: Change copyright notice and spacing to conform to
3770 Merge from coreutils.
3771 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3773 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3774 from Karl Berry, implemented by Jim Meyering.
3775 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3776 from Dmitry V. Levin.
3777 Remove anachronistic cast of xrealloc.
3778 * fnmatch_.h (__const): Remove. Use 'const'.
3779 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3780 type. Otherwise, it wouldn't compile with at least /bin/cc on
3781 ymp-cray-unicos9.0.2.X.
3782 Combine two mostly-identical uses of alloca into one.
3783 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3785 2003-08-04 Dave Love <d.love@dl.ac.uk>
3789 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3790 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3791 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3792 obsolete NLIST_NAME_UNION.
3793 [__GNU__]: Undef BSD and FSCALE.
3794 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3796 2003-08-03 Paul Eggert <eggert@twinsun.com>
3798 * stdbool_.h (_Bool): Make it signed char, instead of
3799 an enum type, so that it's guaranteed to promote to int. See:
3800 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3802 2003-07-31 Paul Eggert <eggert@twinsun.com>
3804 * strerror.c: Include config.h, limits.h. Declare sprintf.
3805 (strerror): Don't assume that a printable int fits in 14 bytes.
3807 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3808 Bruno Haible <bruno@clisp.org>
3810 * getline.h (getline, getdelim): Change return type to ssize_t.
3811 * getline.c (getline, getdelim): Likewise.
3812 Remove _GNU_SOURCE define; now it's defined in config.h through
3815 2003-07-22 Paul Eggert <eggert@twinsun.com>
3817 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3818 over-parenthesization in macros.
3820 Sync with coreutils.
3822 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3825 Use `exit_failure' for xalloc and xmemcoll instead of their own
3826 private exit-failure variables.
3827 * xalloc.h (xalloc_exit_failure): Remove.
3828 * xmalloc.c: Likewise. Include exitfail.h.
3829 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3830 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3831 * xmemcoll.c: Likewise. Include exitfail.h.
3832 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3834 2003-07-18 Paul Eggert <eggert@twinsun.com>
3836 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3837 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3838 to test that it can stand by itself. Include "exitfail.h".
3839 Clients should set exit_failure instead.
3840 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3842 2003-07-18 Andreas Schwab <schwab@suse.de>
3844 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3846 2003-07-18 Bruno Haible <bruno@clisp.org>
3848 * getndelim2.h: New file.
3849 * getndelim2.c: Make into a module of its own. Include config.h,
3851 (getndelim2): Make non-static. Change return type to ssize_t.
3852 * getline.h: Change argument names.
3853 * getline.c: Include getndelim2.h instead of getndelim2.c.
3854 * getnline.c: Include getndelim2.h.
3856 2003-07-17 Bruno Haible <bruno@clisp.org>
3858 * Makefile.am: Remove file.
3859 * Makefile.in: Remove file.
3861 2003-07-17 Bruno Haible <bruno@clisp.org>
3863 * getnline.h: New file.
3864 * getnline.c: New file.
3865 * getndelim2.c: New file, extracted from getline.c.
3866 (getndelim2): Renamed from getdelim2, with added nmax argument.
3867 * getline.c: Include getndelim2.c.
3868 (getdelim2): Moved out to getndelim2.c.
3869 (getline, getdelim): Update.
3871 2003-07-15 <karl@gnu.org>
3873 * vasnprintf.c: update from gettext.
3875 2003-07-15 Jim Meyering <jim@meyering.net>
3877 * makepath.c (make_path): Enclose diagnostic in _(...).
3879 2003-07-14 Paul Eggert <eggert@twinsun.com>
3881 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3882 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3883 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3884 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3885 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3886 updated automatically by ../config/srclist-update. This changes
3887 their license from LPGL to GPL.
3889 2003-07-14 Jim Meyering <jim@meyering.net>
3891 Don't emit diagnostics. Let callers do that.
3892 * save-cwd.c: Don't include "error.h".
3893 (save_cwd): Don't call error. Ensure that errno is valid
3894 when returning nonzero.
3896 * save-cwd.h (restore_cwd): Update prototype.
3897 * save-cwd.c (restore_cwd): Remove two parameters.
3898 Simplify. Don't call error upon failure. Let callers do that.
3899 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3900 when auditing is enabled. But don't bother updating the #if.
3902 2003-07-14 Simon Josefsson <jas@extundo.com>
3904 * mempcpy.h: New file.
3905 * mempcpy.c: New file.
3907 2003-07-14 Paul Eggert <eggert@twinsun.com>
3909 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3910 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3911 unicodeio.c, unicodeio.h, unlocked-io.h:
3912 Switch from LGPL to GPL.
3914 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3916 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3917 it breaks C++ compilation.
3918 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3920 2003-07-10 Jim Meyering <jim@meyering.net>
3922 * vasnprintf.c: Remove trailing blanks.
3923 Make cpp indentation consistent.
3925 2003-07-09 Paul Eggert <eggert@twinsun.com>
3927 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3928 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3929 Switch from LGPL to GPL.
3931 2003-07-07 Paul Eggert <eggert@twinsun.com>
3933 * mktime.c: Fix some boundary cases and remove need for floating point.
3935 Issue a compile-time diagnostic if time_t is floating point, or if
3936 two's complement arithmetic is not in effect, or if arithmetic
3937 right shift does not propagate the sign. These assumptions were
3938 all in the original code but they weren't checked.
3940 (TIME_T_MIDPOINT, verify): New macros.
3941 (__isleap): Remove; it has integer overflow problems.
3942 (leapyear): New function, without those problems.
3943 (ydhms_tm_diff): Remove; splitting into two parts.
3944 (ydhms_diff): New function, containing the arithmetic part of
3945 the old ydhms_tm_diff function. Issue a compile-time
3946 diagnostic if we are not using C99 integer division.
3947 Avoid casts when possible.
3948 (guess_time_tm): New function, containing the checking part of
3949 the old ydhms_tm_diff function. Return the new value, rather than
3950 the difference between it and the old. Accept a new argument T
3951 so that *T specifies the old value. Check for overflow in the result.
3953 (__mktime_internal): Use a time_t offset, not a long int offset.
3954 This undoes the 2003-06-04 change, which is no longer needed now
3955 that we have better overflow checking.
3956 (localtime_offset): Likewise.
3958 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3959 and long are 64-bit but int is only 32-bit.
3960 (ydhms_diff): Use long int to store year1 and yday1.
3961 Issue a compile-time diagnostic if long int is not wide enough.
3963 (__mktime_internal): Use long int to store adjusted year and yday.
3964 Use plain C rather than preprocessor commands, if that doesn't
3966 Check for overflow (and try to repair) after each probe
3967 rather than checking only at the very end. This avoids some bugs
3968 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3969 does not equal GMT offset at maximum time).
3970 Use integer to check for overflow rather than floating point; this
3971 is more portable to non-IEEE hosts, and is a tad faster.
3972 When we detect that we are oscillating between two values,
3973 don't check whether tm_isdst has the requested value, since
3974 we already know the answer. When tm_isdst has the wrong value,
3975 use a different heuristic to find the right one, based on the
3976 extreme values actually observed in practice in tz2003a,
3977 rather than the (overly optimistic) "previous 3 calendar quarters".
3979 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3980 "T const" to accommodate glibc style.
3981 (check_result): Use less-confusing report format. "long" -> "long int.
3983 Don't loop if the iteration overflows time_t.
3984 Allow a negative step in the iteration.
3986 2003-07-01 Paul Eggert <eggert@twinsun.com>
3988 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3989 having it depend on HAVE_SYS_TYPES_H.
3991 2003-06-25 Bruno Haible <bruno@clisp.org>
3993 * readlink.c: New file.
3995 2003-06-20 Bruno Haible <bruno@clisp.org>
3997 Assume C89, so PARAMS isn't needed.
3998 * unicodeio.h (PARAMS): Remove.
3999 * unicodeio.c: Don't use PARAMS.
4001 2003-06-18 Jim Meyering <jim@meyering.net>
4003 Merge changes from coreutils.
4004 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
4005 Remove explicit declarations of xmalloc and realloc.
4007 (read_utmp): Remove anachronistic cast of xmalloc.
4009 2003-06-17 Paul Eggert <eggert@twinsun.com>
4011 Assume C89, so PARAMS isn't needed.
4012 * backupfile.h (PARAMS): Remove. All uses removed.
4013 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
4014 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
4015 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
4016 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
4017 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
4018 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
4019 xstrtol.h: Likewise.
4020 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
4021 same.h, strverscmp.h: Do not include config.h; no longer needed.
4022 Anyway, config.h should always be included before any other file.
4024 2003-06-11 Simon Josefsson <jas@extundo.com>
4026 * sysexit_.h: New file.
4028 2003-05-20 Derek Price <derek@ximbiot.com>
4030 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
4032 2003-06-10 Simon Josefsson <jas@extundo.com>
4034 * strchrnul.h: New file.
4035 * strchrnul.c: New file.
4037 2003-06-10 Simon Josefsson <jas@extundo.com>
4039 * argp.h: New file, from glibc.
4040 * argp-ba.c: New file, from glibc.
4041 * argp-eexst.c: New file, from glibc.
4042 * argp-fmtstream.c: New file, from glibc.
4043 * argp-fmtstream.h: New file, from glibc.
4044 * argp-fs-xinl.c: New file, from glibc.
4045 * argp-help.c: New file, from glibc.
4046 * argp-namefrob.h: New file, from glibc.
4047 * argp-parse.c: New file, from glibc.
4048 * argp-pv.c: New file, from glibc.
4049 * argp-pvh.c: New file, from glibc.
4050 * argp-xinl.c: New file, from glibc.
4052 2003-06-07 Jim Meyering <jim@meyering.net>
4054 * readtokens.h: Put `Free Software Foundation, Inc.'
4055 in place of my name in the copyright comment.
4056 Remove definition and uses of __P.
4059 * stat.c: Don't declare xmalloc explicitly.
4060 Instead, include "xalloc.h".
4061 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
4062 xrealloc, and xcalloc return values.
4063 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
4065 * xgetcwd.h: Remove definition/uses of PARAMS.
4067 2003-06-06 Jim Meyering <jim@meyering.net>
4069 * stdbool_.h: Renamed from stdbool.h.in.
4071 2003-06-06 Jim Meyering <jim@meyering.net>
4073 Merge from coreutils.
4074 * same.c: (same_name): Declare *_basename locals to be `const'.
4075 Consolidate declarations and initializations of *_base* locals.
4077 Merge from coreutils.
4078 This avoids a core dump on systems without GNU putenv,
4079 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
4080 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
4081 (unsetenv): New static function, from GNU libc.
4082 (rpl_putenv): Use it.
4084 * modechange.c: Remove trailing blanks.
4086 Merge from coreutils.
4087 * fsusage.c: Remove declaration of statfs.
4088 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
4090 * posixtm.c: Include <stdbool.h> unconditionally.
4092 2003-06-05 Paul Eggert <eggert@twinsun.com>
4094 * mktime.c (__mktime_internal): When resolving a tm_isdst
4095 mismatch, look in future quarters as well as past. This fixes a
4096 bug when processing fall-backwards gaps immediately after a long
4097 period of daylight-saving time.
4099 * mktime.c: Assume freestanding C89 or better.
4100 (HAVE_LIMITS_H): Remove. Assume it's 1.
4101 (__P): Remove; not used.
4102 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
4103 (mktime, not_equal_tm, print_tm, check_result,
4104 main): Use prototypes. Use const * where appropriate.
4105 (main): Fix typo in testing code that uncovered by above changes.
4106 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
4108 2003-06-04 Paul Eggert <eggert@twinsun.com>
4110 * mktime.c: Fix Debian bug 177940
4111 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
4112 (localtime_offset): Now long int, not time_t, because we want it
4113 to be guaranteed to be signed. All uses changed.
4114 (__mktime_internal): If overflow would occur when adding offset,
4117 Merge 'human' changes from coreutils. Rewrite to support
4118 locale-specific notations like thousands separators.
4119 * human.c: Simplify authorship notice.
4120 Include human.h immediately after config.h.
4121 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
4122 <limits.h>: Do not include, since human.h does.
4123 (SIZE_MAX, UINTMAX_MAX): New macros.
4124 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
4125 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
4126 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
4127 (power_letter): Renamed from suffixes.
4128 (generate_suffix_backwards): Remove.
4129 (adjust_value): Now takes int style (because of human.h changes)
4130 and long double value (for greater precision on some platforms).
4131 (group_number): New function.
4132 (human_readable): Use it. Use integer options, not enum.
4133 Put the options before the sizes in the arg list.
4134 Support all the new options.
4135 The old human_readable function has been removed;
4136 use inttostr.h instead.
4137 (human_readable, default_block_size, humblock):
4138 Use uintmax_t, not int, for block sizes.
4139 (human_readable_inexact, block_size_types): Remove.
4140 (block_size_opts): New constant.
4141 (human_options): Renamed from human_block_size, with new signature
4142 that allows block sizes up to UINTMAX_MAX. All callers changed.
4143 * human.h: Add copyright and authorship notice.
4144 Include <limits.h> and <stdbool.h> unconditionally.
4145 (PARAMS): Remove. All uses removed.
4146 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
4147 (enum human_inexact_style): Remove tag; now a nameless enum.
4148 (human_floor, human_ceiling, human_round_to_even): Now have
4149 values 2, 0, 1 rather than -1, 1, 0.
4150 (human_group_digits, human_suppress_point_zero, human_autoscale,
4151 human_base_1024, human_SI, human_B): New constants.
4152 (human_readable_inexact, human_block_size): Remove.
4153 (human_readable): Size args are now uintmax_t, not int.
4154 (human_options): New decl.
4156 * exclude.c: (new_exclude, add_exclude): Remove casts that are
4157 unnecessary now that we assume C89 or better. This change
4158 imported from coreutils.
4160 * mktime.c (__mktime_internal): Do not reject negative timestamps
4161 arbitrarily. This is the same patch as 2003-05-28, but it got lost
4162 in the 2003-05-30 sync from glibc.
4164 .h files should stand alone, but we shouldn't include <sys/types.h>
4165 if we can get away with just <stddef.h>.
4167 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
4168 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
4169 rather than <sys/types.h>, as we merely need size_t.
4170 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
4172 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
4173 Include <stdio.h>, to get FILE.
4174 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
4175 memcasecmp.h has included <stddef.h> and all we need is size_t.
4176 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
4177 our interface, instead of including <sys/types.h>
4179 2003-06-02 Paul Eggert <eggert@twinsun.com>
4182 Fix some minor time-related bugs with POSIX time arguments.
4183 Some valid time stamps were being rejected (notably -1, and
4184 time stamps before 1900 on 64-bit hosts). And some invalid
4185 time stamps were being accepted, e.g. September 31.
4187 * posixtm.h (posixtime): Return bool instead of time_t, so
4188 that we can return (time_t) -1 successfully.
4189 * posixtm.c: Likewise.
4190 [HAVE_STDBOOL_H]: Include <stdbool.h>.
4191 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
4192 (t): Remove static var.
4193 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
4194 of static var. All uses changed.
4195 (year): Do not reject years before 1900; they can occur with
4197 (posix_time_parse): Do not check for out-of-range components;
4198 that is now the caller's responsibility, since our checks were
4199 only approximations.
4200 (posixtime): Use mktime to check for out-of-range components,
4201 since it knows them exactly.
4202 If mktime returns (time_t) -1, check whether an error actually occurred
4203 by invoking localtime on -1.
4204 (main) [TEST_POSIXTIME]: Check for input data errors, and report
4205 posixtime failures better.
4206 Improve the test data (in comments only).
4208 2003-05-30 <karl@gnu.org>
4210 * mktime.c: update from libc.
4212 2003-05-30 Bruno Haible <bruno@clisp.org>
4214 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
4215 * localcharset.h: Likewise.
4216 * localcharset.c: Likewise.
4218 2003-05-28 Paul Eggert <eggert@twinsun.com>
4220 Assume the headers required for C89 freestanding compilers.
4221 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
4222 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
4223 without checking for HAVE_LIMITS_H.
4224 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
4225 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
4227 * fatal.c: Include <stdarg.h> without checking for __STDC__.
4228 * exclude.c: Include <stdbool.h> unconditionally.
4229 * tempname.c: Include <stddef.h> unconditionally.
4230 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
4231 * modechange.c, rpmatch.c (NULL): Don't define, since
4232 <stddef.h> does that.
4233 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
4234 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
4235 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
4236 * xstrtol.c: Likewise.
4237 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
4238 * savedir.c: Include <stddef.h> instead of defining NULL.
4240 * addext.c (addext): Use assignment rather than cast, to avoid
4241 warnings on some platforms.
4243 * mktime.c (__mktime_internal): Do not reject negative timestamps
4246 2003-05-10 Bruno Haible <bruno@clisp.org>
4248 * linebreak.c (iconv_string_length): Don't return -1 just because the
4249 string is longer than 4 KB.
4251 2003-05-12 Jim Meyering <jim@meyering.net>
4253 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
4254 the space-padded-by-default conversion specifiers, %e, %k, %l.
4256 2003-05-03 Bruno Haible <bruno@clisp.org>
4258 Upgrade to Unicode-4.0.
4259 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
4260 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
4261 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
4262 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
4263 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
4264 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
4265 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
4266 Change width of U+E0100..U+E01EF from 1 to 0.
4268 2003-04-25 Bruno Haible <bruno@clisp.org>
4270 * copy-file.c: Include <stddef.h>, for size_t.
4272 2003-04-25 Jim Meyering <jim@meyering.net>
4274 * copy-file.c (copy_file_preserving): Declare buf_size to be
4275 of type size_t, not int.
4277 2003-04-11 Jim Meyering <jim@meyering.net>
4279 Merge changes from Coreutils.
4281 2003-03-22 Jim Meyering <jim@meyering.net>
4283 * strftime.c (widen): Cast alloca return value to proper type.
4285 2003-01-19 Ulrich Drepper <drepper@redhat.com>
4288 * strftime.c (my_strftime): Handle very large width
4289 specifications for numeric values correctly. Improve checks for
4292 2003-01-19 Jim Meyering <jim@meyering.net>
4294 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
4295 (nl_get_alt_digit) [! defined my_strftime]: Define.
4296 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
4297 _nl_get_alt_digit and _nl_get_walt_digit.
4299 * strftime.c (my_strftime): Merge in locale-related changes from libc.
4300 These changes have no effect outside of _LIBC.
4302 2003-04-10 Bruno Haible <bruno@clisp.org>
4304 * findprog.h: New file, from GNU gettext.
4305 * findprog.c: New file, from GNU gettext.
4307 2003-04-05 Jim Meyering <jim@meyering.net>
4309 Merge changes from Coreutils.
4311 * exclude.h (PARAMS): Remove definition and uses.
4312 * exclude.c: Remove uses of `PARAMS'.
4314 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
4315 Add test-cases for DOS filenames. Declare program_name.
4316 (main): Set up program_name. Patch by Rich Dawe.
4318 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4320 Use mntctl's return value to drive the entry-processing loop, since
4321 we can't rely on the value of the vmt_length member in the last
4322 entry. On some systems doing so could result in exhausting
4323 virtual memory. Based in part on a patch from Mike Jetzer.
4325 2003-04-04 Bruno Haible <bruno@clisp.org>
4327 * linebreak.h: New file, from GNU gettext.
4328 * linebreak.c: New file, from GNU gettext with slight modifications.
4329 * lbrkprop.h: New file, from GNU gettext.
4331 2003-04-03 Bruno Haible <bruno@clisp.org>
4333 * utf8-ucs4.h: New file, from GNU gettext.
4334 * utf16-ucs4.h: New file, from GNU gettext.
4335 * ucs4-utf8.h: New file, from GNU gettext.
4336 * ucs4-utf16.h: New file, from GNU gettext.
4338 2003-04-02 Bruno Haible <bruno@clisp.org>
4340 * binary-io.h: New file, from GNU gettext.
4342 2003-04-01 Bruno Haible <bruno@clisp.org>
4344 * pathname.h: New file, from GNU gettext.
4345 * concatpath.c: New file, from GNU gettext.
4347 2003-03-30 Bruno Haible <bruno@clisp.org>
4349 * copy-file.c (copy_file_preserving): Don't set owner if the function
4350 chown() doesn't exist.
4352 2003-03-28 Bruno Haible <bruno@clisp.org>
4354 * copy-file.h: New file, from GNU gettext.
4355 * copy-file.c: New file, from GNU gettext.
4357 2003-03-18 Jim Meyering <jim@meyering.net>
4359 * quote.c (quote_n): Fix typo in comment.
4361 2003-03-14 Jim Meyering <jim@meyering.net>
4363 Merge changes from Coreutils.
4364 * obstack.h (obstack_object_size): Declare temporary, __o,
4365 to be const, in order to avoid warnings.
4366 (obstack_room): Likewise.
4367 (obstack_empty_p): Likewise.
4369 2003-03-13 Paul Eggert <eggert@twinsun.com>
4371 Merge changes from Bison.
4372 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
4373 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4374 when compiling Bison 1.875's `bitset bset = obstack_alloc
4375 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4376 * hash.c: Include <stdbool.h> unconditionally.
4378 2003-03-09 Paul Eggert <eggert@twinsun.com>
4380 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
4381 Reported by Bruce Becker; see:
4382 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
4384 2003-03-03 Paul Eggert <eggert@twinsun.com>
4385 Bruno Haible <bruno@clisp.org>
4387 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
4388 Reported by John Hughes, see
4389 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
4391 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
4393 * poll_.h: New file.
4396 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
4398 * mathl.h: New file.
4399 * acosl.c: New file.
4400 * asinl.c: New file.
4401 * atanl.c: New file.
4402 * ceill.c: New file.
4405 * floorl.c: New file.
4406 * frexpl.c: New file.
4407 * ldexpl.c: New file.
4409 * sincosl.c: New file.
4411 * sqrtl.c: New file.
4413 * trigl.c: New file.
4414 * trigl.h: New file.
4416 2003-02-17 Bruno Haible <bruno@clisp.org>
4418 * mkdtemp.h: New file, from GNU gettext.
4419 * mkdtemp.c: New file, from GNU gettext.
4421 2003-01-31 Bruno Haible <bruno@clisp.org>
4423 * rename.c: #undef rename before defining rpl_rename.
4424 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4426 2003-01-30 Bruno Haible <bruno@clisp.org>
4428 * printf-args.h: New file, from GNU gettext.
4429 * printf-args.c: New file, from GNU gettext.
4430 * printf-parse.h: New file, from GNU gettext.
4431 * printf-parse.c: New file, from GNU gettext.
4432 * vasnprintf.h: New file, from GNU gettext.
4433 * vasnprintf.c: New file, from GNU gettext.
4434 * asnprintf.c: New file, from GNU gettext.
4435 * vasprintf.h: New file, from GNU gettext with modifications.
4436 * vasprintf.c: New file, from GNU gettext.
4437 * asprintf.c: New file, from GNU gettext.
4439 2003-01-29 Bruno Haible <bruno@clisp.org>
4441 * stpncpy.h: New file, from GNU gettext with modifications.
4442 * stpncpy.c: New file, from GNU gettext with modifications.
4444 2003-01-28 Bruno Haible <bruno@clisp.org>
4446 * c-ctype.h: New file, from GNU gettext, with changes suggested by
4448 * c-ctype.c: New file, from GNU gettext, with changes suggested by
4451 2003-01-27 Bruno Haible <bruno@clisp.org>
4453 * xsetenv.h: New file, from GNU gettext.
4454 * xsetenv.c: New file, from GNU gettext.
4456 2003-01-23 Bruno Haible <bruno@clisp.org>
4458 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4460 2003-01-22 Bruno Haible <bruno@clisp.org>
4462 * exit.h: New file, from GNU gettext.
4464 2003-01-11 Bruno Haible <bruno@clisp.org>
4466 * stpcpy.h (stpcpy): Use ANSI C function declarations.
4467 * strcase.h (strcasecmp, strncasecmp): Likewise.
4469 2003-01-14 Jim Meyering <jim@meyering.net>
4471 * same.c (same_name): Tweak a comment.
4473 2003-01-11 Bruno Haible <bruno@clisp.org>
4475 * same.c (same_name): Reorder tests so as to avoid calling stat()
4476 when a string comparison is sufficient.
4478 2003-01-11 Bruno Haible <bruno@clisp.org>
4480 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4483 2003-01-11 Bruno Haible <bruno@clisp.org>
4485 * hash-pjw.c: Add comment about low quality of this function.
4487 2003-01-12 Paul Eggert <eggert@twinsun.com>
4489 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4490 to avoid collisions with libcurses and libreadline.
4492 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4493 * getstr.h, getstr.c: Remove.
4494 * getline.c: Include "getline.h", to check interface.
4495 Move body of old getstr.c here: this defines MIN_CHUNK and
4496 declares getdelim2, which is renamed from getstr.
4497 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4499 * linebuffer.c (readlinebuffer): Renamed from readline.
4501 * linebuffer.h: Likewise.
4502 (readline): Remove backward-compatibility macro.
4504 2003-01-12 Jim Meyering <jim@meyering.net>
4506 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4508 2003-01-10 Bruno Haible <bruno@clisp.org>
4510 * alloca_.h: New file.
4511 * getdate.y: Unconditionally include alloca.h.
4512 * makepath.c: Likewise.
4513 * setenv.c: Likewise.
4514 * userspec.c: Likewise.
4516 2003-01-09 Bruno Haible <bruno@clisp.org>
4518 * stdbool.h.in: New file.
4520 2003-01-08 Bruno Haible <bruno@clisp.org>
4522 * safe-read.c: Include specification header first, to ensure its
4524 * full-write.c: Likewise.
4526 2003-01-08 Jim Meyering <jim@meyering.net>
4528 * full-write.c: Undefine and define-away `const' after inclusion
4529 of errno.h, not before. Suggestion from Bruno Haible.
4531 2003-01-07 Jim Meyering <jim@meyering.net>
4533 * full-write.c: Rework so that it may serve to define full_read, too.
4534 * full-read.c: Simply #define FULL_READ and include full-write.c.
4536 2003-01-06 Jim Meyering <jim@meyering.net>
4538 * version-etc.c: Update year in translatable copyright string.
4540 2002-12-25 Bruno Haible <bruno@clisp.org>
4542 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4543 * xstrtol.h: Likewise.
4544 * xstrtoimax.c: Likewise.
4545 * xstrtoumax.c: Likewise.
4546 * human.h: Likewise.
4548 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4549 on systems that have <inttypes.h> but not <stdint.h>.
4551 2002-12-31 Paul Eggert <eggert@twinsun.com>
4553 * memcoll.c (memcoll): Fall back on a simple algorithm using
4554 memcmp if strcoll doesn't work.
4556 2002-12-23 Bruno Haible <bruno@clisp.org>
4558 * localcharset.h: New file.
4559 * localcharset.c: Include it.
4560 * unicodeio.c: Likewise.
4562 2002-12-22 Bruno Haible <bruno@clisp.org>
4564 * utime.c (utime_null): No need to call ftruncate if the file was
4567 2002-12-23 Bruno Haible <bruno@clisp.org>
4569 * memcoll.c (STRCOLL): New macro.
4572 2002-12-22 Bruno Haible <bruno@clisp.org>
4574 * getstr.h (getstr): Define, to avoid clash with libcurses.
4575 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4577 2002-12-22 Bruno Haible <bruno@clisp.org>
4579 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4581 2002-12-23 Bruno Haible <bruno@clisp.org>
4583 * getline.h: Include <stddef.h>, for size_t.
4585 * unicodeio.h: Include <stddef.h>, for size_t.
4586 * unicodeio.c: Don't include <stddef.h>.
4588 2002-12-17 Bruno Haible <bruno@clisp.org>
4590 * canon-host.c (strdup): Remove unused declaration.
4592 * fsusage.c: Include full_read.h.
4593 (get_fs_usage): Use full_read instead of safe_read.
4595 * utime.c (utime_null): Use SAFE_READ_ERROR.
4597 2002-12-11 Bruno Haible <bruno@clisp.org>
4599 * setenv.h: Rewritten to cope with systems that have setenv() but not
4601 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4604 2002-12-11 Bruno Haible <bruno@clisp.org>
4606 * setenv.c (alloca): Fall back to malloc.
4608 (setenv): Use freea() to free memory allocated with alloca().
4610 2002-11-13 Bruno Haible <bruno@clisp.org>
4612 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4613 function declarations.
4614 * unsetenv.c (unsetenv): Likewise.
4616 2002-03-04 Bruno Haible <bruno@clisp.org>
4618 Portability to AIX 4.3.3.
4619 * unsetenv.c: New file, extracted from setenv.c.
4620 * setenv.c: Move the unsetenv() function to unsetenv.c.
4622 2001-12-20 Bruno Haible <bruno@clisp.org>
4624 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4625 use malloc instead. For SunOS 4.
4627 2001-12-11 Bruno Haible <bruno@clisp.org>
4629 * setenv.c: Declare alloca.
4630 (compar_fn_t): New typedef.
4631 (KNOWN_VALUE, STORE_VALUE): Use it.
4633 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4636 2002-12-10 Paul Eggert <eggert@twinsun.com>
4638 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4639 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4640 Choose values that are less likely to collide with system fnmatch
4642 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4643 defined (e.g., a pure POSIX system).
4644 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4645 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4647 2002-12-06 Jim Meyering <jim@meyering.net>
4649 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4651 Merge in changes from libc's misc/error.c, in preparation
4652 for the merge of gnulib's changes back into libc.
4654 * error.c (_): Define only if not already defined.
4655 Move definition to follow all #include directives.
4656 Include unlocked-io.h only if !_LIBC.
4657 [_LIBC]: Include <libio/libioP.h>.
4658 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4659 (fflush): Tweak definition to use INTUSE.
4662 2002-12-05 Paul Eggert <eggert@twinsun.com>
4664 * alloca.c [defined emacs]: Include "lisp.h".
4665 (xalloc_die) [defined emacs]: New macro.
4666 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4667 [! defined emacs]: Include <xalloc.h>.
4668 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4669 (pointer): Typedef to POINTER_TYPE *.
4670 (malloc): Remove decl; we now always use xmalloc.
4671 (alloca): Use old-style definition, since Emacs needs this.
4672 Check for arithmetic overflow when computing combined size.
4674 2002-12-04 Paul Eggert <eggert@twinsun.com>
4676 Do not generate unlocked-io.h automatically, since it's easier to
4677 maintain it by hand.
4679 * unlocked-io.h: New file, from GNU diffutils,
4680 but with proper copyright notice and attribution.
4682 * Makefile.am: Add copyright notice.
4683 (libfetish_a_SOURCES): Add unlocked-io.h.
4684 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4685 (DISTCLEANFILES, io_functions): Remove macros.
4686 (EXTRA_DIST): Remove gen_uio.
4687 (unlocked-io.h): Remove rule.
4689 2002-12-04 Jim Meyering <jim@meyering.net>
4691 Reflect the fact that stat.c and lstat.c are no longer generated.
4692 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4693 (DISTCLEANFILES): Likewise.
4694 (EXTRA_DIST): Likewise.
4695 (all_local): Don't depend on stat.c or lstat.c.
4696 (stat.c, lstat.c): Remove rules.
4697 (EXTRA_DIST): Remove xstat.in.
4699 * xstat.in: Remove file. Contents moved into stat.c.
4700 * stat.c: New file. Contents mostly from xstat.in.
4701 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4702 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4704 * safe-read.c: Rework so that it may serve to define safe_write, too.
4705 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4707 2002-12-03 Jim Meyering <jim@meyering.net>
4709 * safe-read.c, safe-write.c: Change variable names and comments, but
4710 not semantics, to minimize the differences between these two files.
4711 (safe_read): Change comment to mention SAFE_READ_ERROR.
4713 * safe-read.c (IS_EINTR): Define.
4714 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4716 2002-12-02 Bruno Haible <bruno@clisp.org>
4718 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4719 Define, taken from safe-read.c.
4720 (INT_MAX): Provide fallback.
4721 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4722 * safe-write.h (SAFE_WRITE_ERROR): Define.
4724 * safe-read.c (EINTR): Remove definition.
4725 (safe_read): Don't use EINTR if it is absent.
4727 2002-12-02 Jim Meyering <jim@meyering.net>
4729 * safe-read.c (EINTR): Define.
4730 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4731 (INT_MAX): Provide fallback.
4732 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4734 * safe-read.h (SAFE_READ_ERROR): Define.
4736 2002-12-01 Jim Meyering <jim@meyering.net>
4738 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4739 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4741 2002-11-27 Paul Eggert <eggert@twinsun.com>
4743 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4744 hash_rehash): Replace `if (limit <= value) abort ();' with
4745 `if (! (value < limit)) abort ();', for readability.
4747 2002-11-26 <karl@gnu.org>
4749 * strdup.c: copy from libc again, with jim's ok.
4750 * .cppi-disable: re-add strdup.c
4752 2002-11-25 <karl@gnu.org>
4754 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4755 instead of "strtol.c".
4757 2002-11-25 Jim Meyering <jim@meyering.net>
4759 * mktime.c: Sync from libc, now that it has the latest fix.
4761 2002-11-24 <karl@gnu.org>
4763 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4764 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4766 2002-11-24 Jim Meyering <jim@meyering.net>
4768 Update from coreutils:
4770 * mktime.c: Merge in changes from libc.
4772 Avoid a link-time failure on some Linux systems.
4773 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4774 (__mon_yday): Declare with the STATIC attribute.
4775 (__mktime_internal): Likewise.
4776 Based on a report from Greg Schafer.
4778 2002-11-23 Jim Meyering <jim@meyering.net>
4780 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4781 Use `unsigned', not `int', as type of index.
4783 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4785 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4787 2002-11-22 Paul Eggert <eggert@twinsun.com>
4789 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4790 hint that one should use `if (! x) abort ();' rather than `assert
4791 (x);', and anyway it's one less thing to worry about configuring.
4792 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4793 hash_rehash, hash_insert): Use abort rather than assert.
4795 2002-11-22 Paul Eggert <eggert@twinsun.com>
4797 * quotearg.h: Allow multiple inclusion by surrounding with
4798 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4799 so that we can be included first.
4800 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4801 * quotearg.c: Include quotearg.h immediately after config.h.
4802 No need to include stddef.h or sys/types.h any more.
4803 Surround local include files with "", not "<>".
4804 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4805 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4806 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4807 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4808 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4809 (ISPRINT): Remove; no longer needed now that we assume C89.
4811 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4814 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4815 quotearg_char): Use SIZE_MAX rather than
4816 (size_t) -1 when we are talking about "infinity".
4818 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4820 2002-11-22 Bruno Haible <bruno@clisp.org>
4822 * safe-read.h: Assume C89. Add comments.
4823 (safe_read): Change return type to size_t.
4824 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4825 counts > SSIZE_MAX correctly.
4826 * safe-write.h: New file.
4827 * safe-write.c: New file.
4828 * full-read.h: New file.
4829 * full-read.c: New file.
4830 * full-write.h: Assume C89. Add comments.
4831 * full-write.c: Include safe-write.h.
4832 (full_write): Rewritten to use safe_write.
4833 Suggested by Jim Meyering and Paul Eggert.
4835 2002-11-21 Bruno Haible <bruno@clisp.org>
4837 Remove case insensitive option matching.
4838 * argmatch.h (argcasematch): Remove declaration.
4839 (ARGCASEMATCH): Remove macro.
4840 (__xargmatch_internal): Remove case_sensitive argument.
4841 (XARGMATCH): Update.
4842 (XARGCASEMATCH): Remove macro.
4843 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4844 case_sensitive argument.
4845 (argcasematch): Remove function.
4846 (__xargmatch_internal): Remove case_sensitive argument.
4847 (main): Use XARGMATCH instead of XARGCASEMATCH.
4849 * xmalloc.c: Change compile-time error message. Add comment about
4850 required autoconf version.
4852 2002-11-21 Jim Meyering <jim@meyering.net>
4854 * strdup.c (strdup): Tweak comment and initial #if/#include.
4856 Merge in changes from the coreutils.
4858 2002-09-25 Paul Eggert <eggert@twinsun.com>
4859 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4860 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4861 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4862 int. Work more efficiently if X is the same width as uintmax_t.
4863 Do not compare X to -1, to avoid bogus compiler warning.
4864 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4865 Don't assume that f_frsize and f_bsize are the same type.
4867 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4870 * makepath.c (make_path): Restore umask *before* creating the final
4872 (make_path): Minor reformatting.
4874 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4875 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4877 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4878 ones. At least on GNU/Linux systems, `auto' means something else.
4881 2002-11-20 Paul Eggert <eggert@twinsun.com>
4883 Merge argmatch cleanups from Bison. Assume C89.
4885 * argmatch.c: Include config.h here, not in argmatch.h.
4886 Include stdlib.h, for EXIT_FAILURE.
4887 Always include <string.h>, since we assume C89.
4888 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4889 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4890 Include <stddef.h> instead, since it's all we need for size_t.
4891 (PARAMS): Remove. All uses removed.
4892 (ARRAY_CARDINALITY): Do not bother to #undef.
4893 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4894 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4895 Remove unnecessary parentheses.
4896 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4897 Insert necessary parentheses.
4898 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4899 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4901 2002-11-19 Bruno Haible <bruno@clisp.org>
4903 * mbswidth.c: Include mbswidth.h right at the beginning.
4904 * mbswidth.h: Include <stddef.h>, for size_t.
4906 * mbswidth.h (PARAMS): Remove macro.
4907 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4908 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4910 * gcd.h (PARAMS): Remove macro.
4911 (gcd): Use ANSI C function declarations.
4912 * gcd.c (gcd): Likewise.
4914 2002-11-15 Bruno Haible <bruno@clisp.org>
4916 * strcspn.c: Include <stddef.h>.
4917 (strcspn): Use ANSI C function declaration. Change return type to
4919 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4920 (strpbrk): Use NULL.
4921 * strpbrk.h (PARAMS): Remove macro.
4922 (strpbrk): Use ANSI C function declaration.
4923 * strstr.c: Don't include <sys/types.h>.
4924 * strstr.h (PARAMS): Remove macro.
4925 (strstr): Use ANSI C function declarations.
4927 2002-11-06 Bruno Haible <bruno@clisp.org>
4929 * gcd.h (gcd): Change argument type to 'unsigned long'.
4930 * gcd.c (gcd): Likewise.
4932 2002-11-05 Bruno Haible <bruno@clisp.org>
4934 * gcd.h: New file, from gettext-0.11.5.
4935 * gcd.c: New file, from gettext-0.11.5.
4937 2002-11-05 Bruno Haible <bruno@clisp.org>
4939 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4940 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4941 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4942 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4944 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4945 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4947 * closeout.c: Include gettext.h instead of <libintl.h>.
4948 * human.c: Include gettext.h instead of <libintl.h>.
4949 * quotearg.c: Include gettext.h instead of <libintl.h>.
4950 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4951 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4952 * userspec.c: Include gettext.h instead of <libintl.h>.
4953 * version-etc.c: Include gettext.h instead of <libintl.h>.
4954 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4955 (textdomain): Remove definition.
4956 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4958 * long-options.c: Remove include of <libintl.h> and definition of _.
4959 * same.c: Remove include of <libintl.h> and definition of _.
4961 2002-11-04 Bruno Haible <bruno@clisp.org>
4963 * stpcpy.h: New file, from GNU gettext-0.11.5.
4964 * strcase.h: New file, from GNU gettext-0.11.5.
4965 * strpbrk.h: New file, from GNU gettext-0.11.5.
4966 * strstr.h: New file, from GNU gettext-0.11.5.
4967 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4969 2002-05-09 Bruno Haible <bruno@clisp.org>
4971 * config.charset: Update for newest glibc. Add canonical names
4972 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4974 2002-05-09 Bruno Haible <bruno@clisp.org>
4976 * localcharset.c (get_charset_aliases): Add more Windows specific
4979 2002-05-08 Owen Taylor <otaylor@redhat.com>
4981 * config.charset: A few additions for Solaris.
4983 2001-12-05 Bruno Haible <bruno@clisp.org>
4985 * localcharset.c (locale_charset): Don't return an empty string.
4987 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4989 * config.charset: msdos in uk_UA uses CP1125.
4991 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4993 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4994 * localcharset.c (locale_charset): Declare as extern "C".
4996 2002-02-15 Bruno Haible <bruno@clisp.org>
4998 * config.charset [msdosdjgpp]: For Russian, use CP866.
5000 2002-02-11 Bruno Haible <bruno@clisp.org>
5002 * config.charset: Add support for NetBSD.
5004 2002-09-25 <karl@gnu.org>
5006 * strdup.c: copy from libc/string (via ../config/srclist*).
5007 * getopt*: copy from libc/posix.
5008 * gettext.h: copy from gettext.
5009 * .cppi-disable: add strdup.c, gettext.h.
5011 2002-07-01 Jim Meyering <meyering@lucent.com>
5013 * c-stack.c: Include sys/time.h.
5014 From Volker Borchert.
5016 2002-06-11 Paul Eggert <eggert@twinsun.com>
5018 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
5019 New macro. Use it uniformly instead of
5020 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
5021 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
5022 reported by Vin Shelton.
5024 2002-06-22 Jim Meyering <meyering@lucent.com>
5026 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
5027 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
5029 2002-06-22 Paul Eggert <eggert@twinsun.com>
5031 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
5032 Do not assume SA_SIGINFO behavior.
5033 Bug reported by Jim Meyering on NetBSD 1.5.2.
5035 2002-06-22 Jim Meyering <meyering@lucent.com>
5037 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
5039 * exitfail.c, exitfail.h: Likewise.
5040 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
5042 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
5044 (EXTRA_DIST): Add fnmatch_loop.c.
5045 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
5047 * fnmatch_loop.c: New file, from diffutils-2.8.2.
5048 * fnmatch.c: Update from diffutils-2.8.2.
5049 * fnmatch_.h: New file. From diffutils-2.8.2.
5050 * fnmatch.h: Remove file.
5052 2002-06-18 Paul Eggert <eggert@twinsun.com>
5054 * file-type.h: Report an error if neither S_ISREG nor
5055 S_IFREG is defined, instead of using a test specific to glibc
5056 2.2. This should be safe, since POSIX requires S_ISREG and
5057 Unix Version 7 had S_IFREG. We don't need to check for
5058 <sys/types.h> since we don't use any symbols that it defines.
5060 2002-06-15 Jim Meyering <meyering@lucent.com>
5062 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
5063 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
5064 have been included before this file.
5066 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
5068 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
5069 so that each temporary file name is unique and valid in the first
5070 8 characters, for operation under DOS.
5072 2002-06-15 Jim Meyering <meyering@lucent.com>
5074 Work even with DJGPP 2.03, which lacks support for symlinks.
5076 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
5078 * lchown.c (S_ISLNK): Likewise.
5080 2002-06-14 Jim Meyering <meyering@lucent.com>
5082 * file-type.h: Use the version from diffutils-2.8.2.
5083 * file-type.c: Likewise.
5085 2002-05-27 Jim Meyering <meyering@lucent.com>
5087 Fix a problem seen only on nonconforming systems whereby ls.c's
5088 use of localtime, and then of gettimeofday would cause trouble:
5089 the localtime call used to initialize rpl_gettimeofday's save
5090 mechanism would clobber ls's current local time information so
5091 that in any long listing the first file would always be listed
5092 with date 1970-01-01. Analysis by Volker Borchert.
5094 * gettimeofday.c (localtime): Undefine.
5095 (rpl_localtime): New function.
5097 2002-05-22 Jim Meyering <meyering@lucent.com>
5099 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
5100 * file-type.h: New file.
5101 * file-type.c (file_type): New file/function. Extracted from diffutils.
5103 2002-04-29 Paul Eggert <eggert@twinsun.com>
5105 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
5107 2002-04-28 Paul Eggert <eggert@twinsun.com>
5109 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
5110 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
5111 of 127, since 64 is the largest conceivable number for ancient
5113 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
5115 2002-04-28 Jim Meyering <meyering@lucent.com>
5117 * sig2str.c (WTERMSIG): Remove definition (unused).
5119 2002-04-28 Paul Eggert <eggert@twinsun.com>
5121 * sig2str.h, sig2str.c: New files.
5122 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
5124 2002-04-24 Jim Meyering <meyering@lucent.com>
5126 * gettext.h: New file, from Gettext.
5127 * Makefile.am (INCLUDES): Remove -I../intl.
5128 (libfetish_a_SOURCES): Add gettext.h.
5130 2002-04-16 Jim Meyering <meyering@lucent.com>
5132 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
5133 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
5134 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
5136 2002-04-12 Jim Meyering <meyering@lucent.com>
5138 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
5140 2002-03-10 Jim Meyering <meyering@lucent.com>
5142 * makepath.c (make_path): Remove a comma from a diagnostic.
5143 Suggestion from Santiago Vila.
5145 2002-03-08 Jim Meyering <meyering@lucent.com>
5147 * rename.c: Mention that this wrapper is needed also on
5148 mips-dec-ultrix4.4 systems.
5150 2002-03-02 Jim Meyering <meyering@lucent.com>
5152 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
5153 not HAVE_CLOCK_SETTIME.
5155 2002-02-27 Paul Eggert <eggert@twinsun.com>
5157 * nanosleep.h: Rename to....
5158 * timespec.h: New name for nanosleep.h. All uses changed.
5160 * gettime.c: New file.
5161 * settime.c: New file.
5164 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
5165 timespec.h. Remove nanosleep.h.
5167 2002-02-25 Paul Eggert <eggert@twinsun.com>
5169 * acl.c, acl.h: New files.
5170 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
5172 2002-02-24 Jim Meyering <meyering@lucent.com>
5174 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
5175 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
5176 cause trouble. Reported by Nelson Beebe.
5178 2002-02-23 Paul Eggert <eggert@twinsun.com>
5180 * path-concat.c (xpath_concat): Reorder code to pacify
5181 compilers that don't know that xalloc_die never returns.
5183 2002-02-20 Jim Meyering <meyering@lucent.com>
5185 * getdate.c: Regenerate using bison-1.33.
5187 2002-02-15 Paul Eggert <eggert@twinsun.com>
5189 * posixver.c, posixver.h: New files.
5190 * Makefile.am (libfetish_a_SOURCES): Add them.
5192 2002-02-02 Paul Eggert <eggert@twinsun.com>
5193 Bruno Haible <bruno@clisp.org>
5195 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
5196 (fwrite_success_callback): New declaration.
5197 * unicodeio.c (unicode_to_mb): New function, extracted from
5198 print_unicode_char. Call failure callback instead of error.
5199 (fwrite_success_callback): New function.
5200 (exit_failure_callback): New function.
5201 (fallback_failure_callback): New function.
5202 (print_unicode_char): Call unicode_to_mb.
5204 2002-01-26 Jim Meyering <meyering@lucent.com>
5206 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
5208 2002-01-22 Jim Meyering <meyering@lucent.com>
5210 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
5211 Otherwise, some versions of automake would omit the rule that makes
5212 Makefile from Makefile.in.
5214 2001-01-21 Paul Eggert <eggert@twinsun.com>
5216 * xmemcoll.h, xmemcoll.c: New files.
5217 * Makefile.am (libfetish_a_SOURCES): Add them.
5218 * memcoll.c: Include errno.h, and declare errno if not defined.
5219 (memcoll): Set errno to zero if there is no error.
5221 * quotearg.c (quotearg_buffer_restyled):
5222 Fix bug with quoting buffers containing NUL when backslashing escapes.
5223 This bug was exposed by the other changes in this patch.
5224 (quotearg_n_options): New arg ARGSIZE.
5225 All callers changed.
5226 (quoting_options_from_style): New function.
5227 (quotearg_n_style): Use it.
5228 (quotearg_n_style_mem): New function.
5230 * quotearg.h (quotearg_n_style_mem): New function.
5232 2002-01-16 Jim Meyering <meyering@lucent.com>
5234 * getdate.y: Add three semicolons, each just before a closing brace.
5235 Bison (as of version 1.31) no longer papers over that mistake.
5237 2002-02-14 Paul Eggert <eggert@twinsun.com>
5239 * backupfile.c (ISDIGIT): Comment fix.
5240 * getdate.y (ISDIGIT): Likewise.
5241 * posixtm.c (ISDIGIT, year): Likewise.
5242 * strverscmp.c (ISDIGIT): Likewise.
5243 * userspec.c (ISDIGIT): Likewise.
5245 2002-01-05 Jim Meyering <meyering@lucent.com>
5247 * version-etc.c (version_etc_copyright): Update copyright year.
5249 2001-01-19 Paul Eggert <eggert@twinsun.com>
5251 * closeout.c (close_stdout_status): If ferror (stdout), do
5252 not silently exit merely because the output buffer happens to
5253 have nothing pending.
5255 2001-12-18 Paul Eggert <eggert@twinsun.com>
5257 See the big note in ../ChangeLog.
5258 * human.c (suffixes): Prefer K to k for 1024.
5259 (generate_suffix_backwards): New function.
5260 (human_readable_inexact): Use it.
5261 * xstrtol.c (__xstrtol): If there is no number but there
5262 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
5263 Accept 'K' as well as 'k'.
5265 2001-12-15 Jim Meyering <meyering@lucent.com>
5267 * regex.h (__restrict_arr): Update from libc.
5269 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
5270 as `remote' if the name starts with `//'. Suggested by Michael Stone.
5273 2001-12-10 Jim Meyering <meyering@lucent.com>
5275 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
5276 Instead, include "xalloc.h".
5277 (initbuffer): Don't cast xmalloc return value to char*.
5278 (readline): Reword comment.
5279 Don't cast xrealloc return value to char*
5282 2001-12-09 Jim Meyering <meyering@lucent.com>
5284 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
5285 `signed and unsigned type in conditional expression'.
5286 * posixtm.c (posix_time_parse): Likewise.
5288 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
5290 * readtokens.c (readtoken): Declare an index to be of type unsigned
5291 to avoid a pedantic warning.
5293 * getstr.c: Don't include assert.h.
5294 (getstr): Remove warning-evoking assertions.
5295 Return -1 if offset parameter is out of bounds.
5296 Change the type of a local from int to size_t.
5298 * strftime.c (my_strftime_localtime_r): Include this function
5299 definition in the `#if ! HAVE_TM_GMTOFF' block.
5301 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
5302 Include xalloc.h instead.
5304 2001-12-02 Jim Meyering <meyering@lucent.com>
5306 * tempname.c: Don't declare getenv, thus reverting the change of
5307 2001-11-18. It's no longer necessary, now that stdlib.h is always
5310 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
5311 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
5313 2001-11-30 Akim Demaille <akim@epita.fr>
5315 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
5316 before being defined.
5318 2001-11-27 Paul Eggert <eggert@twinsun.com>
5320 * quotearg.h (quotearg_n, quotearg_n_style):
5321 First arg is int, not unsigned.
5322 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
5323 (SIZE_MAX, UINT_MAX): New macros.
5324 (quotearg_n_options): Abort if N is negative.
5325 Avoid overflow check on hosts where size_t is 64 bits and int
5326 is 32 bits, as overflow is impossible there.
5327 Fix off-by-one typo that caused unnecessary reallocation.
5329 2001-11-27 Jim Meyering <meyering@lucent.com>
5331 * tempname.c: Merge with version from libc.
5332 * regex.c: Likewise.
5334 * tempname.c: Include stdlib.h unconditionally. On some old systems
5335 for which STDC_HEADERS is 0, it was not included, resulting in a
5336 warning about an integer-to-pointer conversion problem with getenv.
5337 Reported by Volker Borchert.
5339 2001-11-26 Jim Meyering <meyering@lucent.com>
5341 * gtod.h: Remove file.
5342 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
5343 * gettimeofday.c: Don't include gtod.h.
5344 (GTOD_init): Remove function.
5345 (rpl_gettimeofday): Do its job here instead, rather than aborting.
5346 Suggestion from Volker Borchert.
5348 2001-11-23 Jim Meyering <meyering@lucent.com>
5350 * hash.h (struct hash_table): Don't define here. Merely declare it.
5351 * hash.c (struct hash_table): Define it here instead.
5353 2001-11-22 Jim Meyering <meyering@lucent.com>
5355 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
5357 2001-11-18 Paul Eggert <eggert@twinsun.com>
5359 * tempname.c (TMP_MAX): Remove; no longer needed.
5360 (TEMPORARIES): New macro.
5361 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
5362 removes an artificial limitation (e.g. HP-UX 10.20, where
5365 2001-11-18 Jim Meyering <meyering@lucent.com>
5367 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
5370 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
5371 files will be created before anything else.
5373 2001-11-17 Jim Meyering <meyering@lucent.com>
5375 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
5376 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
5377 rather than group writable. Patch by Juan F. Codagnone.
5379 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
5380 Instead, include "xalloc.h".
5382 * mountlist.c: Include unlocked-io.h after all system headers.
5383 Remove explicit declarations of xmalloc, xrealloc,
5384 and xstrdup. Instead, include "xalloc.h".
5386 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
5387 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
5388 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
5390 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
5391 Reported by Padraig Brady.
5393 * mkstemp.c: #undef mkstemp.
5395 (rpl_mkstemp): Rename from mkstemp.
5398 2001-11-16 Jim Meyering <meyering@lucent.com>
5400 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
5401 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
5402 determine the amount of total physical memory, use pstat_getstatic.
5403 HPUX-11 doesn't define _SC_PHYS_PAGES.
5404 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
5405 If sysconf couldn't be used to determine the amount of available
5406 physical memory, use both pstat_getstatic and pstat_getdynamic.
5407 Based on a patch from Bob Proulx.
5409 2001-11-05 Jim Meyering <meyering@lucent.com>
5411 * xstat.in (slash_aware_lstat): Correct a misleading comment.
5413 2001-11-03 Jim Meyering <meyering@lucent.com>
5415 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
5416 in argmatch_to_argument call.
5418 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5421 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5422 e.g., a fault due to an attempt to free a NULL pointer.
5424 2001-11-01 Jim Meyering <meyering@lucent.com>
5426 * dirfd.c, dirfd.h: New files.
5427 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5429 * hash.c (hash_print) [TESTING]: Clean up.
5431 2001-10-22 Paul Eggert <eggert@twinsun.com>
5433 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5434 to avoid a warning if -Wall.
5436 2001-10-21 Paul Eggert <eggert@twinsun.com>
5438 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5440 2001-10-21 Jim Meyering <meyering@lucent.com>
5442 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5443 this code would end up calling gettext even in packages built
5445 * getopt.c (_): Likewise.
5446 * regex.c (_): Likewise.
5448 2001-10-20 Paul Eggert <eggert@twinsun.com>
5450 * error.c (strerror_r): Do not declare unless !_LIBC.
5451 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5452 Use strerror_r that is only a macro, even if it is not a function.
5453 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5454 (private_strerror): Use prototypes, not old-style function definition.
5455 (print_errno_message): New function.
5456 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5458 (error_tail, error, error_at_line): Use it.
5460 2001-10-11 Jim Meyering <meyering@lucent.com>
5462 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5463 and quote_n (1, ... to avoid clobbering a buffer.
5465 2001-10-05 Jim Meyering <meyering@lucent.com>
5467 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5468 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5469 * hash-pjw.h: New file.
5471 2001-09-30 Jim Meyering <meyering@lucent.com>
5473 * mountlist.c [MOUNTED_GETFSSTAT]:
5474 Include <sys/ucred.h>, for Apple Darwin.
5475 Include sys/mount.h and sys/fs_types.h only if available.
5477 (read_filesystem_list): Use FS_TYPE.
5479 2001-09-29 Paul Eggert <eggert@twinsun.com>
5481 * exclude.c (excluded_filename): 0 -> false, since it's
5484 2001-09-28 Paul Eggert <eggert@twinsun.com>
5486 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5487 #defines strtoimax. Also treat the other strto* functions
5490 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5491 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5492 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5494 2001-09-26 Jim Meyering <meyering@lucent.com>
5496 Most macros in unlocked-io.h had the wrong number of arguments.
5497 * gen-uio: New script.
5498 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5499 * unlocked-io.hin: Remove file.
5500 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5501 rather than trying to embed it here.
5502 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5503 Reported by Padraig Brady.
5505 2001-09-25 Volker Borchert <bt@teknon.de>
5507 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5509 2001-09-23 Jim Meyering <meyering@lucent.com>
5511 * mountlist.c: Remove useless parentheses in #if directives.
5512 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5513 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5515 2001-09-22 Jim Meyering <meyering@lucent.com>
5517 * localcharset.c: Update from latest gettext.
5518 * config.charset: Likewise.
5520 2001-09-20 Jim Meyering <meyering@lucent.com>
5522 * xstrtol.c (strtoimax): Guard declaration with
5523 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5524 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5525 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5526 (strtoumax): Likewise, for completeness (it wasn't necessary).
5528 2001-09-06 Paul Eggert <eggert@twinsun.com>
5530 * strtoimax.c (HAVE_LONG_LONG):
5531 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5532 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5533 to work around bug in IBM C compiler.
5535 2001-09-16 Jim Meyering <meyering@lucent.com>
5537 * mkdir.c: New file.
5539 2001-09-04 Paul Eggert <eggert@twinsun.com>
5541 * xgetcwd.c: Revert some of the previous change; intead,
5542 fix the HAVE_GETCWD_NULL code to behave more like the
5543 !HAVE_GETCWD_NULL code used to.
5546 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5549 2001-09-04 Paul Eggert <eggert@twinsun.com>
5551 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5552 Use ssize_t, not int, to store result of readlink.
5553 Check for ssize_t overflow as well as size_t overflow,
5554 as POSIX says the result of readlink is implementation-defined
5555 when ssize_t overflows.
5556 Remove unnecessary cast to char*.
5557 Use free+malloc instead of realloc, as the storage doesn't need
5558 to be preserved and it's clearer and can be more efficient that way.
5559 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5560 * xreadlink.h (xreadlink): Update prototype.
5562 2001-09-03 Paul Eggert <eggert@twinsun.com>
5564 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5565 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5566 spotted by Jim Meyering.
5568 2001-09-03 Jim Meyering <meyering@lucent.com>
5570 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5572 2001-09-03 Paul Eggert <eggert@twinsun.com>
5574 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5575 like the HAVE_GETCWD_NULL code.
5576 Include pathmax.h if not HAVE_GETCWD.
5577 Do not include xalloc.h.
5578 (INITIAL_BUFFER_SIZE): New symbol.
5579 Do not use xmalloc / xrealloc, since the caller is responsible for
5580 handling errors. Preserve errno around `free' during failure.
5581 Do not overrun buffer when using getwd.
5583 2001-09-03 Paul Eggert <eggert@twinsun.com>
5585 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5586 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5588 2001-09-02 Jim Meyering <meyering@lucent.com>
5590 * error.c: Update from GNU libc.
5592 2001-09-01 Jim Meyering <meyering@lucent.com>
5594 * xreadlink.c: New file.
5595 * xreadlink.h: New file.
5596 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5598 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5599 doesn't conflict with sparc Solaris 7's definition in
5600 /usr/include/sys/int_types.h.
5602 * exclude.c: Use `""', not `<>' to #include non-system header files.
5603 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5604 and strncasecmp as r-values. Unixware didn't have declarations.
5606 2001-08-31 Jim Meyering <meyering@lucent.com>
5608 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5609 Use an initial, malloc'd, buffer of length 128 rather than
5610 a statically allocated one of length 1024.
5612 2001-08-30 Paul Eggert <eggert@twinsun.com>
5614 * xgetcwd.c: Don't include pathmax.h.
5615 Include stdlib.h and unistd.h if available.
5617 (xmalloc, xstrdup, free): Remove decls.
5618 (xgetcwd): Don't assume sizes fit in unsigned.
5619 Check for overflow when computing sizes.
5620 Simplify reallocation code.
5622 2001-08-28 Paul Eggert <eggert@twinsun.com>
5624 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5626 * strtoimax.c: Renamed from strtoxmax.c, removing the
5629 Also, make the following further changes to make this file's
5630 configuration more similar to that of strtol.c:
5631 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5632 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5633 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5634 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5635 changed to signed values.
5637 And make the following changes as well:
5638 Fix copyright notice, as 1999 was missing.
5639 (verify): New macro.
5640 (strtoimax): Check sizes at compile-time, not run-time.
5641 Prefer strtol to strtoll if both work.
5642 (main): Remove; it was not that useful and was a pain to maintain.
5644 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5646 2001-08-30 Paul Eggert <eggert@twinsun.com>
5648 * savedir.c (savedir): Remove size parameter, as POSIX says that
5649 a directory's st_size can have an arbitrary value, so the old
5650 usage could waste an arbitrary amount of memory. All uses
5652 * savedir.h: Update prototype.
5654 2001-08-30 Paul Eggert <eggert@twinsun.com>
5656 * xstrtol.c (strtoimax): New decl.
5658 2001-08-28 Paul Eggert <eggert@twinsun.com>
5660 * xstrtol.h: Add copyright notice.
5661 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5662 LONGINT_INVALID_SUFFIX_CHAR.
5664 2001-08-30 Paul Eggert <eggert@twinsun.com>
5666 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5669 2001-08-30 Paul Eggert <eggert@twinsun.com>
5671 * hash.c: Remove '2001' from copyright notice.
5673 2001-08-30 Paul Eggert <eggert@twinsun.com>
5675 * full-write.h: New file.
5676 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5677 * full-write.c: Correct credits, as cccp.c no longer
5678 exists and anyway it was so heavily changed from the old cccp
5679 code as to be unrecognizable. Include full-write.h.
5680 (full_write) Return size_t, with short writes meaning failure.
5681 All callers changed. This fixes a bug with large buffers
5683 * utime.c: Include full-write.h.
5685 2001-08-30 Paul Eggert <eggert@twinsun.com>
5687 Merge 'exclude' changes from tar 1.13.22.
5688 This fixes one or two unlikely storage allocation overflow bugs,
5689 but doesn't change user-visible behavior otherwise.
5691 2001-08-30 Paul Eggert <eggert@twinsun.com>
5693 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5694 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5695 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5696 Include if available.
5697 (<xalloc.h>): Include
5698 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5699 (verify): New macro. Use it to verify that EXCLUDE macros do not
5700 collide with FNM macros.
5701 (struct patopts): New struct.
5702 (struct exclude): Use it, as exclude patterns now come with options.
5703 (new_exclude): Support above changes.
5704 (new_exclude, add_exclude_file):
5705 Initial size must now be a power of two to simplify overflow checking.
5706 (free_exclude, fnmatch_no_wildcards): New function.
5707 (excluded_filename): No longer requires options arg, as the options
5708 are determined by add_exclude. Now returns bool, not int.
5709 (excluded_filename, add_exclude):
5710 Add support for the fancy new exclusion options.
5711 (add_exclude, add_exclude_file): Now takes int options arg.
5712 Check for arithmetic overflow when computing sizes.
5713 (add_exclude_file): xrealloc might modify errno, so don't
5714 realloc until after errno might be used.
5716 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5718 (free_exclude): New decl.
5719 (add_exclude, add_exclude_file): Now takes int options arg.
5720 (excluded_filename): No longer requires options arg, as the options
5721 are determined by add_exclude. Now returns bool, not int.
5723 2001-08-30 Paul Eggert <eggert@twinsun.com>
5725 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5727 2001-08-27 Jim Meyering <meyering@lucent.com>
5729 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5731 * version-etc.c (N_): Remove definition.
5732 Revert most of last change.
5733 Instead, simply don't mark the `Copyright...' string for translation.
5734 Based on advice from Paul Eggert.
5736 * strtoxmax.c: Tweak comment.
5738 2001-08-26 Jim Meyering <meyering@lucent.com>
5740 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5741 of copyright with `%s' so translators don't get an untranslated
5743 (COPYRIGHT_YEAR): Define.
5744 (version_etc): Use fprintf rather than fputs.
5745 Suggestion from Ulrich Drepper.
5747 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5749 * strtoll.c: New file, from GNU libc.
5750 * xstrtoimax.c: New file.
5752 * xstrtol.h: Add xstrtoimax.
5753 * strtoumax.c: New file. Simply include "strtoumax.c".
5754 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5756 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5757 * strtoxmax.c: ... then renamed to this.
5759 2001-08-13 Paul Eggert <eggert@twinsun.com>
5761 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5762 Port to Solaris 8, where 'sed' requires a space after the 'r'
5763 command, and where sh dislikes "$/". Clean up the spacing a bit.
5764 Redirect output to $tmp just once.
5766 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5768 * addext.c (<errno.h>): Include.
5769 (errno): Declare if not defined.
5770 (addext): Work correctly when pathconf returns -1 and leaves
5771 errno alone because there is no limit. Also, work even if
5772 pathconf returns a value greater than SIZE_MAX.
5774 2001-08-12 Jim Meyering <meyering@lucent.com>
5776 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5777 Simply `return getcwd (NULL, 0);'.
5778 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5779 Use 1300 as initial value for length, not PATH_MAX.
5781 * pathmax.h: Clean up cpp syntax.
5783 2001-08-12 Jim Meyering <meyering@lucent.com>
5785 * gettimeofday.c: New file.
5787 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5789 2001-08-04 Jim Meyering <meyering@lucent.com>
5791 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5792 to get in sync with glibc.
5794 2001-08-03 Paul Eggert <eggert@twinsun.com>
5796 The following changes are from gettext 0.10.39 as maintained by
5799 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5800 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5801 with inverted sense. All uses changed.
5803 * mbswidth.c: Don't include <limits.h>.
5804 Include <stdlib.h> and <string.h> unconditionally.
5805 (iswcntrl, mbsinit, ISCNTRL): New macros.
5806 (mbsnwidth): Use K&R style function declarations.
5807 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5808 can optimize it when MB_CUR_MAX == 1.
5809 The width of control characters is zero, not 1.
5811 2001-07-15 Jim Meyering <meyering@lucent.com>
5813 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5814 (BUILT_SOURCES): Add unlocked-io.h.
5815 (io_functions): Define.
5816 (unlocked-io.h): New rule.
5817 (DISTCLEANFILES): Add unlocked-io.h.
5818 (all-local): Depend on unlocked-io.h, to ensure it is created.
5820 * unlocked-io.hin: New file
5822 * regex.c: Update from glibc.
5824 2001-07-05 Jim Meyering <meyering@lucent.com>
5826 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5828 (libfetish_a_SOURCES): Put all .h files here instead.
5829 Remove a thus-exposed (better checks in automake) duplicate and
5830 two unnecessary .h files.
5832 2001-06-11 Jim Meyering <meyering@lucent.com>
5834 * regex.c: Update from GNU libc.
5836 2001-05-27 Jim Meyering <meyering@lucent.com>
5838 * readutmp.h (UT_TYPE): Define.
5840 2001-05-24 Jim Meyering <meyering@lucent.com>
5842 * argmatch.c: Include "quote.h".
5843 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5844 quote function. Reported by Göran Uddeborg.
5846 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5848 * dirname.c (dir_name): Compute append_dot using path, not newpath
5849 which is not yet declared.
5851 2001-05-11 Paul Eggert <eggert@twinsun.com>
5853 * Makefile.am (libfetish_a_SOURCES):
5854 Add strftime.c, since we now compile it on all hosts.
5856 * strftime.c (my_strftime):
5857 Define to nstrftime if emacs, but only if my_strftime is not defined.
5858 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5859 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5860 Add one more extra argument: a nanoseconds value.
5863 (my_strftime function): Add %N format.
5864 (emacs_strftimeu): Renamed from emacs_strftime,
5865 with extra ut argument.
5867 2001-05-11 Paul Eggert <eggert@twinsun.com>
5869 dirname code cleanup. base_name now behaves more compatibly
5870 with POSIX basename when given file names that have trailing
5871 slashes, and similarly for dir_name. Add new primitives
5872 base_len and dir_len. Put the directory-name-related decls
5875 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5876 * backupfile.c (base_name): Likewise.
5877 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5878 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5879 * makepath.c (strip_trailing_slashes): Likewise.
5880 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5882 * rename.c (strip_trailing_slashes): Likewise.
5883 * same.c (base_name): Likewise.
5884 * stripslash.c (ISSLASH): Likewise.
5886 * addext.c: Include <dirname.h> after size_t is defined.
5887 * backupfile.c: Likewise.
5889 * addext.c (addext): Use base_len to trim redundant
5890 trailing slashes instead of doing it ourselves.
5891 But do not trim the last slash if it is not redundant.
5893 * backupfile.c (find_backup_file_name,
5894 max_backup_version): Use base_len instead of rolling it ourselves.
5895 Handle the case of "" and (on DOS) "C:" correctly.
5897 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5898 Include <string.h>, <dirname.h>.
5899 (base_name): Allow file names ending in slashes, other than names
5900 that are all slashes. In this case, return the basename followed
5901 by the slashes. This is more general, and can be used in places
5902 where the original base_name purposely had an assertion failure.
5903 (base_len): New function.
5905 * dirname.c: Include <string.h> instead of <stdlib.h>.
5906 Do not include <assert.h>; no longer needed.
5908 (memrchr): Remove decl.
5909 (dir_name_r): Remove.
5910 (dir_len): Renamed from dirlen. All callers changed.
5911 Rewrite in terms of base_name, for simplicity and consistency.
5912 (dir_name): Never return NULL. All callers changed.
5913 Do not include <stdlib.h> in test program; no longer needed.
5914 return 0; is fine for test program.
5916 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5918 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5920 * path-concat.c (path_concat): Use base_len to compute
5921 base length, not strlen; this means we cannot rely on memcpy
5924 * same.c (STREQ): Remove.
5925 (same_name): Handle the case where the basename ends in trailing '/'.
5927 * stripslash.c (strip_trailing_slashes): Return nonzero if
5928 a slash was stripped. Do not strip the last slash after a
5931 2001-04-08 Jim Meyering <meyering@lucent.com>
5933 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5934 recomputed; that's necessary when the offset spans a DST transition.
5935 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5937 2001-04-02 Jim Meyering <meyering@lucent.com>
5939 * regex.h, regex.c: Update from GNU libc.
5941 2001-03-19 Paul Eggert <eggert@twinsun.com>
5943 * version-etc.c (version_etc_copyright): Update to 2001.
5945 2001-03-16 Paul Eggert <eggert@twinsun.com>
5947 * tempname.c (uint64_t): Define to uintmax_t if
5948 not defined, and if UINT64_MAX is not defined.
5949 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5950 Reported by John David Anglin.
5952 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5954 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5955 alias if codeset is empty.
5956 * config.charset (BeOS): Use wildcard syntax.
5958 2001-03-13 Jim Meyering <meyering@lucent.com>
5960 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5961 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5964 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5966 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5968 * unicodeio.c (print_unicode_char): Simplify accordingly.
5970 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5972 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5973 support for DOS/DJGPP.
5975 2001-02-28 Paul Eggert <eggert@twinsun.com>
5977 * Makefile.am (libfetish_a_SOURCES):
5978 Add dup-safer.c, fopen-safer.c.
5979 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5981 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5983 2001-02-25 Paul Eggert <eggert@twinsun.com>
5985 The mkstemp replacement is taken from glibc 2.2.2, with some
5986 portability fixes for use outside glibc, as follows:
5988 * tempname.c (struct_stat64): New macro.
5989 (direxists, __gen_tempname): Use it.
5990 This avoids a portability problem with Solaris 8.
5992 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5993 (<stddef.h>, <stdint.h>, <string.h>):
5994 Include only if STDC_HEADERS || _LIBC.
5995 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5996 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5997 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5998 (__set_errno): Define this macro if <errno.h> doesn't.
5999 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
6000 Define these macros if <stdio.h> doesn't.
6001 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
6002 Define these macros if <sys/stat.h>
6003 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
6004 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
6005 __xstat64): Define if not _LIBC.
6006 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
6007 (__gen_tempname): Invoke gettimeofday only if
6008 HAVE_GETTIMEOFDAY || _LIBC;
6009 otherwise, fall back on plain "time".
6010 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
6012 * mkstemp.c (__GT_FILE): Define to zero if not defined.
6014 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
6016 2001-02-17 Jim Meyering <meyering@lucent.com>
6018 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
6019 around included file name.
6021 * strnlen.c (__strnlen): Merge in a change from GNU libc.
6023 * strftime.c: Update from GNU libc (the only changes were to comments).
6025 2001-02-13 Bruno Haible <haible@clisp.cons.org>
6027 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
6029 2001-02-17 Paul Eggert <eggert@twinsun.com>
6031 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
6032 Remove workaround macros for hosts that have mbrtowc but not
6033 mbstate_t, as we now insist on proper declarations for both
6034 before using mbrtowc.
6036 2001-02-17 Jim Meyering <meyering@lucent.com>
6038 * regex.c: Update from libc.
6040 2001-02-16 Paul Eggert <eggert@twinsun.com>
6042 * alloca.c (malloc): Undef before defining, since stdlib.h
6043 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
6044 Reported by Mark Hounschell via Paul Eggert.
6046 2001-01-30 Bruno Haible <haible@clisp.cons.org>
6048 * config.charset: Update for FreeBSD 4.2.
6050 2001-01-26 Jim Meyering <meyering@lucent.com>
6052 * quotearg.c: Include stddef.h.
6053 * quote.c: Include stddef.h.
6054 Reported by Axel Kittenberger.
6056 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
6057 line in double quotes so that it evokes a better diagnostic.
6058 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
6059 Reported by Axel Kittenberger.
6061 2001-01-15 Bruno Haible <haible@clisp.cons.org>
6063 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
6064 to avoid a warning. Add back 'const' to inptr.
6066 2001-01-16 Jim Meyering <meyering@lucent.com>
6068 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
6071 2001-01-14 Jim Meyering <meyering@lucent.com>
6073 * rename.c: New file. From Volker Borchert.
6074 Include stdlib.h, string.h or strings.h, and xalloc.h.
6075 Use strip_trailing_slashes rather than open-coding it.
6077 2001-01-03 Paul Eggert <eggert@twinsun.com>
6079 * strftime.c: Sync with glibc time/strftime.c 1.81.
6081 2001-01-03 Jim Meyering <meyering@lucent.com>
6083 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
6084 local `inptr' to avoid warning with some system declarations of iconv.
6086 2000-12-29 Paul Eggert <eggert@twinsun.com>
6088 * modechange.c: Do not assume that mode_t uses the
6089 traditional octal encoding. E.g. "chmod 1 FOO" should set
6090 the other-execute bit of FOO even if S_IXOTH != 1.
6092 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
6093 WOTH, XOTH, ALLM): New macros.
6094 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
6095 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
6097 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
6098 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
6100 No need to use uintmax_t; unsigned long is long enough.
6101 Don't bother to get suffix since we don't use it.
6103 2000-12-24 Jim Meyering <meyering@lucent.com>
6105 * hash.c (is_prime): Return explicit boolean values.
6106 (hash_get_first): Return NULL to appease Irix5.6's 89.
6107 Reported by Nelson Beebe.
6109 2000-10-31 Bruno Haible <haible@clisp.cons.org>
6111 * localcharset.c (locale_charset): Add support for Win32.
6113 2000-12-18 Paul Eggert <eggert@twinsun.com>
6115 * physmem.h, physmem.c: New files.
6117 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
6118 (noinst_HEADERS): Add physmem.h.
6120 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
6121 't' for compatibility with Solaris 8 sort.
6123 2000-12-18 Bruno Haible <haible@clisp.cons.org>
6125 * config.charset: Add support for BeOS.
6127 2000-12-16 Jim Meyering <meyering@lucent.com>
6129 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
6130 SHELLS_FILE to a file name that's useful on djgpp systems.
6132 (ADDITIONAL_DEFAULT_SHELLS): Define.
6133 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
6134 Based mostly on a patch from Prashant TR.
6136 2000-12-16 Jim Meyering <meyering@lucent.com>
6138 This bug had a serious impact on chown: `chown N:M FILE' (for integer
6139 N and M) would have treated it like `chown N:N FILE'.
6141 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
6143 2000-10-31 Bruno Haible <haible@clisp.cons.org>
6145 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
6146 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
6147 to the list of canonical encodings. Rename EUC-CN to GB2312.
6149 2000-12-08 Andreas Schwab <schwab@suse.de>
6151 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
6152 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
6154 2000-12-07 Jim Meyering <meyering@lucent.com>
6156 * stripslash.c (ISSLASH): Define.
6157 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
6160 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
6161 (dir_name_r): Declare this function as static.
6162 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
6163 manifest itself on a name containing a mix of slashes and
6165 Make this function work with names starting with a DOS-style
6166 drive letter and colon prefix.
6167 (dir_name): Append `.' if necessary.
6168 Based mostly on patches from Prashant TR and Eli Zaretskii.
6170 * dirname.h (dir_name_r): Remove prototype.
6172 2000-12-05 Jim Meyering <meyering@lucent.com>
6174 * dirname.c (dir_name_r): Add `const' in a few local declarations.
6176 2000-12-04 Jim Meyering <meyering@lucent.com>
6178 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
6179 Also include memory.h, stdlib.h, unistd.h if appropriate.
6180 Reported by Andreas Jaeger (conflicting declaration of malloc).
6182 2000-12-02 Jim Meyering <meyering@lucent.com>
6184 * closeout.h: Make idempotent, to avoid some obscure warnings.
6186 2000-12-01 Paul Eggert <eggert@twinsun.com>
6188 * memrchr.c: Include <config.h> before any system include file.
6190 2000-11-29 Paul Eggert <eggert@twinsun.com>
6192 * dirname.c (dir_name_r): Fix typo: int -> size_t.
6194 2000-11-26 Jim Meyering <meyering@lucent.com>
6196 * memcoll.c: Include sys/types.h. From Werner Almesberger.
6198 2000-11-22 Paul Eggert <eggert@twinsun.com>
6200 * strftime.c (my_strftime): Do not invoke mbrlen with a
6201 size of (size_t) -1; it's not portable.
6203 2000-11-17 Akim Demaille <akim@epita.fr>
6205 * obstack.h: Formatting changes.
6206 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
6207 prevent type checking.
6208 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
6209 cast the value to (void *): assigning a `foo *' to a `void *'
6211 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
6213 2000-11-17 Jim Meyering <meyering@lucent.com>
6215 * strstr.c: Update from GNU libc.
6217 2000-11-16 Jim Meyering <meyering@lucent.com>
6219 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
6221 2000-11-11 Jim Meyering <meyering@lucent.com>
6223 * error.c: Add a couple #includes, merging from GNU libc version.
6225 2000-11-10 Jim Meyering <meyering@lucent.com>
6227 * obstack.h: Update from GNU libc.
6228 * obstack.c: Likewise.
6230 2000-11-06 Paul Eggert <eggert@twinsun.com>
6232 * getusershell.c (setusershell): Use rewind rather than
6233 fseek/fseeko, to avoid configuration hassles with fseeko.
6234 Don't bother opening SHELLS_FILE if shellstream is NULL;
6237 2000-11-05 Jim Meyering <meyering@lucent.com>
6239 * makepath.h (make_dir): Declare.
6240 * makepath.c (make_dir): Remove `static' attribute.
6243 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
6245 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
6246 last one in a bucket, advance to the next bucket.
6248 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
6250 * fnmatch.c: Do not comment out all the code if we are using
6251 the GNU C library, because in some cases we are replacing buggy
6252 code in the GNU C library itself.
6254 2000-10-30 Paul Eggert <eggert@twinsun.com>
6256 * error.h, getline.h, modechange.h:
6257 Remove "2000" from Copyright line, as the file hasn't been
6258 changed this year other than in the copyright notice.
6260 * xalloc.h: Add "2000" to Copyright line, as this file
6261 was changed this year.
6263 2000-10-30 Paul Eggert <eggert@twinsun.com>
6265 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
6266 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
6267 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
6269 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
6271 * regex.h (__restrict_arr): Move definition out of #ifndef block.
6272 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
6273 doesn't define __restrict_arr.
6275 2000-10-29 Jim Meyering <meyering@lucent.com>
6277 * xstat.in: Fix grammar in comment.
6279 2000-10-28 Jim Meyering <meyering@lucent.com>
6281 * memchr.c: Update from libc.
6282 Adjust for portability:
6283 [HAVE_STDLIB_H]: Include stdlib.h.
6284 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
6285 Undef __memchr, too.
6286 [!weak_alias]: Define __memchr to memchr.
6288 * regex.c: Update from libc.
6289 * regex.h: Likewise.
6290 * getopt1.c: Likewise.
6291 * memcmp.c: Likewise.
6293 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
6294 Avoid using fseek, when possible -- it's broken by design.
6295 Patch by Ulrich Drepper.
6297 2000-10-26 Jim Meyering <meyering@lucent.com>
6299 * strftime.c: Update from libc.
6301 2000-10-25 Jim Meyering <meyering@lucent.com>
6303 * obstack.c: Update from libc.
6305 2000-10-23 Jim Meyering <meyering@lucent.com>
6307 * hard-locale.c (hard_locale): Revert last change -- it was simply
6308 wrong. That set_locale call must not have any side effects.
6311 2000-10-22 Jim Meyering <meyering@lucent.com>
6313 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
6314 [CYCLIC]: Remove now-unused definition.
6316 * save-cwd.c (O_DIRECTORY): Define, if needed.
6317 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
6318 Suggestion from Ulrich Drepper.
6320 2000-10-21 Jim Meyering <meyering@lucent.com>
6322 * dirname.c (dir_name_r): New function, factored out of dir_name.
6323 (dir_name): Use dir_name_r.
6324 * dirname.h (dir_name_r): Declare it.
6326 2000-10-21 Jim Meyering <meyering@lucent.com>
6328 * dirname.c (memrchr): Declare if necessary.
6329 (dir_name): Remove the restriction that there be no
6330 trailing slashes. Now, this code skips past them, effectively
6332 [TEST_DIRNAME] (main): New unit tests.
6334 * memrchr.c: New file from GNU libc.
6335 Undef __memrchr, too.
6336 [!weak_alias]: Define __memrchr to memrchr.
6337 Guard weak_alias use with `#ifdef weak_alias'.
6339 2000-10-17 Jim Meyering <meyering@lucent.com>
6341 * quote.h (PARAMS): Define and use.
6342 Reported by Akim Demaille.
6344 * getopt.c: Update from libc.
6346 2000-10-16 Jim Meyering <meyering@lucent.com>
6348 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
6351 2000-09-25 Jim Meyering <meyering@lucent.com>
6353 * md5.h (rol): Define (from GnuPG).
6355 * sha.c: Give credit (GnuPG) where due.
6356 (M): Use rol rather than open-coding it.
6357 Add a FIXME comment.
6359 2000-09-21 Jim Meyering <meyering@lucent.com>
6361 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
6362 Reported by Michael Stone.
6364 2000-09-20 Jim Meyering <meyering@lucent.com>
6366 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
6367 (noinst_HEADERS): Add sha.h.
6368 Based on code from Scott G. Miller and from GnuPG.
6370 2000-09-15 Jim Meyering <meyering@lucent.com>
6372 * regex.c: Update from libc.
6374 2000-09-10 Jim Meyering <meyering@lucent.com>
6376 * getopt.c (_getopt_internal): Update from glibc.
6378 2000-09-09 Jim Meyering <meyering@lucent.com>
6380 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
6381 think it should be used as a general replacement for isascii.
6382 * fnmatch.c: Likewise.
6383 * mbswidth.c: Likewise
6384 * regex.c: Likewise.
6387 * userspec.c: Include sys/param.h and limits.h.
6389 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6390 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
6391 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
6392 UID, GID. Check range.
6394 2000-09-06 Jim Meyering <meyering@lucent.com>
6396 * getopt.c (_getopt_internal): Update from glibc.
6398 2000-08-30 Jim Meyering <meyering@lucent.com>
6400 * strftime.c: Merge in changes from GNU libc.
6402 2000-08-26 Jim Meyering <meyering@lucent.com>
6404 * closeout.c: Include "__fpending.h".
6405 (close_stdout_status): Return right away if there's nothing to flush.
6407 * Makefile.am (noinst_HEADERS): Add __fpending.h.
6408 * __fpending.c: New file.
6409 * __fpending.h: New file.
6411 2000-08-07 Paul Eggert <eggert@twinsun.com>
6413 Standardize on "memory exhausted" instead of "Memory exhausted"
6414 or "virtual memory exhausted".
6415 * obstack.c (print_and_abort): Use "memory exhausted", not
6416 "virtual memory exhausted".
6417 * same.c (same_name): Invoke xalloc_die instead of printing
6419 * userspec.c (parse_user_spec): Likewise.
6420 * bumpalloc.h: comment fix
6421 * same.c, userspec.c: Include xalloc.h.
6423 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6424 not char *const and pointing to a constant array.
6425 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6426 (xrealloc): Comment fix.
6428 * userspec.c (parse_user_spec):
6429 Don't translate a message until just before returning,
6430 to avoid unnecessary translation.
6432 2000-08-07 Jim Meyering <meyering@lucent.com>
6434 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6435 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6436 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6437 getgroups.c, gethostname.c, getopt.h, group-member.c,
6438 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6439 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6440 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6441 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6442 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6443 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6444 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6445 yesno.c: Back out Copyright date changes for each file with no change
6446 this year. This eases coordination with other programs using the same
6447 source code modules. From Paul Eggert.
6449 2000-08-03 Greg McGary <greg@mcgary.org>
6451 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6452 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6453 (EXTEND_BUFFER): Use them.
6455 2000-08-01 Jim Meyering <meyering@lucent.com>
6457 * dirname.c (ISSLASH): Define.
6458 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6459 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6460 both `\' and `/' may be use as path separators.
6461 Based on a patch from Prashant TR.
6463 2000-07-31 Paul Eggert <eggert@twinsun.com>
6465 * quotearg.c (quotearg_n_options): Don't make the initial
6466 slot vector a constant, since it might get modified.
6468 2000-07-31 Jim Meyering <meyering@lucent.com>
6470 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6471 * obstack.c (print_and_abort): Likewise.
6473 2000-07-30 Paul Eggert <eggert@twinsun.com>
6475 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6476 buffer, so that the caller can always quote one small
6477 component of a "memory exhausted" message in slot 0.
6478 From a suggestion by Jim Meyering.
6480 2000-07-30 Jim Meyering <meyering@lucent.com>
6482 * makepath.c (make_path): Quote the other instance, too.
6484 * quotearg.c (N_STATIC_SLOTVECS): Define.
6485 (STATIC_BUF_SIZE): Define.
6486 (quotearg_n_options): Use only statically allocated storage when
6487 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6488 than STATIC_BUF_SIZE.
6490 2000-07-29 Jim Meyering <meyering@lucent.com>
6492 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6493 * dirname.c (dir_name): Likewise.
6495 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6497 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6498 (dir_name): Assert that there are no trailing slashes.
6500 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6502 * mbswidth.h (mbswidth): Add a flags argument.
6503 (mbswidth): New declaration.
6504 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6505 * mbswidth.c (mbswidth): Add a flags argument.
6506 (mbsnwidth): New function.
6508 2000-07-24 Jim Meyering <meyering@lucent.com>
6510 * mbswidth.c: Remove useless #else. From Bruno Haible.
6512 2000-07-23 Paul Eggert <eggert@twinsun.com>
6514 * mbswidth.c (_XOPEN_SOURCE):
6515 Don't define; this causes problems on Solaris 7.
6516 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6518 2000-07-23 Paul Eggert <eggert@twinsun.com>
6521 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6522 so that mbstate_t is always defined.
6524 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6525 be 1 in at least one GCC installation, and this configuration
6526 error is likely to be common. Ignoring MB_LEN_MAX hurts
6527 performance on hosts that have mbrtowc but have only unibyte
6528 locales, but I assume these hosts are rare.
6530 2000-07-23 Paul Eggert <eggert@twinsun.com>
6532 * quotearg.c: Streamline by invoking multibyte code only if needed.
6533 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6534 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6535 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6536 invoke multibyte primitives.
6538 2000-07-23 Jim Meyering <meyering@lucent.com>
6540 * basename.c (base_name): Add an assertion.
6542 2000-07-15 Bruno Haible <clisp.cons.org>
6544 * quotearg.c: When the system forces us to redefine mbstate_t,
6545 shadow its mbsinit function.
6547 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6549 * mbswidth.h: New file.
6550 * mbswidth.c: New file.
6551 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6552 (noinst_HEADERS): Add mbswidth.h.
6554 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6556 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6559 2000-07-15 Jim Meyering <meyering@lucent.com>
6561 * makepath.c: Include quote.h.
6562 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6563 corresponding argument in a `quote (...)' call.
6564 Give better diagnostics.
6566 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6567 (noinst_HEADERS): Add quote.h.
6569 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6570 from tar's src/misc.c.
6571 * quote.h: New file. Prototypes for same.
6573 2000-07-10 Paul Eggert <eggert@twinsun.com>
6575 From a suggestion by Bruno Haible.
6576 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6577 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6578 to decide whether to define the BeOS workaround macro;
6579 this adjusts to the change to AC_MBSTATE_T.
6581 2000-07-13 Paul Eggert <eggert@twinsun.com>
6583 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6585 * quotearg.c (quoting_style_args, quoting_style_vals,
6586 quotearg_buffer_restyled): Add support for
6587 clocale_quoting_style. Undo previous change to
6588 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6589 and "{RIGHT QUOTATION MARK}" msgids.
6591 2000-07-05 Paul Eggert <eggert@twinsun.com>
6593 The old behavior of quoting `like this' doesn't look good with
6594 newer, ISO-style fonts. See:
6595 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6597 Instead, quote "like this" by default. Let the translator
6598 tailor the locale-specific quoting behavior by providing
6599 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6601 * quotearg.c (N_): New macro.
6602 (gettext_default): New function.
6603 (quotearg_buffer_restyled): Use
6604 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6605 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6607 2000-07-09 Jim Meyering <meyering@lucent.com>
6609 * Most files: Update copyright dates to include 2000.
6611 2000-07-08 Jim Meyering <meyering@lucent.com>
6613 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6615 (xgethostname): Remove now-unnecessary #ifdef.
6616 Move declaration of `err' into loop where it's used.
6618 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6620 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6621 by allocating a larger buffer. Test the gethostname return value for
6622 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6623 returns an error and ENAMETOOLONG isn't defined.
6625 2000-07-05 Paul Eggert <eggert@twinsun.com>
6626 and Bruno Haible <haible@clisp.cons.org>
6628 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6630 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6632 * quotearg.c (struct quoting_options): Simplify quote_these_too
6635 2000-07-03 Jim Meyering <meyering@lucent.com>
6637 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6638 Reported by Bruno Haible.
6640 2000-07-04 Jim Meyering <meyering@lucent.com>
6642 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6643 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6646 2000-07-03 Paul Eggert <eggert@twinsun.com>
6647 and Bruno Haible <haible@clisp.cons.org>
6649 * quotearg.c (mbrtowc):
6650 Assign to *pwc, and return 1 only if result is nonzero.
6651 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6653 2000-07-03 Jim Meyering <meyering@lucent.com>
6655 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6656 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6659 2000-07-02 Jim Meyering <meyering@lucent.com>
6661 * quotearg.c (mbstate_t): Don't define here.
6663 2000-07-02 Jim Meyering <meyering@lucent.com>
6665 * nanosleep.c (SIGCONT): Define if not already defined.
6667 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6669 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6670 per change in ../m4/ls-mntd-fs.m4.
6671 (read_filesystem_list): Ignore symbolic links.
6673 2000-06-29 Jim Meyering <meyering@lucent.com>
6675 * same.c: Include <string.h> or <strings.h>, as appropriate,
6676 for declaration of strcmp.
6678 * long-options.c: Include <stdlib.h>, for declaration of exit.
6680 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6681 Avoid warning by casting result to `char *' to remove `const'.
6683 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6685 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6687 2000-06-26 Paul Eggert <eggert@twinsun.com>
6689 savedir now sets errno on failure and invokes xmalloc to get memory.
6690 Fix a couple of other minor bugs while we're at it.
6692 * savedir.c (<unistd.h>): Do not include; there's no need.
6693 (NAMLEN): Remove macro.
6694 (malloc, realloc): Remove decls.
6696 ("xalloc.h"): Include.
6697 (NAME_SIZE_DEFAULT): New macro.
6698 (savedir): Use xmalloc / xrealloc to allocate memory.
6699 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6700 Skip "" directory entries.
6701 Use strlen to calculate directory entry length, since the old method
6702 is rarely used these days and isn't worth supporting.
6703 Don't use a pointer after freeing it.
6704 Check for integer overflow when calculating allocation size.
6705 Use memcpy to copy entries, instead of stpcpy.
6706 Set errno properly when returning NULL.
6707 Check for readdir error.
6709 2000-06-26 Jim Meyering <meyering@lucent.com>
6711 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6713 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6715 * getusershell.c (xmalloc, xrealloc): Remove functions.
6717 Don't include <stdlib.h>. Don't declare malloc, realloc.
6719 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6721 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6723 2000-06-24 Jim Meyering <meyering@lucent.com>
6725 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6727 2000-06-21 Jim Meyering <meyering@lucent.com>
6729 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6731 2000-06-19 Paul Eggert <eggert@twinsun.com>
6733 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6734 (mbrtowc, mbstate_t): Define substitutes if
6735 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6736 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6737 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6739 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6741 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6742 than 1024, return a memory chunk of least possible size, instead
6743 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6744 Use free/xmalloc instead of xrealloc to avoid copying for very long
6747 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6749 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6750 address, not strdup. Include <stdlib.h> and don't declare free().
6752 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6754 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6757 2000-06-21 Jim Meyering <meyering@lucent.com>
6759 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6760 (noinst_HEADERS): Add getstr.h.
6762 * getline.c (getstr): Move into a separate file.
6763 * getstr.c (getstr): New file, extracted from getline.c, with
6764 the following changes: new parameter, delim2; both delim[12]
6765 parameters have type `int', not `char'. The latter would lose
6766 with 8-bit delimiters.
6767 * getstr.h: New file.
6769 2000-06-19 Jim Meyering <meyering@lucent.com>
6771 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6773 2000-06-18 Jim Meyering <meyering@lucent.com>
6775 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6776 Besides, these days every porting target provides a mkdir function.
6778 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6779 (this snippet comes from src/system.h).
6781 2000-06-15 Paul Eggert <eggert@twinsun.com>
6783 * human.c (adjust_value): New function.
6784 (human_readable_inexact): Apply rounding style even when
6785 printing approximate values.
6787 2000-06-14 Paul Eggert <eggert@twinsun.com>
6789 * human.c (human_readable_inexact): Allow an input block
6790 size that is not a multiple of the output block size, and vice versa.
6791 Reported by Piergiorgio Sartor.
6793 2000-06-14 Paul Eggert <eggert@twinsun.com>
6795 * getdate.y (get_date): Apply relative times after time
6796 zone indicator, not before. Reported by Todd A. Jacobs.
6798 2000-06-13 Jim Meyering <meyering@lucent.com>
6800 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6802 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6804 2000-06-12 Paul Eggert <eggert@twinsun.com>
6806 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6808 2000-06-04 Paul Eggert <eggert@twinsun.com>
6810 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6812 2000-06-04 Jim Meyering <meyering@lucent.com>
6814 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6815 SunOS 4.1.4 for which gid_t is an unsigned type.
6817 2000-06-03 Jim Meyering <meyering@lucent.com>
6819 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6821 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6823 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6824 newer, don't install charset.alias.
6825 * config.charset: Change the Linux/glibc rules so they become empty
6826 on glibc-2.1 or newer.
6828 2000-06-02 Jim Meyering <meyering@lucent.com>
6830 * mountlist.c: Back out last change. Instead, do this...
6831 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6832 member using the same `ignore'-testing code.
6833 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6837 2000-05-29 Jim Meyering <meyering@lucent.com>
6839 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6840 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6842 2000-05-22 Jim Meyering <meyering@lucent.com>
6844 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6846 2000-05-18 Jim Meyering <meyering@lucent.com>
6848 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6849 back, too, since it may have been modified by allocate_entry.
6850 (hash_delete): Rewrite to use neither the assignment operator
6851 nor the comma operator in an if-expression.
6853 2000-05-15 Paul Eggert <eggert@twinsun.com>
6856 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6857 Remove; no longer needed.
6858 "quotearg.h": Add include.
6859 (file_name): Do not bother to explicitly initialize to NULL; it's less
6860 efficient on some hosts.
6861 (close_stdout_status): Remove test as to whether stdout was already
6862 closed; it breaks for the case "echo x | sort >&-".
6863 Quote file name colons.
6864 Do not assume that _("write error") lacks format strings.
6866 2000-05-15 Jim Meyering <meyering@lucent.com>
6868 * version-etc.c (version_etc_copyright): Update the copyright string
6869 used in all --version output.
6871 2000-05-14 Jim Meyering <meyering@lucent.com>
6873 * closeout.c (close_stdout_set_file_name): New function.
6874 (close_stdout_status): Use new file-scoped global.
6875 Return right away if fstat says the stdout file descriptor is invalid.
6876 * closeout.h (close_stdout_set_file_name): Declare.
6878 2000-05-10 Jim Meyering <meyering@lucent.com>
6880 * closeout.c [default_exit_status]: New file-scoped variable.
6881 (close_stdout_set_status): New function.
6882 * closeout.h (close_stdout_set_status): Declare.
6884 2000-05-08 Jim Meyering <meyering@lucent.com>
6886 * long-options.c: Don't include closeout.h.
6887 (parse_long_options): Don't call close_stdout for --version.
6889 2000-05-06 Jim Meyering <meyering@lucent.com>
6891 * strnlen.c: Undefine __strnlen and strnlen.
6892 [!weak_alias]: Define __strnlen to strnlen.
6894 * atexit.c: New file, from libiberty.
6896 2000-05-06 Jim Meyering <meyering@lucent.com>
6898 * closeout.c (close_stdout_status): Also check for errors on the
6901 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6903 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6904 instead of xmalloc, xrealloc, path_concat.
6905 (locale_charset): Treat empty environment variables as absent.
6906 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6908 2000-05-04 Jim Meyering <meyering@lucent.com>
6910 * getopt.c: Update from glibc.
6911 * obstack.c: Likewise.
6912 * obstack.h: Likewise.
6913 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6915 * regex.h: Likewise.
6916 * strndup.c: Likewise.
6917 * strnlen.c: New file, from glibc.
6919 2000-05-01 Jim Meyering <meyering@lucent.com>
6921 * full-write.c (full_write): Remove `FIXME' part of comment.
6923 2000-04-29 Jim Meyering <meyering@lucent.com>
6925 * path-concat.c: Declare strdup only if it's not defined.
6926 * canon-host.c: Likewise.
6928 2000-04-28 Jim Meyering <meyering@lucent.com>
6930 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6931 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6932 included first, then limits.h is included by locale.h by libintl.h.
6933 From John David Anglin.
6935 2000-04-25 Jim Meyering <meyering@lucent.com>
6937 * makepath.c (S_IRWXUGO): Define.
6938 (make_path): Always perform explicit chmod if MODE specifies any
6939 of the `special' permission bits. Prompted by a bug report against
6940 install from Mate Wierdl and Joost van Baal.
6942 2000-04-18 Jim Meyering <meyering@lucent.com>
6946 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6947 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6949 2000-04-17 Jim Meyering <meyering@lucent.com>
6951 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6952 the definition of it to rpl_strftime also defined-away the system's
6955 2000-04-15 Jim Meyering <meyering@lucent.com>
6957 Use `C' to denote so-called `contiguous' files, the same way
6959 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6960 (ftypelet): Use S_ISCTG.
6961 From Michael Deutschmann.
6963 2000-04-14 Jim Meyering <meyering@lucent.com>
6965 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6967 2000-04-08 Jim Meyering <meyering@lucent.com>
6969 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6970 names don't conflict. Reported by Eli Zaretskii.
6972 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6974 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6975 bug. Deal with the different error behavior of Irix iconv.
6977 2000-04-07 Jim Meyering <meyering@lucent.com>
6979 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6980 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6982 2000-04-05 Jim Meyering <meyering@lucent.com>
6984 Portability tweaks required for ultrix4.3.
6985 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6986 * readutmp.c: Include sys/types.h before sys/stat.h.
6987 * canon-host.c: Declare strdup.
6988 * path-concat.c: Likewise.
6989 From John David Anglin.
6991 2000-04-04 Jim Meyering <meyering@lucent.com>
6993 Be more DOS 8.3-friendly.
6994 * ref-add.sin: Renamed from ref-add.sed.in.
6995 * ref-del.sin: Renamed from ref-del.sed.in.
6996 * Makefile.am: Reflect renaming.
6997 Reported by Eli Zaretskii.
6999 Use a temporary file name that won't clash with `charset.alias'
7000 in the DOS 8.3 name space.
7001 * Makefile.am (charset_tmp): Define.
7002 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
7003 (uninstall-local): Likewise.
7004 Reported by Eli Zaretskii.
7006 2000-03-29 Paul Eggert <eggert@twinsun.com>
7008 * time/strftime.c (my_strftime): Make sure we call the system
7009 strftime, not ourselves, when invoking the underlying strftime.
7011 2000-03-24 Jim Meyering <meyering@lucent.com>
7013 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
7014 (charset_alias): Define.
7015 (install-exec-local): Factor out common code.
7016 (uninstall-local): Split lines longer than 80.
7017 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
7019 (.sed.in.sed): New rule. Don't redirect directly to $@.
7020 (CLEANFILES): Add ref-add.sed and ref-del.sed.
7022 2000-03-19 Bruno Haible <haible@clisp.cons.org>
7024 * config.charset: Output a line containing "Packages using this file".
7025 * ref-add.sed.in, ref-del.sed.in: New files.
7026 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
7027 ref-del.sed): New rules.
7029 2000-03-17 Jim Meyering <meyering@lucent.com>
7031 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
7032 Otherwise, include <strings.h>
7034 2000-03-17 Bruno Haible <haible@clisp.cons.org>
7036 * unicodeio.c (utf8_wctomb): New function.
7037 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
7038 format instead of in UCS-4 with platform dependent endianness.
7040 2000-03-07 Paul Eggert <eggert@twinsun.com>
7042 * savedir.c (savedir): Work even if directory size is
7043 negative; this can happen with some screwy NFS configurations.
7045 2000-03-06 Jim Meyering <meyering@lucent.com>
7047 * localcharset.c (get_charset_aliases): Don't try to free file_name
7048 if it's NULL (because we ran out of memory). From Bruno Haible.
7050 2000-03-05 Jim Meyering <meyering@lucent.com>
7052 * localcharset.c ("path-concat.h"): Include.
7053 (get_charset_aliases): Use path_concat instead of ANSI string
7056 * unicodeio.h (PARAMS): Define.
7057 Use it to guard prototype.
7059 2000-03-04 Jim Meyering <meyering@lucent.com>
7061 * Makefile.am (install-exec-local): Create $(libdir) before installing
7063 (uninstall-local): Uncomment this rule so `make distcheck' works
7066 * unicodeio.c (<errno.h>): Include it.
7067 (errno): Declare if not defined.
7069 * localcharset.c: Add Bruno's comment justifying use of volatile.
7071 * config.charset: New version, incorporating remarks from a linux
7072 i18n mailing list. From Bruno Haible.
7074 2000-03-02 Jim Meyering <meyering@lucent.com>
7076 * Makefile.am (EXTRA_DIST): Add config.charset.
7078 2000-03-01 Jim Meyering <meyering@lucent.com>
7080 * localcharset.c: Guard some #includes with `#if HAVE_...'.
7081 * unicodeio.c: Likewise.
7083 2000-02-02 Bruno Haible <haible@clisp.cons.org>
7085 * config.charset: New file.
7086 * localcharset.c: New file.
7087 * unicodeio.h, unicodeio.c: New files.
7088 * Makefile.am (DEFS): Add -DLIBDIR=...
7089 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
7090 (noinst_HEADERS): Add unicodeio.h.
7091 (all-local, install-exec-local, charset.alias): New targets.
7093 2000-02-28 Paul Eggert <eggert@twinsun.com>
7095 * quotearg.c (ALERT_CHAR): New macro.
7096 (quotearg_buffer_restyled): Use it.
7098 2000-02-27 Jim Meyering <meyering@lucent.com>
7100 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
7101 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
7103 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
7104 not `#if STDC_HEADERS'.
7105 Declare malloc if needed.
7107 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
7108 now that autoconf always defines the HAVE_DECL_ symbols.
7109 * human.c: Likewise.
7111 * strtoumax.c: Likewise.
7113 * backupfile.c: Arrange for cpp to fail if the configure-time
7114 declaration check was not run.
7116 * human.c: Likewise.
7118 * strtoumax.c: Likewise.
7120 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
7121 then first look up the entire `.'-containing string as a login name.
7123 2000-02-18 Paul Eggert <eggert@twinsun.com>
7125 * getdate.y: Handle two-digit years with leading zeros correctly.
7126 (textint): New typedef.
7127 (parser_control): Member year changed from int to textint.
7129 (YYSTYPE): Removed; replaced by %union with int and textint members.
7130 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
7131 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
7132 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
7133 (tSNUMBER, tUNUMBER): Now of type <textintval>.
7134 (date, number, to_year): Use width of number in digits, not its value,
7135 to determine whether it's a 2-digit year, or a 2-digit time.
7136 (yylex): Store number of digits of numeric tokens.
7137 Reported by John Kendall.
7139 (parser_control): Changed from struct parser_control to typedef (for
7140 consistency). All uses changed.
7142 (tID): Removed; not used.
7143 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
7145 2000-02-14 Paul Eggert <eggert@twinsun.com>
7147 * getpagesize.h (getpagesize): Port to VMS for Alpha;
7148 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
7150 2000-02-12 Jim Meyering <meyering@lucent.com>
7152 * userspec.c (ISDIGIT): Define it.
7153 (isdigit): Remove definition.
7154 (is_number): Use ISDIGIT, not isdigit.
7155 <libintl.h>: Include.
7157 (parse_user_spec): Mark translatable strings.
7159 2000-02-10 Jim Meyering <meyering@lucent.com>
7161 With these changes, nanosleep.[ch] are finally enough like the other
7162 lib/* replacement files to compile on a few more losing systems.
7164 * nanosleep.h: Don't include config.h.
7165 Remove prototype from declaration of nanosleep.
7166 (PARAMS): Remove now-unneeded definition.
7167 * nanosleep.c: #undef nanosleep.
7168 (rpl_nanosleep): Rename from nanosleep.
7170 2000-02-03 Jim Meyering <meyering@lucent.com>
7172 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
7173 rather than with `#if HAVE_UTMPNAME'.
7175 2000-02-01 Jim Meyering <meyering@lucent.com>
7177 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
7179 2000-01-31 Jim Meyering <meyering@lucent.com>
7181 * nanosleep.h (nanosleep): Guard declaration with
7182 `#if ! HAVE_DECL_NANOSLEEP'.
7183 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
7184 the declaration in that vendor's sys/timers.h.
7185 Reported by Christian Krackowizer.
7187 * quotearg.c (ISASCII): Add #undef and move definition to follow
7188 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
7189 (ISPRINT): Likewise.
7190 Reported by Tom Tromey.
7192 2000-01-30 Jim Meyering <meyering@lucent.com>
7194 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
7195 uses of ->ut_name. The latter doesn't work with new Linux header files
7196 where only utmpx.ut_user is declared.
7198 * readutmp.h (UT_USER): Define.
7200 2000-01-23 Jim Meyering <meyering@lucent.com>
7202 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
7205 2000-01-22 Jim Meyering <meyering@lucent.com>
7207 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
7208 [! HAVE_DECL_STRTOULL]: Declare strtoull.
7209 Required for some AIX systems. Reported by Christian Krackowizer.
7210 [TESTING] (main): New function.
7212 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
7213 * dirname.c (dir_name): Support for DOS-style file names with drive
7216 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
7218 * strverscmp.c (ISDIGIT): Define.
7219 (strverscmp): Use ISDIGIT, not isdigit.
7221 2000-01-17 Paul Eggert <eggert@twinsun.com>
7223 * nanosleep.c (nanosleep):
7224 Don't use SA_INTERRUPT to decide whether to call sigaction, as
7225 POSIX.1 doesn't require SA_INTERRUPT and some systems
7226 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
7227 it's been part of POSIX.1 since day 1 (in 1988).
7229 2000-01-17 Jim Meyering <meyering@lucent.com>
7231 * interlock: Remove unused file. Reported by François Pinard.
7233 2000-01-16 Paul Eggert <eggert@twinsun.com>
7235 * quotearg.c (quotearg_buffer_restyled): Do not quote
7236 alert, backslash, formfeed, and vertical tab unnecessarily in
7237 shell quoting style.
7240 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
7241 Free Software Foundation, Inc.
7242 Copying and distribution of this file, with or without modification,
7243 are permitted provided the copyright notice and this notice are preserved.