1 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
4 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
5 Define, since POSIX requires it as of 2001.
6 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
7 New private symbol, used to keep the enum signed in all cases.
8 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
9 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
11 * regex_internal.c (re_string_skip_chars, register_state):
13 Remove forward decls; no longer needed now that we use prototypes.
14 * regexec.c (acquire_init_state_context, check_halt_node_context):
15 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
16 (clean_state_log_if_needed): Likewise.
18 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
20 Fix problems reported by Sam Steingold in
21 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
22 * regexec.c (sift_states_bkref): Fix portability bug: the code
23 assumed that reg_errcode_t is a signed type, which is not
24 necessarily true if _XOPEN_SOURCE is not defined.
25 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
26 some compilers warn about it otherwise.
28 2005-08-20 Jim Meyering <jim@meyering.net>
30 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
33 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
35 * regcomp.c (create_initial_state): Remove duplicate decl.
36 (init_word_char, create_initial_state, duplicate_node_closure):
37 (fetch_token, peek_token_bracket, build_range_exp):
38 (build_collating_symbol): Remove forward decls; no longer needed
39 now that we use prototypes.
42 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
43 (re_compile_fastmap_iter, regcomp, regerror, regfree):
44 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
45 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
46 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
47 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
48 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
49 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
50 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
51 (build_range_exp, build_collating_symbol, parse_bracket_exp):
52 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
53 (build_charclass, build_charclass_op, fetch_number, create_tree):
54 (create_token_tree, mark_opt_subexp, duplicate_tree):
55 Use prototypes rather than old-style definitions.
58 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
59 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
60 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
61 (re_string_reconstruct, re_string_peek_byte_case):
62 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
63 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
64 (re_node_set_init_copy, re_node_set_add_intersect):
65 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
66 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
67 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
68 (re_acquire_state, re_acquire_state_context, register_state):
69 (create_ci_newstate, create_cd_newstate, free_state):
71 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
72 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
73 (re_search_internal, prune_impossible_nodes):
74 (acquire_init_state_context, check_matching, static):
75 (check_halt_node_context, check_halt_state_context, proceed_next_node):
76 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
77 (update_regs, sift_states_backward, build_sifted_states):
78 (clean_state_log_if_needed, merge_state_array):
79 (update_cur_sifted_state, add_epsilon_src_nodes):
80 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
81 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
82 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
83 (find_recover_state, check_subexp_matching_top, transit_state_mb):
84 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
85 (check_arrival, check_arrival_add_next_nodes):
86 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
87 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
88 (check_node_accept_bytes, check_node_accept, extend_buffers):
89 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
90 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
95 (re_string_allocate, re_string_construct, re_string_reconstruct):
96 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
97 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
98 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
99 (re_string_context_at, re_string_peek_byte_case):
100 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
101 is defined, since we now use prototypes always.
103 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
104 C89 or better. All uses removed.
106 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
108 * regex_internal.c (re_acquire_state, re_acquire_state_context)
109 [defined lint]: Suppress bogus uninitialized-variable warnings.
111 * regcomp.c (duplicate_node): Return new index, not an error code,
112 and let the caller return REG_ESPACE if out of space. This
113 removes an uninitialied-variable warning with GCC 4.0.1, and also
114 avoids taking the address of a local variable. All callers
117 2005-08-19 Jim Meyering <jim@meyering.net>
119 * regexec.c (proceed_next_node): Redo local variables to
120 avoid GCC shadowing warnings.
122 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
124 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
125 (re_node_set_insert_last, re_dfa_add_node):
126 Rename local variables to avoid GCC shadowing warnings.
128 2005-08-18 Bruno Haible <bruno@clisp.org>
130 * strstr.c (strstr): Fix return value in multibyte case.
131 * strcasestr.c (strcasestr): Likewise.
133 2005-08-17 Jim Meyering <jim@meyering.net>
135 Make the %s format (seconds since the epoch) work for a negative
136 number and when used with a zero-padded field width, e.g. %015s.
138 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
139 label so that it precedes the code to set `digits'. Otherwise,
140 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
141 print `00-22'. Now, it prints `-0022', as it should.
143 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
145 * regex.h: Remove useless space-before-tab. From coreutils.
147 2005-08-17 Bruno Haible <bruno@clisp.org>
149 * strcasestr.h: New file.
150 * strcasestr.c: New file.
152 2005-08-17 Bruno Haible <bruno@clisp.org>
154 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
155 * strstr.c: Completely rewritten, with multibyte locale support.
157 2005-08-17 Bruno Haible <bruno@clisp.org>
159 * strcasecmp.c: Use mbuiter.h.
161 2005-08-17 Bruno Haible <bruno@clisp.org>
163 * mbuiter.h: New file.
165 2005-08-16 Bruno Haible <bruno@clisp.org>
167 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
169 (mbi_avail, mbi_advance): Let the iteration end before the terminating
170 NUL byte, not after it.
172 2005-08-16 Bruno Haible <bruno@clisp.org>
174 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
175 the valid ones. Makes the comparison operations transitive:
176 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
177 * strcasecmp.c (strcasecmp): Use mb_casecmp.
179 2005-08-16 Bruno Haible <bruno@clisp.org>
181 * strcase.h (strcasecmp): Add note in comments.
182 * strncasecmp.c: Use code from strcasecmp.c.
183 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
184 (strcasecmp): Work correctly in multibyte locales.
186 2005-08-16 Bruno Haible <bruno@clisp.org>
188 * strnlen1.h: New file.
189 * strnlen1.c: New file.
191 2005-08-16 Bruno Haible <bruno@clisp.org>
193 * mbfile.h: New file.
195 2005-08-16 Bruno Haible <bruno@clisp.org>
197 * mbiter.h: New file.
199 2005-08-16 Bruno Haible <bruno@clisp.org>
201 * mbchar.h: New file.
202 * mbchar.c: New file.
204 2005-08-16 Bruno Haible <bruno@clisp.org>
206 * tls.h: New file, from GNU gettext.
207 * tls.c: New file, from GNU gettext.
209 2005-08-15 Bruno Haible <bruno@clisp.org>
211 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
214 2005-08-14 Jim Meyering <jim@meyering.net>
218 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
219 Use the hash-table-based cycle-detection code not just when
220 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
221 Reported by James Youngman in
222 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
223 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
224 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
225 This lets us compile with -DFTS_DEBUG, once again.
226 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
227 * fts.c (fd_safer): Remove decl.
228 Include fcntl--.h rather than unistd-safer.h
229 (fts_safe_changedir): Don't call fd_safer; no longer needed
230 now that we include fcntl--.h.
232 2005-08-11 Simon Josefsson <jas@extundo.com>
234 * readline.h, readline.c: New file.
236 2005-08-11 Bruno Haible <bruno@clisp.org>
238 * strnlen.h (strnlen): Change parameter name to match comment.
240 2005-08-10 Simon Josefsson <jas@extundo.com>
242 * strndup.c: Use strnlen.h.
244 * strnlen.h: New file.
246 2005-08-02 Simon Josefsson <jas@extundo.com>
248 * getline.h, getline.c: Rewrite.
250 * getdelim.h, getdelim.c: New files, ported from glibc.
252 2005-07-31 Bruno Haible <bruno@clisp.org>
254 * lock.h (gl_lock_initializer): New macro.
255 (gl_lock_define_initialized): Use it.
256 (gl_rwlock_initializer): New macro.
257 (gl_rwlock_define_initialized): Use it.
258 (gl_recursive_lock_initializer): New macro.
259 (gl_recursive_lock_define_initialized): Use it.
261 2005-07-26 Bruno Haible <bruno@clisp.org>
263 * lock.h: Update from GNU gettext.
264 * lock.c: Update from GNU gettext.
266 2005-07-18 Bruno Haible <bruno@clisp.org>
268 * lock.h (gl_once_t): New type.
269 (gl_once_define, gl_once): New macros.
270 * lock.c (fresh_once): New variable.
271 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
274 2005-07-18 Simon Josefsson <jas@extundo.com>
276 * check-version.c (check_version): Accept identical versions too.
278 2005-07-18 Bruno Haible <bruno@clisp.org>
280 * lock.h: New file, from GNU gettext.
281 * lock.c: New file, from GNU gettext.
283 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
285 * quotearg.c: Add translator comment suggested by Bruno Haible,
288 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
290 * version-etc-fsf.c (version_etc_copyright): Parameterize the
291 copyright symbol and the year.
292 * version-etc.c (COPYRIGHT_YEAR): New constant.
293 (version_etc_va): Use parameterized copyright notice.
294 Reword to conform to the current GNU coding standards.
296 2005-07-11 Simon Josefsson <jas@extundo.com>
298 * size_max.h: New file.
300 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
302 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
305 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
306 and Paul Eggert <eggert@cs.ucla.edu>
308 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
309 in wint_t, not wchar_t. Remove now-unnecessary cast.
311 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
313 * regex.c, regex.h: Sync from libc.
314 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
315 New files, synced from libc, except that regex_internal.h
316 currently has a small porting fix.
318 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
320 Remove the dependency of the strftime module on the tzset module.
321 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
322 Copy the input structure, to work around some of the bug with
323 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
324 Solaris releases, you should also use the tzset module, but we won't
325 require it as a dependency any more since we don't want LGPLed code
326 to depend on GPLed code.
328 2005-07-02 Jim Meyering <jim@meyering.net>
330 * backupfile.c (backup_args): Change a `0' to NULL.
332 2005-07-01 Jim Meyering <jim@meyering.net>
334 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
335 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
336 * save-cwd.c, tempname.c:
337 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
338 and don't include <sys/file.h>).
340 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
342 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
343 declares only 'struct timespec;' (!).
345 2005-06-29 Jim Meyering <jim@meyering.net>
347 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
348 type name. Use the variable name instead.
349 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
351 2005-06-28 Simon Josefsson <jas@extundo.com>
353 * check-version.h, check-version.c: New files.
355 2005-06-28 Simon Josefsson <jas@extundo.com>
357 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
358 collision with global variable. Better indentation. Don't
359 increment buffer pointer beyond buffer end. Based on comments
360 from Paul Eggert <eggert@cs.ucla.edu>.
364 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
366 * canon-host.c (canon-host): Append trailing "," to 0 in
367 initializer of struct addrinfo, as an indication that we don't
368 care how many members the structure has.
370 2005-06-24 Derek Price <derek@ximbiot.com>
371 and Bruno Haible <bruno@clisp.org>
373 Remove stat module & update lstat.
374 * stat.c: Remove this file...
375 (slash_aware_lstat): ...moving this content and its support...
376 * lstat.c (rpl_lstat): ...into here.
379 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
381 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
382 (ranged_convert): Don't save conversion in a temporary struct.
383 This causes a warning with GCC 4.0.0, and anyway in the typical
384 case it's not worth the extra 100 bytes or so of code.
385 (ranged_convert, __mktime_internal): When calling a function via a
386 pointer P, use P () rather than (*P) (), as we now assume C89 or
389 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
391 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
392 "who -r" failed to give output. Problem reported by Tim Waugh.
394 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
395 (xcalloc): Use it to avoid needless tests.
396 Problem reported by Jim Meyering.
398 2005-06-16 Jim Meyering <jim@meyering.net>
400 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
401 when either N or S is zero.
403 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
405 * argp.h (__option_is_short): Check upper limit of
406 __key. Isprint() requires its argument to have the value
407 of an unsigned char or EOF.
409 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
411 * fnmatch.c (fnmatch): If there is an encoding error in a
412 multibyte string or pattern, fall back on unibyte matching.
413 Problem reported by James Youngman.
415 2005-06-08 Bruno Haible <bruno@clisp.org>
417 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
420 2005-06-08 Bruno Haible <bruno@clisp.org>
422 * csharpcomp.h: New file, from GNU gettext.
423 * csharpcomp.c: New file, from GNU gettext.
424 * csharpcomp.sh.in: New file, from GNU gettext.
426 2005-06-07 Derek Price <derek@ximbiot.com>
429 * glob_.h: Indent nested #ifdef.
431 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
434 Use "file name" when talking about file names, instead of "filename"
435 or "path", as per the GNU coding standards.
436 * mkdir-p.c: Renamed from makepath.c.
437 (make_dir_parents): Renamed from make_path. All callers changed.
438 * mkdir-p.h: Likewise. All includers changed.
439 * filenamecat.c: Renamed from path-concat.c.
440 (file_name_concat): Renamed from path_concat. All callers changed.
441 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
442 * filenamecat.h: Likewise. All includers changed.
443 * acl.c: Don't use "path" or "filename" to mean "file name"
444 in comments or local variable names.
445 * basename.c: Likewise.
446 * canonicalize.c, canonicalize.h: Likewise.
447 * dirname.c, dirname.h: Likewise.
448 * euidaccess.c: Likewise.
449 * exclude.c: Likewise
450 * fnmatch_.h, fnmatch_loop.c: Likewise.
451 * fsusage.c, fsuage.h: Likewise.
452 * fts.c, fts_.h: Likewise.
453 * getcwd.c: Likewise.
454 * getloadavg.c: Likewise.
455 * mkstemp.c: Likewise.
456 * mountlist.c, mountlist.h: Likewise.
457 * openat.c, openat.h: Likewise.
458 * readlink-stub.c: Likewise.
459 * readutmp.c, readutmp.h: Likewise.
460 * rename.c: Likewise.
463 * savedir.c: Likewise.
464 * stripslash.c: Likewise.
465 * tempname.c: Likewise.
466 * xreadlink.c: Likewise.
467 * exclude.c (excluded_file_name): Renamed from excluded_filename.
469 * exclude.h: Likewise.
471 * euidaccess.c (getuid, getgid, getuid, getegid)
472 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
473 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
474 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
475 * pathmax.h: Include <limits.h> unconditionally, since other
476 files have been getting away with it for years (MORE/BSD 4.3
478 * userspec.c (getpwnam, getgrnam, getgrgid)
479 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
481 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
482 Define to 256, not 255, as per modern POSIX.
484 2005-06-01 Bruno Haible <bruno@clisp.org>
486 * csharpexec.h: New file, from GNU gettext.
487 * csharpexec.c: New file, from GNU gettext.
488 * csharpexec.sh.in: New file, from GNU gettext.
490 2005-05-31 Derek Price <derek@ximbiot.com>
491 Paul Eggert <eggert@cs.ucla.edu>
494 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
496 2005-05-29 Derek Price <derek@ximbiot.com>
497 Paul Eggert <eggert@cs.ucla.edu>
499 * glob_.h, glob.c: New files.
501 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
503 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
505 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
506 the configuration hassle isn't worth it.
507 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
508 (LONGEST_MODIFIER, PRIuMAX): Remove.
510 2005-05-27 Bruno Haible <bruno@clisp.org>
512 * getlogin_r.h: Remove second include of <stddef.h>.
514 2005-05-25 Bruno Haible <bruno@clisp.org>
515 Derek Price <derek@ximbiot.com>
517 * getlogin_r.h: Simplify API documentation.
519 2005-05-25 Derek Price <derek@ximbiot.com>
520 Paul Eggert <eggert@cs.ucla.edu>
522 * getlogin_r.c, getlogin_r.h: New files.
524 2005-05-22 Bruno Haible <bruno@clisp.org>
526 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
527 Also include <sys/param.h> if it defines MIN, MAX.
528 Based on a patch by Derek Price <derek@ximbiot.com>.
530 2005-05-22 Bruno Haible <bruno@clisp.org>
532 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
533 (INT64_MIN): Fix definition.
534 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
536 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
537 NEED_SIGNED_INT_TYPES.
539 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
540 HAVE_SYSTEM_INTTYPES.
542 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
544 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
545 so that unistd-safer.h (GPL'ed code) need not be included.
547 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
550 * fts.c: Don't include "cycle-check.h" or "hash.h".
551 (setup_dir, free_dir): New functions.
552 (enter_dir, leave_dir): Define trivial
553 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
554 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
555 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
556 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
558 (fts_open): Use setup_dir.
559 (fts_close): Use free_dir.
560 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
561 This adds a label and some gotos, but the alternatives were messier.
562 Check for memory allocation failure when entering a dir.
563 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
564 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
565 (FTS): New member fts_cycle, that is a union that contains the
566 old active_dir_ht and cycle_state. All uses changed to mention
567 fts_cycle.ht and fts_cycle.state.
568 * fts-cycle.c: New file, containing GPL'ed code migrated out of
569 fts.c, with the following changes:
570 (setup_dir, free_dir): New functions.
571 (enter_dir): Now returns bool. Return true if successful, false
572 if memory exhausted. All callers changed.
573 Do not bother partly cleaning up on
574 memory allocation failure; that is free_dir's job.
575 However, free ad if hash_insert fails, to avoid memory leak.
576 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
577 fts->fts_options to see which union member to use.
579 2005-05-20 Jim Meyering <jim@meyering.net>
581 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
582 Now a macro, to pacify GCC.
584 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
586 * chown.c (rpl_chown): Return -1 on failure.
588 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
590 * canonicalize.c: Include canonicalize.h first, to test interface.
591 Include <stddef.h> unconditionally, since we assume C89 now.
592 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
593 * fts.c: Include fts_.h first, to check interface.
594 Do not include intprops.h; no longer needed.
595 Include cycle-check.h and hash.h, since fts_.h no longer does.
596 Remove unnecessary casts of closedir to void.
597 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
598 decide whether to decrement nlinks.
599 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
600 (FTS): Use struct hash_table * instead of Hash_table, so that
601 we no longer need to include hash.h here.
603 2005-05-17 Jim Meyering <jim@meyering.net>
605 * fts.c, fts_.h: New files, from coreutils.
607 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
610 * unlinkdir.c, unlinkdir.h: New files.
611 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
612 regex.h, unlocked-io.h, xtime.h:
613 White space changes only.
614 * makepath.c (make_path): Port to hosts where leading "//" is special.
615 * yesno.c: Include getline.h, not ctype.h.
616 (yesno): Don't remove leading white space; POSIX doesn't allow it.
617 Use getline to remove arbitrary restriction on response length.
619 2005-05-13 Bruno Haible <bruno@clisp.org>
621 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
622 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
623 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
624 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
625 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
626 Add support for 64-bit integers in the MSVC compiler.
628 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
630 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
631 Change the initial comment to refer to GPL, not LGPL.
632 gnulib-tool will change it to LGPL as needed.
634 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
635 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
636 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
637 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
638 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
639 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
640 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
641 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
642 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
643 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
644 concatpath.c, config.charset, copy-file.c, copy-file.h,
645 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
646 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
647 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
648 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
649 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
650 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
651 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
652 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
653 full-read.c, full-read.h, full-write.c, full-write.h,
654 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
655 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
656 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
657 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
658 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
659 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
660 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
661 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
662 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
663 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
664 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
665 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
666 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
667 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
668 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
669 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
670 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
671 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
672 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
673 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
674 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
675 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
676 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
677 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
678 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
679 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
680 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
681 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
682 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
683 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
684 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
685 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
686 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
687 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
688 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
689 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
690 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
691 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
692 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
693 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
694 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
695 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
696 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
697 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
698 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
699 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
700 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
701 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
702 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
703 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
704 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
705 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
706 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
707 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
708 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
709 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
710 Update FSF postal mail address.
712 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
714 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
715 specified in ai_socktype. Fix invalid ai_protocol
716 check. ai_protocol is usually set to 0 or depending on
717 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
718 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
719 ai_socktype / ai_protocol in the returned addrinfo structure.
721 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
722 Bruno Haible <bruno@clisp.org>
724 * inet_ntop.h: New file.
725 * inet_ntop.c: New file, from glibc with modifications.
727 2005-05-08 Jim Meyering <jim@meyering.net>
729 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
731 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
733 Merge from coreutils. Among other things,
734 add bulletproofing for cases where stdin, stdout, or stderr are closed.
735 * fd-safer.c: New file.
736 * fcntl-safer.h, open-safer.c: Remove.
737 * chdir-long.c: Fix comment "fetish" -> "coreutils".
738 * dup-safer.c: Include unistd-safer.h first.
739 Don't include errno.h.
740 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
741 * file-type.h: Don't assume invoker included sys/stat.h first.
742 * file-type.c: Rely on file-type.h change.
743 * getloadavg.c: Include unistd-safer.h.
744 (getloadavg): Use safer open.
745 * getusershell.c: Include "stdio-safer.h".
746 (getusershell): Use safer fopen.
747 * long-options.c (long_options): Use NULL rather than 0.
748 * modechange.h (mode_free): Remove; all callers changed to invoke
750 * modechange.c: Likewise.
751 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
752 (MODE_DONE): New constant.
753 (struct mode_change): Remove 'next' member.
754 (make_node_op_equals): New function; like the old one of the
755 same name, except it allocates an array.
756 (mode_compile, mode_create_from_ref): Use it.
757 (mode_compile): Allocate result as an array, not a linked list.
758 Parse octal string ourself, so that we catch mistakes like "+0".
759 (mode_adjust): Arg is an array, not a linked list.
760 * modechange.c: Include stat-macros.h, xalloc.h.
761 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
762 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
763 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
764 Remove. This is now stat-macros.h's job.
765 (talloc): Remove. All callers replaced by xalloc, so that
766 our invokers don't have to worry about reporting memory failures.
767 (make_node_op_equals): Remove.
768 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
770 (struct mode_change): Moved here from modechange.h.
771 (mode_append_entry): Remove.
772 (mode_compile): Remove MASKED_OPS arg, since it encouraged
773 apps to have incorrect behavior. Use simpler algorithm for head
774 and tail. Don't futz with umask; that's now the job of mode_adjust.
775 Detect more invalid usages rather than having somewhat-random behavior.
776 Don't insert an "a=" action, as that leads to incorrect behavior.
777 (mode_compile, mode_create_from_ref): Return NULL on error instead
778 of an enum, since now there's only one way to have an error. All
780 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
781 at the correct time. Simplify calculation of "+u" and its ilk.
782 Don't mishandle "+X".
783 (mode_free): Remove "register" and localize decls.
784 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
785 (struct mode_change): Move to modechange.c; callers don't
786 need to see this stuff.
787 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
788 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
789 (mode_change, mode_adjust): Reflect the new signatures noted above.
790 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
791 that might redefine system include files.
792 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
793 (my_usleep): Use NULL rather than (void *) 0.
794 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
795 Use siginterrupt to specify that system calls should be interrupted.
796 (rpl_nanosleep): Move initialization of suspended closer to call of
798 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
799 * readutmp.c: Likewise. Include signal.h, stdbool.h.
800 (desirable_utmp_entry): New function.
801 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
802 using x2nrealloc, to simplify logic.
803 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
804 size calculation. Do not assume utmp file is a regular file.
805 * readutmp.h (UT_PID): Moved here from ../src/who.c.
806 (READ_UTMP_CHECK_PIDS): New constant.
807 * save-cwd.c: Include unistd-safer.h.
808 (save_cwd): Use fd_safer.
809 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
810 [!_LIBC] Include "stat-macros.h" instead.
811 * unistd-safer.h (fd_safer): New decl.
813 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
815 * byteswap_.h: New file.
817 2005-04-25 Albert Chin <china@thewrittenword.com>
819 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
822 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
824 * getdate.y (zone): Allow relunit_snumber after tZONE, so
825 that "UTC +1 second" continues to work. Problem reported
827 (relunit_snumber): New rule.
830 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
832 * getdate.y (universal_time_zone_table): New constant.
833 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
834 universal_time_zone_table.
835 (lookup_zone): Prefer universal_time_zone_table to
836 local_time_zone_table, so that "GMT" time stamps are allowed in
837 London during the summer. Problem reported by Ian Abbott.
839 2005-04-12 Jim Meyering <jim@meyering.net>
841 * human.c (humblock): Set *options even when returning due to
842 xstrtoumax conversion failure. Thanks to a used-uninitialized
845 2005-04-09 Jim Meyering <jim@meyering.net>
847 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
848 -Wuninitialized: initialize tm0.tm_year.
850 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
852 * getdate.y (parser_control): rels_seen is now a boolean, not a
853 count, since there's no maximum. All uses changed.
854 Add member dsts_seen.
855 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
857 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
858 Use pc_rels_seen to decide whther a date is absolute.
860 * getdate.y (number): Don't overwrite year.
861 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
864 2005-04-02 Simon Josefsson <jas@extundo.com>
866 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
867 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
869 2005-03-27 Jim Meyering <jim@meyering.net>
871 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
873 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
875 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
876 "one's complement" -> "ones' complement" in comment, as per Knuth.
877 "value of type" -> "type or expression" in comment.
878 * mktime.c, strftime.c: Propagate intprops.h comment nits.
880 2005-03-26 Jim Meyering <jim@meyering.net>
883 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
884 Correct typos: s/or/of/.
886 2005-03-23 Jim Meyering <jim@meyering.net>
888 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
890 2005-03-21 Jim Meyering <jim@meyering.net>
892 Changes imported from coreutils.
894 * cycle-check.c: Don't include xalloc.h.
896 * path-concat.c: Don't include assert.h.
897 (path_concat): Remove assertion that would have triggered
898 for ABASE starting with more than one slash.
899 Reported by Andreas Schwab.
901 * path-concat.c (path_concat): Set *BASE_IN_RESULT
902 properly when ABASE is an absolute file name.
903 Correct the description of this function.
905 Add an assertion and a test driver.
906 This fixes a bug introduced on 2004-07-02.
907 Andreas Schwab reported the resulting failure of cp --parents:
908 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
910 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
912 * strftime.c (my_strftime): If the underlying strftime returns 0
913 (which shouldn't happen), generate nothing instead of returning 0
914 immediately, so that nstrftime (NULL, ...) doesn't return 0.
916 2005-03-16 Bruno Haible <bruno@clisp.org>
918 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
920 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
922 * strftime.c (my_strftime): Prepend space to format so that we can
923 reliably distinguish strftime failure from empty output on POSIX
926 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
928 * iconvme.c (SIZE_MAX): New macro, if not already defined.
929 (iconv_string): Don't guess a size-zero buffer, as that might cause
930 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
931 result would be 'too large', where 'too large' is (heuristically)
932 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
933 overflow concerns. This will prevent some unwanted malloc failures
934 when the inputs are very large.
936 2005-03-15 Bruno Haible <bruno@clisp.org>
938 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
941 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
944 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
946 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
948 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
949 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
951 * strtol.c: Likewise.
953 2005-03-14 Simon Josefsson <jas@extundo.com>
955 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
958 2005-03-14 Jim Meyering <jim@meyering.net>
960 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
961 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
962 to be nonzero so that we (and caller) can detect the difference
963 between a valid zero-length expansion and an error return, even
964 when the underlying strftime fails before writing anything into
967 2005-03-10 Jim Meyering <jim@meyering.net>
969 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
970 so that this module works on systems without fchdir.
972 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
974 Factor int-properties macros into a single file, except for
976 * intprops.h: New file.
977 * getloadavg.c: Include it instead of limits.h.
978 (INT_STRLEN_BOUND): Remove.
979 * human.c: Include intprops.h.
980 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
981 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
982 * inttostr.h: Include intprops.h instead of limits.h.
983 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
984 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
985 for consistency with intprops.h.
986 (time_t_is_integer, twos_complement_arithmetic): Use them.
987 * sig2str.h: Include <signal.h>, intprops.h.
988 (INT_STRLEN_BOUND): Remove.
989 * strftime.c (TYPE_SIGNED): Remove.
990 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
991 * strtol.c: Adjust comments to match intprops.h.
992 * userspec.c: Include intprops.h.
993 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
994 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
995 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
996 instead of rolling our own expressions.
997 * xstrtol.c: Include xstrtol.h first, to test interface.
999 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
1001 (my_strftime): Do not mishandle years close to INT_MAX, by doing
1002 the right thing even if adding 1900 would overflow. Similarly
1003 for tm_mon + 1 and tm_yday + 1.
1004 Make %Y always equivalent to %C%y, and similarly for %G and %g.
1005 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
1006 (DO_SIGNED_NUMBER): New macro.
1007 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
1009 2005-03-07 Bruno Haible <bruno@clisp.org>
1011 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
1013 2005-03-03 Derek R. Price <derek@ximbiot.com>
1014 Bruno Haible <bruno@clisp.org>
1016 * pagealign_alloc.h: New file.
1017 * pagealign_alloc.c: New file.
1019 2005-01-28 Bruno Haible <bruno@clisp.org>
1021 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
1024 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
1026 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
1027 The workaround isn't strictly needed for POSIX conformance, and
1028 it's too much of a pain to configure and maintain. We'll ask
1029 people to fix their kernels instead.
1030 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
1031 (NANOSLEEP_BUG_WORKAROUND): Remove.
1032 (xnanosleep): Remove the workaround.
1034 2005-02-12 Bruno Haible <bruno@clisp.org>
1036 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
1038 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
1040 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
1041 * timespec.h (gettime): Return void, since it always
1042 succeeds now. All uses changed.
1043 * gettime.c (gettime) Likewise.
1044 [HAVE_NANOTIME]: Prefer nanotime.
1045 Assume gettimeofday succeeds, as POSIX requires.
1046 Assime time () succeeds, since other code already does.
1047 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
1048 (timespec_subtract): Remove.
1049 (NANOSLEEP_BUG_WORKAROUND): New constant.
1050 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
1051 things considerably. Use it only on GNU/Linux hosts, since the
1052 workaround shouldn't be needed elsewhere.
1054 2005-02-24 Bruno Haible <bruno@clisp.org>
1056 * gettext.h: Update from GNU gettext 0.14.2.
1058 2005-02-24 Bruno Haible <bruno@clisp.org>
1060 * localcharset.c: Update from GNU gettext 0.14.2.
1061 * config.charset: Update from GNU gettext 0.14.2.
1063 2005-02-22 Simon Josefsson <jas@extundo.com>
1065 * iconvme.h, iconvme.c: New files, from libc.
1067 2005-02-20 Neil Conway <neilc@samurai.com>
1069 * xgethostname.c (xgethostname): Check for ENOMEM, which is
1070 returned by OSX/Darwin if the specified buffer is not large
1071 enough for the hostname.
1073 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
1075 * memrchr.h: New file.
1076 * chdir-long.c: Include it.
1077 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
1078 Don't bother including stddef.h.
1080 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1082 * argp-help.c (__argp_help): Create a fake struct argp_state and
1083 pass it to _help, otherwise the latter coredumps trying to
1084 dereference state.root_argp.
1086 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
1088 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
1090 Include <sys/types.h>, for dev_t.
1091 (ME_DUMMY, ME_REMOTE): Move from here....
1092 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
1093 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
1095 Include mountlist.h first, to test the interface.
1097 2005-01-29 Bruno Haible <bruno@clisp.org>
1099 * progname.c (program_name): Initialize.
1100 Needed when linking statically on MacOS X.
1102 2005-01-28 Bruno Haible <bruno@clisp.org>
1104 * javacomp.sh.in: New file, from GNU gettext.
1105 * javacomp.h: New file, from GNU gettext.
1106 * javacomp.c: New file, from GNU gettext.
1108 2005-01-26 Bruno Haible <bruno@clisp.org>
1110 * javaexec.sh.in: New file, from GNU gettext.
1111 * javaexec.h: New file, from GNU gettext.
1112 * javaexec.c: New file, from GNU gettext.
1114 2005-01-26 Simon Josefsson <jas@extundo.com>
1116 * gai_strerror.c: Use GPL in header.
1118 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1120 * argp-help.c (hol_entry_help): Avoid using non-constant
1121 initializers for struct pentry_state.
1122 (__argp_error): Check return value of __asprintf
1123 (__argp_failure): Translate error message
1125 * argp-parse.c: Removed braces around the expansion of N_()
1127 2005-01-21 Jim Meyering <jim@meyering.net>
1129 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
1130 same value as for Solaris 9.
1132 * chdir-long.c (chdir_long): Rewrite to remove limitation on
1133 component length. This included changing the parameter to be
1134 of type `char *' rather than `char const *'.
1135 * chdir-long.h (chdir_long): Update prototype.
1137 * openat.c (fdopendir, fstatat): New functions.
1138 * openat.h: Include headers required for use of DIR and struct stat.
1139 [AT_SYMLINK_NOFOLLOW]: Define.
1140 (fdopendir, fstatat): Add prototypes.
1142 2005-01-21 Bruno Haible <bruno@clisp.org>
1144 * classpath.h: New file, from GNU gettext.
1145 * classpath.c: New file, from GNU gettext.
1147 2005-01-20 Simon Josefsson <jas@extundo.com>
1149 * version-etc-fsf.c: New file, with version_etc_copyright.
1150 * version-etc.c: Remove version_etc_copyright.
1151 * version-etc.h (version_etc_copyright): Use [] instead of * in
1152 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
1154 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
1156 * save-cwd.c (save_cwd): Remove code to support the case
1157 where fchdir is missing or flaky.
1159 2005-01-20 Simon Josefsson <jas@extundo.com>
1161 * base64.h (isbase64): Add.
1163 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
1164 using a unsigned prototype, don't inline.
1165 (base64_decode): Use it.
1167 2005-01-19 Bruno Haible <bruno@clisp.org>
1169 * sh-quote.h: New file, from GNU gettext.
1170 * sh-quote.c: New file, from GNU gettext.
1172 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
1174 Merge changes from coreutils, as described below in several
1175 changelogs dated today.
1177 * save-cwd.c: Include "save-cwd.h" before other include files.
1178 (O_DIRECTORY): Remove; not needed here, since "." must be
1179 a directory. All uses removed.
1180 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
1181 universal on Suns, and we also need to test for IRIX.
1182 Revamp code to use 'if' rather than '#if'.
1183 Avoid unnecessary comparison of cwd->desc to 0.
1185 * utimens.c (futimens): Robustify the previous patch, by checking
1186 for known valid error numbers rather than observed invalid ones.
1188 2005-01-18 Jim Meyering <jim@meyering.net>
1190 * version-etc.c (version_etc_copyright): Update copyright date.
1192 * utimens.c (futimens): Account for the fact that futimes
1193 can also fail with errno == ENOSYS or errno == ENOENT.
1194 Patch from Dmitry V. Levin.
1196 Change the name of the robust chdir function from chdir to chdir_long.
1197 * save-cwd.c: Include chdir-long.h rather than chdir.h.
1198 (restore_cwd): Use chdir_long, not chdir.
1199 * chdir-long.c: Renamed from chdir.c.
1200 * chdir-long.h: Renamed from chdir.h.
1201 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
1204 2005-01-18 Bob Proulx <bob@proulx.com>
1206 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
1207 offsetof() macro construct to avoid compile failure with native HP-UX
1208 11.0 ANSI C compiler.
1210 2005-01-06 Bruno Haible <bruno@clisp.org>
1212 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
1213 because stpncpy.m4 takes care of it.
1215 2004-01-24 Bruno Haible <bruno@clisp.org>
1217 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
1219 2003-10-09 Bruno Haible <bruno@clisp.org>
1221 * progreloc.c: Include xalloc.h instead of xmalloc.h.
1223 2005-01-06 Bruno Haible <bruno@clisp.org>
1225 * fwriteerror.h (fwriteerror): Change specification to include fclose.
1226 * fwriteerror.c: Include <stdbool.h>.
1227 (fwriteerror): At the end, close the file stream. Record whether
1228 stdout was already closed.
1230 2004-05-27 Bruno Haible <bruno@clisp.org>
1232 * execute.c (environ): Declare if needed.
1233 * pipe.c (environ): Likewise.
1234 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
1236 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
1238 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
1239 definitions to be after all include files, to avoid collisions.
1240 Problem reported by Bob Proulx.
1242 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
1244 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
1245 not needed. This removes a dependency on the gettext module.
1246 [defined _LIBC]: Do not include <libintl.h>; not needed.
1248 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
1250 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
1253 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
1255 * argp-parse.c: Include <stddef.h>.
1256 (alignof, alignto): New macros.
1257 (parser_init): Don't assume that void * is aligned sufficiently
1260 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
1261 need to extend the stack.
1262 (YYINITDEPTH): New macro, so that the initial stack isn't overly
1265 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1267 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
1269 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1271 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
1272 Remove now-obsolete comment about AIX.
1273 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
1274 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
1275 (YYMAXDEPTH): New macro.
1277 2004-12-18 Bruno Haible <bruno@clisp.org>
1279 * fatal-signal.c (fatal_signals): Make non-const.
1280 (init_fatal_signals): New function.
1281 (uninstall_handlers, install_handlers): Ignore signals that were set to
1283 (at_fatal_signal): Call init_fatal_signals.
1284 (init_fatal_signal_set): Likewise. Ignore signals that were set to
1286 Reported by Paul Eggert.
1288 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1290 * getdate.y (textint): New member "negative".
1291 (time_zone_hhmm): New function.
1292 Expect 14 shift-reduce conflicts, not 13.
1293 (o_colon_minutes): New rule.
1294 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
1295 (yylex): Set the "negative" member of signed numbers.
1297 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
1299 Changes imported from coreutils.
1300 * hard-locale.c: Assume <locale.h> exists.
1302 (GLIBC_VERSION): New macro.
1303 (hard_locale): Assume setlocale exists.
1304 Rewrite to avoid #ifdef.
1305 Use strdup rather than malloc + strcpy.
1306 * human.c: Assume <locale.h> exists.
1307 (human_readable): Assume localeconv exists.
1309 2004-12-01 Jakub Jelinek <jakub@redhat.com>
1311 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
1312 convert T2, not T. (Imported from libc.)
1314 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1316 * getcwd.c (is_ENAMETOOLONG): New macro.
1317 (__getcwd.c): Don't restore errno; glibc doesn't.
1318 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
1319 first, falling back to our code only if its results look suspicious.
1320 Ensure that the resulting buffer is only as large as necessary.
1322 * readutmp.c: Include readutmp.h first.
1323 Include <errno.h>, since readutmp.h no longer does that.
1324 * readutmp.h: Don't include <errno.h>,
1325 <sys/param.h>, <time.h>; not needed to establish interface.
1326 (errno): Remove decl.
1327 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
1328 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
1329 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
1331 2004-11-28 Simon Josefsson <jas@extundo.com>
1333 * base64.h, base64.c: New file.
1335 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
1337 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
1339 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1341 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1342 HP's ANSI C compiler.
1343 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1344 Declaring int functions causes warnings on some modern systems and
1345 shouldn't be needed to compile on ancient ones.
1346 * same.c (MIN) [defined MIN]: Don't define, since it's already
1349 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1350 with the following changes.
1351 (__set_errno): Parenthesize properly.
1352 Include <stdbool.h>.
1353 (MIN, MAX, MATCHING_INO): New macros.
1354 (__getcwd): Define with prototype, not K&R form.
1355 Use heuristics to allocate default buffer on stack if possible.
1356 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1357 behavior, and to avoid the PATH_MAX limit when computing
1359 Use MATCHING_INO to compare inode number to file.
1360 Check for arithmetic overflow in size calculations.
1361 Fix bug in reallocation of dot array that caused getcwd to fail
1362 on directories nested deeper than 75.
1363 Be more careful about saving errno on error.
1364 Do not use realloc; use only free+malloc, as this is a bit
1365 more flexible and avoids a needless copy operation.
1366 Do not inspect st_dev and st_ino for symbolic links; POSIX
1367 doesn't specify the latter.
1368 Check for closedir errors.
1369 Avoid needless casts.
1370 Use "#ifdef weak_alias" around weak_alias, to be like other
1372 The following changes to getcwd.c have effect only when used in
1373 gnulib; they have no effect inside glibc proper.
1374 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1375 as alloca isn't used.
1376 (alloca, __alloca): Likewise.
1377 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1378 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1379 unconditionally, as gnulib assumes C89 or better.
1380 Do not include <sys/param.h>.
1381 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1382 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1384 (NULL) [!defined NULL]: Remove; we assume C89 or better.
1385 Include <dirent.h> in a way that is compatible with modern Autoconf.
1386 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1387 New macros, if not already defined.
1388 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1389 Use "_LIBC", not "defined _LIBC", for consistency.
1390 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1392 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1393 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
1394 * xgetcwd.c: David MacKenzie's old code was removed, so give
1395 credit only to Jim Meyering and adjust the copyright dates.
1396 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1397 <stdlib.h>, <unistd.h>, "pathmax.h".
1398 Instead, include "xgetcwd.h" (first) and "getcwd.h".
1399 (INITIAL_BUFFER_SIZE): Remove.
1400 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1402 2004-11-23 Jim Meyering <jim@meyering.net>
1404 * getopt_.h: Remove trailing blanks.
1406 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1408 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1409 (futimens): New function, which uses futimes if available.
1410 (futimens, utimens): Support timespec==NULL, with same semantics
1411 as utime and utimens.
1412 * utimens.h (futimens): New decl.
1414 2004-11-23 Jim Meyering <jim@meyering.net>
1416 * __fpending.c: Add comment.
1418 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1420 * getopt_.h: Re-addition of __getopt_argv_const caused
1421 redefinition warnings. To avoid them, include the defines
1422 in `#if !defined __need_getopt ... #endif'. The only place
1423 where __getopt_argv_const is used is in definitions
1424 of getopt_long and getopt_long_only below, which are as well
1425 protected by `#ifndef __need_getopt'.
1426 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1427 __need_getopt after including <stdio.h> and <unistd.h> These
1428 headers might have defined it.
1430 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1432 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1434 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1435 optopt): Use them instead of invoking ## directly; otherwise, the
1436 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1438 2004-11-19 Bruno Haible <bruno@clisp.org>
1440 * strtok_r.c: Move comments from here...
1441 * strtok_r.h: ... to here.
1443 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1445 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1446 might fail. Problem reported by Yoann Vandoorselaere.
1447 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1448 that mishandle size_t overflow.
1450 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1452 * canon-host.c: Include "strdup.h".
1453 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1454 Use strdup instead of malloc/strcpy to duplicate strings.
1456 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1457 (human_space_before_unit): New constant.
1458 * human.c (human_readable): Support it.
1460 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1461 (xgetcwd): Set errno correctly when failing.
1462 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1463 the failure is actually due to a PATH_MAX problem.
1465 Further getopt changes to make it more likely that glibc will
1466 buy the changes back.
1467 * getopt.c (POSIXLY_CORRECT): New constant.
1468 (getopt): Use it, so to preserve glibc semantic
1469 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1470 when compiling for libc.
1471 * getopt_.h (__getopt_argv_const): Bring it back.
1472 (getopt_long, getopt_long_only): Use it.
1474 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1475 New arg POSIXLY_CORRECT. All callers changed.
1476 (getopt): Argv is now char * const *, as per standard.
1477 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1478 not char *__getopt_argv_const *.
1479 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1480 _getopt_long_only_r): Likewise.
1481 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1482 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1483 _getopt_long_r, _getopt_long_only_r): Likewise.
1484 * getopt_.h (__getopt_argv_const): Remove.
1485 (getopt): Argv is now char * const *, as per standard.
1487 * getdate.y (tORDINAL): New token.
1488 (day, relunit): Allow it for relative times.
1489 (relative_time_table): Use tORDINAL for ordinals.
1491 2004-11-15 Jim Meyering <jim@meyering.net>
1493 * closeout.c: Include "__fpending.h" once again.
1494 Include <stdbool.h>.
1495 (close_stdout): Don't fail just because stdout was closed initially,
1496 since some programs don't write to stdout in the normal course of
1497 operation (other than --version and --help), and we don't want this
1498 function to make e.g. `touch file >&-' fail.
1499 But do fail if it was closed and someone has tried to write to it.
1500 E.g., `printf foo >&-' must fail.
1502 2004-11-11 Simon Josefsson <jas@extundo.com>
1504 * strtok_r.h, strtok_r.c: New file.
1506 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1508 * getopt_.h (__getopt_argv_const): New macro, to be used so that
1509 we can stop lying to compilers about the constness of argv when we
1510 are compiled outside glibc.
1511 (getopt, getopt_long, getopt_long_only): Use it.
1512 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1514 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1515 _getopt_long_only_r): Likewise.
1516 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1517 _getopt_long_only_r): Likewise.
1519 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1520 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1521 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1522 the other external symbols.
1523 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1524 declaration, since the above renaming now works around collisions.
1526 2004-11-11 Jim Meyering <jim@meyering.net>
1528 * linebreak.c: Remove trailing blanks.
1529 * alloca_.h: Likewise.
1530 * acosl.c: Likewise.
1531 * euidaccess.c: Likewise.
1532 * allocsa.h: Likewise.
1534 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1536 * mktime.c (SHR): New macro, which is a portable
1537 substitute for >> that should work even on Crays.
1538 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1539 Problem reported by Mark D. Baushke in
1540 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1541 * getdate.y (SHR): Likewise.
1543 * strftime.c (SHR): Likewise.
1545 * quotearg.c (struct quoting_options): Use unsigned int for
1546 quote_these_too, so that right shifts are well defined. All uses
1549 2004-11-10 Simon Josefsson <jas@extundo.com>
1551 * getaddrinfo.h, getaddrinfo.c: New files.
1553 2004-11-10 Jim Meyering <jim@meyering.net>
1555 Ensure that no close failure goes unreported.
1556 * closeout.c (close_stdout): Always close stdout. I.e., don't
1557 return early when it seems there's nothing to flush.
1558 Don't include __fpending.h.
1560 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1562 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1564 2004-11-05 Bruno Haible <bruno@clisp.org>
1566 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1567 Reported by Mark D. Baushke <mdb@cvshome.org>.
1569 2004-11-04 Bruno Haible <bruno@clisp.org>
1571 2004-09-11 Bruno Haible <bruno@clisp.org>
1572 * allocsa.valgrind: New file.
1573 2004-02-06 Bruno Haible <bruno@clisp.org>
1574 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1575 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1576 Reported by Christopher Seip <chris.seip@hp.com>.
1578 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1580 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1581 with errno == ERANGE if the buffer is too small.
1582 Problem reported by Mark D. Baushke.
1584 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1586 * xreadlink.c (MAXSIZE): New macro.
1587 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1588 size does not exceed MAXSIZE. Avoid cast.
1589 As suggested by Mark D. Baushke in
1590 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1591 if readlink fails with buffer size just under MAXSIZE, try again
1594 2004-11-02 Derek R. Price <derek@ximbiot.com>
1595 and Paul Eggert <eggert@cs.ucla.edu>
1597 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1598 (get_date): Overparenthesize to avoid GCC warning.
1600 2004-11-02 Bruno Haible <bruno@clisp.org>
1602 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1603 function returns void.
1605 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1607 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1608 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1611 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1613 * getdate.y: Add support for TZ="foo" within a date string.
1614 Fix some bugs near time_t boundaries. Reject dates with
1615 out-of-range components, e.g., "Sept 31".
1616 Include <stdlib.h>, "setenv.h", "xalloc.h".
1617 (ISDIGIT_LOCALE): Remove; unused.
1618 Note that the TZ and time functions used here are not reentrant.
1619 (mktime_ok, get_tz): New functions.
1620 (TZBUFSIZE): New constant.
1621 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1622 This requires that we sometimes generate our own TZ="XXX..." setting.
1624 2004-10-27 Derek R. Price <derek@ximbiot.com>
1626 * mktime.c (not_equal_tm): Remove redundant check.
1628 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1630 * getdate.y: Use Bison 1.875 features, and some minor
1631 code cleanups. This change does not affect semantics.
1632 Don't include <stdlib.h>; no longer needed.
1633 Don't include unlocked-io.h; only the "#if TEST" code uses
1634 stdio, and performance isn't crucial there.
1635 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1636 Bison 1.875 features as described below.
1637 All uses of "PC." replaced by "pc->".
1638 (YYSTYPE): Add a forward declaration.
1639 (yylex, yyerror): Use full prototypes in forward decls.
1640 Use "%pure-parser" rather than obsolescent "%pure_parser".
1641 Use %parse-param and %lex-param instead of obsolescent
1642 YYPARSE_PARAM and YYLEX_PARAM.
1643 (meridian_table, month_and_day_table, time_units_table,
1644 relative_time_table, time_zone_table, military_table,
1645 lookup_zone, lookup_word, get_date):
1646 Use NULL instead of 0 where appropriate.
1647 (to_hour): Avoid abort (), to avoid a dependency on
1649 (yyerror, yylex): Now accepts parser_control * arg.
1650 (main) [TEST]: Use '\0' rather than 0 for char.
1652 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1654 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1655 It's now the caller's responsibility to handle the case where
1656 !HAVE_GETPAGESIZE && !defined getpagesize.
1658 * mktime.c (leapyear): Arg is long int, not int.
1660 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1662 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1664 2004-10-12 Simon Josefsson <jas@extundo.com>
1666 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1667 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1670 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1672 * vsnprintf.h: New file.
1673 * vsnprintf.c: New file.
1675 2004-10-07 Bruno Haible <bruno@clisp.org>
1677 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1678 into the provided buffer.
1680 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1682 * diacrit.c, diacrit.h: Add GPL notice.
1684 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1685 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1686 * logl.c (logl): Keep the code as similar to glibc as possible.
1687 This avoids a potential constant-folding bug.
1689 2004-10-05 Bruno Haible <bruno@clisp.org>
1691 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1693 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1695 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1696 * xmalloc.c (xmemdup): Likewise.
1697 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1698 XFREE): Remove these long-obsolescent macros.
1699 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1700 * xstrdup.c: Remove.
1702 * regex.c (re_comp): Cast gettext return value to char *,
1703 Problem reported by Martin Neitzel via Mark D. Baushke.
1705 2004-10-04 Simon Josefsson <jas@extundo.com>
1707 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1708 '#ifdef USE_UNLOCKED_IO'.
1710 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1712 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1713 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1714 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1715 regex.c, sha1.c, version-etc.c, yesno.c:
1716 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1717 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1718 the includer's responsibility.
1720 Sync from coreutils.
1722 * modechange.c (mode_compile): Don't decrement a pointer that
1723 points to the start of a string, as the C Standard says the
1724 resulting behavior is undefined.
1726 * backupfile.h (enum backuptype): Rename none -> no_backups,
1727 simple -> simple_backups, numbered_existing ->
1728 numbered_existing_backups, numbered -> numbered_backups
1729 to avoid shadowing problems. All uses changed.
1730 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1731 * backupfile.c (check_extension, numbered_backup):
1732 Rename locals to avoid shadowing 'basename'.
1733 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1736 * .cppi-disable: Add getopt_.h, getopt_int.h.
1737 * .cvsignore: Add getopt.h.
1739 2004-10-04 Simon Josefsson <jas@extundo.com>
1741 * memmem.h: New file.
1742 * memmem.c: New file, taken from glibc.
1744 2004-10-02 Jim Meyering <jim@meyering.net>
1746 * dirfd.h, getpagesize.h: Add copyright notice.
1748 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1750 * snprintf.c: Remove comments as to why each header is needed.
1752 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1754 * strsep.h: New file.
1755 * strsep.c: New file.
1757 2004-10-01 Simon Josefsson <jas@extundo.com>
1759 * snprintf.c (snprintf): Handle size==0.
1761 2004-10-01 Simon Josefsson <jas@extundo.com>
1762 Bruno Haible <bruno@clisp.org>
1764 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1765 (snprintf): Declare 'args'.
1767 2004-09-30 Simon Josefsson <jas@extundo.com>
1769 * snprintf.h, snprintf.c: New files.
1771 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1773 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1774 (hol_entry_help): Never translate an empty string.
1775 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1776 * argp.h (OPTION_NO_TRANS): New option.
1778 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1780 * xvasprintf.c: Include xalloc.h.
1781 (xvasprintf): Use xalloc_die, not xmalloc_die.
1783 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1785 * dummy.c: Change copyright notice to FSF, and license to GPL.
1787 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1789 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1790 Problem reported by Bruno Haible in:
1791 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1793 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1795 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1796 in case some system header has #define'd it. Problem reported by
1797 Soeren D. Schulze in
1798 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1800 2004-09-08 Bruno Haible <bruno@clisp.org>
1802 * stdint_.h.in: New file, taken from GNU clisp.
1804 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1806 * xvasprintf.h: New file.
1807 * xvasprintf.c: New file.
1808 * xasprintf.c: New file.
1810 2004-09-08 Bruno Haible <bruno@clisp.org>
1812 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1814 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1816 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1818 Import from coreutils.
1819 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1820 strings on unbounded length. alloca's performance benefits aren't
1821 that important here.
1823 (parse_with_separator): New function, with most of the internals
1824 of the old parse_user_spec. Allow user to omit both user and group,
1825 for compatibility with FreeBSD.
1826 Clone only the user name, not the entire spec.
1827 Do not set *uid, *gid unless entirely successful.
1828 Avoid memory leak in some failing cases.
1829 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1830 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1831 (parse_user_spec): Rewrite to use parse_with_separator.
1833 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1835 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1836 its complicated substitute.
1837 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1838 and program_invocation_name.
1839 (__argp_basename) [!_LIBC]: Remove; the only use was
1840 replaced by its body.
1841 (__argp_short_program_name): Change condition from
1842 !defined __argp_short_program_name to
1843 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1844 to match argp-namefrob.h.
1845 (__argp_failure): Don't assume strerror_r returns char *.
1846 * argp-parse.c (N_): Define unconditionally.
1847 (argp_default_options): Fill out initializers with 0 to avoid
1850 2004-08-12 Simon Josefsson <jas@extundo.com>
1852 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1853 * getopt_.h: Renamed from getopt.h.
1855 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1857 Merge from coreutils.
1859 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1860 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1861 for Reliant Unix 5.43.
1863 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1864 (union fooround): Use uintmax_t, not long int.
1865 The rest is a merge from libc:
1866 [defined _LIBC]: Include <shlib-compat.h>.
1867 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1869 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1871 * strverscmp.c: Convert to UTF-8.
1873 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1875 * obstack.h (obstack_empty_p):
1876 Don't assume that chunk->contents is suitably aligned.
1877 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1878 Likewise. Problem reported by Benno in
1879 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1881 * chown.c (rpl_chown): Work even if the file is writeable but not
1882 readable. This could be improved further but it'd take some work.
1884 2004-08-08 Simon Josefsson <jas@extundo.com>
1886 * xgethostname.c: Don't include error.h (not used).
1889 * getpass.c: Include getpass.h first.
1891 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1893 * xalloc-die.c: New files.
1894 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1896 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1897 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1898 (_, N_, xalloc_die): Move to xalloc-die.c.
1899 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1900 so that we needn't mess with xalloc_msg_memory_exhausted.
1902 * sha1.h: Renamed from sha.h.
1903 (SHA1_H): Renamed from _SHA_H.
1904 (sha1_ctx): Renamed from sha_ctx.
1905 (sha1_init_ctx): Renamed from sha_init_ctx.
1906 (sha1_process_block): Renamed from sha_process_block.
1907 (sha1_process_bytes): Renamed from sha_process_bytes.
1908 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1909 (sha1_read_ctx): Renamed from sha_read_ctx.
1910 (sha1_stream): Renamed from sha_stream.
1911 (sha1_buffer): Renamed from sha_buffer.
1912 * sha1.c: Likewise; renamed from sha.c.
1913 Do not include <sys/types.h>.
1914 Include <stddef.h> rather than <stdlib.h>.
1916 2004-08-08 Bruno Haible <bruno@clisp.org>
1918 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1919 FILESYSTEM_PREFIX_LEN.
1920 * progreloc.c: Likewise.
1921 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1923 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1926 * argp-help.c (make_hol, hol_append): Don't assume that
1927 SIZE_MAX is a valid preprocessor constant.
1928 (__argp_basename): Change from "#ifndef _LIBC"
1929 to "#ifndef __argp_short_program_name", so that
1930 we don't compile these functions for tar.
1932 More merges from coreutils.
1933 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1934 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1936 * addext.c: Remove; no longer needed.
1937 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1938 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1939 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1940 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1941 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1942 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1943 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1944 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1945 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1946 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1947 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1948 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1949 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1950 Import changes from coreutils.
1952 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1954 Merge from coreutils.
1956 * .gdb-history: Remove; this doesn't belong here.
1958 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1959 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1960 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1962 * dirname.h: Include <stdbool.h>.
1963 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1964 for consistency with POSIX terminology. All uses changed.
1965 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1966 (strip_trailing_slashes): Use bool for booleans.
1967 * stripslash.c (strip_trailing_slashes): Likewise.
1969 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1970 sometimes returns a positive errno value even when it succeeds.
1971 (print_errno_message) [!LIBC]: Fall back on strerror if
1974 * path-concat.c (mempcpy): Don't define if a system header defines it.
1975 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1976 (longest_relative_suffix): New function.
1977 (path_concat): Use it. Assume first argument is not NULL.
1978 Port to DOS. Omit redundant separators.
1979 Report an error instead of returning NULL.
1980 Use mempcpy instead of memcpy.
1981 (xpath_concat): Remove: not declared or used.
1983 * same.h: Include <stdbool.h>
1984 (same_name): Return bool, not int.
1985 * same.c (same_name): Likewise.
1986 (errno): Don't declare; we assume C89 or better now.
1988 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1989 if not already defined.
1991 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1992 * dup-safer.c (errno): Likewise.
1994 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1996 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1999 2004-08-03 Simon Josefsson <jas@extundo.com>
2001 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
2002 * progname.h: Don't include stdbool.h.
2004 2004-08-02 Simon Josefsson <jas@extundo.com>
2006 * getsubopt.h: New file, with comments from Bruno Haible.
2007 * getsubopt.c: New file, from glibc, but slightly modified based on
2008 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
2010 2004-08-01 Simon Josefsson <jas@extundo.com>
2012 * xgetdomainname.c: Include stdlib.h, for free().
2014 2004-07-16 Simon Josefsson <jas@extundo.com>
2016 * dummy.c: New file.
2018 2004-07-16 Bruno Haible <bruno@clisp.org>
2020 * backupfile.h: Add extern "C" for C++.
2021 * closeout.h: Likewise.
2022 * copy-file.h: Likewise.
2023 * findprog.h: Likewise.
2024 * full-write.h: Likewise.
2025 * pathname.h: Likewise.
2026 * progname.h: Likewise.
2027 * stpcpy.h: Likewise.
2028 * stpncpy.h: Likewise.
2029 * strcase.h: Likewise.
2030 * strstr.h: Likewise.
2031 * xalloc.h: Likewise.
2033 * mbswidth.h: Add extern "C" for C++.
2034 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
2036 2004-07-09 Simon Josefsson <jas@extundo.com>
2038 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
2039 failed without this.)
2041 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
2043 * fchown-stub.c: New file.
2045 2004-06-24 Jim Meyering <jim@meyering.net>
2047 * obstack.h (obstack_base): Cast to (void *), per documentation.
2049 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
2051 * argz.c, argz_.h: New files, which are autoupdated from libtool.
2053 2004-06-01 Jim Meyering <jim@meyering.net>
2055 * calloc.c: New file.
2057 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
2059 * getdate.y (yylex): Allow space between sign and number.
2060 Problem reported by Dan Jacobson.
2062 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
2063 and Jim Meyering <jim@meyering.net>
2065 Merge from coreutils CVS.
2067 * stat-macros.h: New file, with contents from file-type.h
2068 and coreutils' system.h.
2069 * file-type.c: Include "stat-macros.h".
2070 * file-type.h (file_type): Move all macro definitions to new file,
2073 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
2074 Wrap old code with this conditional.
2075 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
2076 function that does not dereference symlinks.
2077 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
2079 * xreadlink.c: Include xreadlink.h first, to catch .h file
2080 dependency problems.
2081 (xreadlink): Accept new arg SIZE, for efficiency.
2082 All decls and uses changed.
2083 * xreadlink.h: Include <stddef.h>, for size_t.
2085 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
2086 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
2088 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
2090 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
2092 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
2093 macros to be defined.
2094 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
2095 the allocator returns NULL because the requested size is zero.
2097 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
2099 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
2100 var. Add comment explaining why libc still defines it. This
2101 merges the following patch from glibc:
2102 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
2104 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
2106 * obstack.c (_obstack): Remove unused variable. It hasn't been
2107 present in glibc since revision 1.1 of this file.
2108 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
2109 obstack_alignment_mask, obstack_alloc, obstack_base,
2110 obstack_blank, obstack_blank_fast, obstack_chunk_size,
2111 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
2112 obstack_grow0, obstack_init, obstack_int_grow,
2113 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
2114 obstack_next_free, obstack_object_size, obstack_ptr_grow,
2115 obstack_ptr_grow_fast, obstack_room): Remove declarations of
2116 nonexistent functions.
2118 2004-05-17 Derek R. Price <derek@ximbiot.com>
2119 Paul Eggert <eggert@cs.ucla.edu>
2121 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
2123 2004-05-14 Bruno Haible <bruno@clisp.org>
2125 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
2126 that consists of a '.' followed by an empty digit string.
2127 Patch by Tor Lillqvist <tml@iki.fi>.
2129 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
2131 Port obstack to the AS/400, where pointers are 16 bytes wide and
2132 you cannot cast an integer to a valid pointer. This patch is
2133 currently waiting to be integrated into glibc; see
2134 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
2136 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
2137 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
2138 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
2139 (struct obstack): temp member is now a union of a pointer and
2140 an integer, instead of an integer. All integer uses changed.
2141 This does not affect the physical layout of struct obstack,
2142 except on hosts (like the AS/400) where the size or alignment of
2143 void * is greater than that of ptrdiff_t.
2144 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
2145 __STDC__)]: Store temporary in pointer member of union, not
2147 * obstack.c: Include <stddef.h>, for offsetof.
2148 (struct fooalign): Remove; it doesn't need a name.
2149 (union fooround): Change double to long double, and add void *.
2150 (DEFAULT_ALIGNMENT): Use offsetof to compute.
2151 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
2152 not a macro. Hence the values are always int; so remove all
2153 casts-to-int in uses.
2155 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
2156 Derek Price <derek@ximbiot.com>
2158 * alloca.c: Include <alloca.h>, to get our interface.
2159 * alloca_.h: Use __alloca on AIX, so that we don't have to
2160 include <alloca.h> first. Use C89 prototype for alloca; this
2161 requires including <stddef.h> for size_t. Use extern "C" if C++.
2162 Use #elif for simplicity, since we can assume C89 now.
2163 Don't try to source the system alloca.h since it will not be found
2164 and to prevent recursively including its replacement.
2165 * fnmatch.c: Include <alloca.h> instead of opencoding.
2166 * regex.c: Likewise.
2168 2004-05-16 Derek Price <derek@ximbiot.com>
2169 Paul Eggert <eggert@cs.ucla.edu>
2171 getline cleanup. This changes the getndelim2 API: both order of
2172 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
2175 * getline.c: Don't include stddef.h or stdio.h, since our
2176 interface does that.
2177 (getline): Always use getdelim, so that we don't have two
2178 copies of this code.
2179 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
2181 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
2182 (GETNDELIM2_MAXIMUM): New macro.
2183 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
2184 instead of the old practice of delim2==0. All callers changed.
2185 Return -1 on overflow, instead of returning junk.
2186 Do not set *linesize unless allocation succeeds.
2187 * getndelim2.h: Do not include stddef.h; no longer needed, now
2188 that we include sys/types.h.
2189 * getnline.h: Likewise.
2190 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
2191 (getndelim2): Reorder arguments.
2192 * getnline.c (getnline, getndelim):
2193 Don't discard the NMAX argument.
2194 (getnline): Invoke getndelim, to avoid code duplication.
2195 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
2196 of (size_t) -1 by callers of the getnline family.
2198 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
2200 * nanosleep.c (suspended): Change its type from int to
2201 sig_atomic_t volatile.
2202 (first_call): Make it private to rpl_nanosleep, and have it
2203 be zero initially as that's a bit faster.
2204 (my_usleep): Round up fractional times instead of truncating them,
2205 as this is the usual meaning for 'sleep'.
2207 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
2209 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
2210 (ENOSYS): Define if not defined.
2211 (settime): Fall back on stime if it exists and settimeofday fails.
2212 But don't bother with fallbacks if a method fails with errno == EPERM.
2214 2004-05-11 Jim Meyering <jim@meyering.net>
2216 Prior to this change, the save_cwd caller required read access to the
2217 current directory on most systems (ones with the fchdir function).
2219 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
2220 fails, try write-only, and finally, resort to using xgetcwd.
2222 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
2224 * obstack.c, obstack.h: Import changes from libc.
2226 2004-04-28 Bruno Haible <bruno@clisp.org>
2228 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
2229 implicitly appends .exe to executables.
2230 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
2231 accepts Windows pathnames.
2232 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2233 Cygwin like Windows, since it now accepts Windows pathnames.
2234 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2235 Cygwin like Windows, since it now accepts Windows pathnames.
2236 Reported by Derek Robert Price <derek@ximbiot.com>.
2238 2004-04-20 Jim Meyering <jim@meyering.net>
2240 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
2242 2004-04-20 Jim Meyering <jim@meyering.net>
2243 Bruno Haible <bruno@clisp.org>
2245 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
2246 memory when realloc fails.
2248 2004-04-18 Jim Meyering <jim@meyering.net>
2250 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
2251 don't leak memory and do call END_UTMP_ENT.
2253 2004-04-11 Paul Eggert <eggert@twinsun.com>
2255 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
2256 (CHAR_BIT): Remove, since we assume C89.
2257 Include <stdint.h> if available, as per current Autoconf CVS advice.
2259 2004-03-30 Paul Eggert <eggert@twinsun.com>
2261 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
2262 not bool, to be more consistent with Unix conventions.
2263 Suggested by Bruno Haible.
2265 Merge from coreutils.
2267 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
2270 * getdate.h: Include stdbool.h, and timespec.h instead of
2271 the usual <time.h> dance.
2272 (get_date): Change signature to support fractional time stamps.
2273 All callers changed.
2274 * getdate.y: Include "getdate.h" first, as we can now
2275 assume C89 and don't need to worry about 'const'.
2276 Similarly, include "unlocked-io.h" near start, not in middle.
2278 (textint.value): Use long int rather than int.
2279 (textint.digits): Use size_t rather than int.
2280 (BILLION, LOG10_BILLION): New constants.
2281 (parser_control): New member rel_ns. Members day_ordinal,
2282 time_zone, month, day, hour, minutes, rel_year, rel_month,
2283 rel_day, rel_hour, rel_minutes, rel_seconds
2284 are now long int, not int. Member seconds is now struct timespec,
2285 not int. New member timespec_seen. Members dates_seen, days_seen,
2286 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
2288 (%union.intval): Now long int, not int.
2289 New member timespec.
2290 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
2291 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
2292 (spec): Now is a timespec or an item list.
2293 (timespec, items): New nonterminals.
2294 (time, rel, relunit, number, get_date):
2295 Add support for fractional seconds.
2296 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
2297 (gmtime, localtime, mktime): Remove decls; not needed with C89.
2298 (to_hour): First arg is now long int, not int.
2299 (to_year): Returns long int, not int.
2300 Don't treat year -70 like 70.
2301 (tm_diff): Returns long int, not int.
2302 (lookup_word): Use bool instead of int when appropriate.
2303 (yylex): Use size_t for count, not int.
2304 Detect overflow when parsing large integer constants.
2305 Add support for fractions.
2306 (get_date): Make pointers 'const' if possible.
2307 Use more-portable code to detect integer overflow.
2308 (main) [TEST]: Adjust to above changes. Test for localtime failure.
2309 Don't use ctime; it's not reliable if the year has >4 digits.
2311 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
2312 This is for compatibility with BSD.
2314 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
2315 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
2316 From coreutils' system.h.
2318 * userspec.c: Don't include "posixver.h".
2319 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
2320 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
2321 compatible extension. Simplify code by removing a boolean int
2322 that was always nonzero if a string was nonnull.
2324 2004-03-30 Jim Meyering <jim@meyering.net>
2326 Merge from coreutils.
2328 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
2330 * readtokens.c (readtoken): Don't leak 64 bytes when reading
2331 an empty input stream.
2333 * readtokens.c: Include <stdbool.h>.
2334 (readtoken): Use `size_t' rather than int/long.
2335 All callers adjusted.
2336 Use `bool' rather than `int' where appropriate.
2337 Use memset rather than an explicit loop.
2338 Use x2nrealloc rather than xrealloc.
2339 Allow the use of `\0' as a delimiter.
2340 (readtokens): Likewise.
2341 * readtokens.h (readtoken, readtokens): Update prototypes.
2343 2004-03-30 Bruno Haible <bruno@clisp.org>
2345 * getloadavg.c (getloadavg): Don't assume setlocale returns
2348 2004-03-29 Paul Eggert <eggert@twinsun.com>
2350 Merge changes to getloadavg.c from coreutils and Emacs.
2352 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
2353 Define to an expression, not to the empty string.
2354 Include cloexec.h and xalloc.h.
2355 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
2356 Use set_cloexec_flag rather than rolling our own.
2357 * cloexec.c, cloexec.h: New files.
2359 2004-03-18 Paul Eggert <eggert@twinsun.com>
2361 * getopt.h: Sync with libc CVS.
2363 2004-03-18 Paul Eggert <eggert@twinsun.com>
2364 Bruno Haible <bruno@clisp.org>
2366 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
2367 not on all platforms that have <wchar.h>.
2368 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2370 2004-03-09 Paul Eggert <eggert@twinsun.com>
2372 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
2374 * getopt_int.h: New file, also synced from libc.
2376 2004-03-07 Paul Eggert <eggert@twinsun.com>
2378 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
2379 '#if' expressions. Unlike the code it replaces, it does not
2380 depend on (defined _SC_PAGESIZE). However, it does depend on
2381 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
2382 first reported by Jason Andrade in
2383 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
2385 2004-01-18 Simon Josefsson <jas@extundo.com>
2387 * strdup.h: New file.
2388 * strdup.c: Include it.
2389 * path-concat.c: Include strdup.h. Drop strdup declaration.
2390 * userspec.c: Include strdup.h. Drop strdup declaration.
2392 2004-02-06 Karl Berry <karl@gnu.org>
2394 * config.charset: update from gettext 0.14.1.
2396 2004-02-05 Paul Eggert <eggert@twinsun.com>
2398 Add comments and code, prompted by suggestions from Bruno Haible
2400 * quotearg.h (quotearg_alloc): New decl. Improve the comments
2401 describing the enum quoting_style values.
2402 * quotearg.c (quotearg_alloc): New function.
2403 (quotearg_buffer_restyled): Treat lone { and } as special.
2404 Treat = as special. Work around bug with older shells
2405 that "see" a '\' that is really the 2nd byte of a multibyte char.
2406 Quote empty string with shell_quoting_style.
2408 2004-02-03 Bruno Haible <bruno@clisp.org>
2410 * pipe.h: New file, from GNU gettext.
2411 * pipe.c: New file, from GNU gettext.
2413 2004-01-27 Bruno Haible <bruno@clisp.org>
2415 * execute.h: New file, from GNU gettext.
2416 * execute.c: New file, from GNU gettext.
2417 * w32spawn.h: New file, from GNU gettext.
2419 2004-01-23 Paul Eggert <eggert@twinsun.com>
2421 Exit-status fix from coreutils.
2423 Use exit_failure consistently in place of EXIT_FAILURE,
2424 so that program exit statuses are consistent on failure.
2426 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2427 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2428 * argmatch.h: Comment fix to match the above.
2429 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2430 Now a macro referring to exit_failure, instead of a separate
2431 variable. Include "exitfail.h" to get it.
2432 * xstrtol.h: Include "exitfail.h".
2433 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2435 * long-options.c (parse_long_options): Use prototype
2436 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2439 2004-01-21 Jim Meyering <jim@meyering.net>
2441 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2442 so as not to conflict with a different-sized __mktime_internal
2443 function in GNU libc.
2444 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2445 Problem building statically-linked `ls' reported by Michael Brunnbauer.
2447 2004-01-18 Paul Eggert <eggert@twinsun.com>
2449 Merge from diffutils.
2451 * file-type.c (file_type): Add typed memory objects.
2452 * file-type.h (S_TYPEISTMO): New macro.
2454 * c-stack.h (c_stack_action): Remove argv argument.
2455 * c-stack.c (c_stack_action): Likewise. All uses changed.
2456 (die): Don't calculate message unless segv_action returns.
2457 (get_stack_location, min_address_from_argv, max_address_from_argv,
2458 volatile stack_base, volatile_stack_size): Remove.
2459 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2460 that every segmentation violation is a stack overflow. (Ouch!)
2461 See Debian bug 136249 (still outstanding) for more info about why
2462 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2464 2003-11-30 Bruno Haible <bruno@clisp.org>
2466 Safer stack allocation.
2467 * setenv.c: Include allocsa.h.
2468 (alloca): Remove fallback definition.
2469 (freea): Remove macro.
2470 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2473 2003-10-17 Bruno Haible <bruno@clisp.org>
2475 * binary-io.h: Avoid warnings on Cygwin.
2477 2003-12-28 Bruno Haible <bruno@clisp.org>
2479 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2480 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2482 2003-11-28 Bruno Haible <bruno@clisp.org>
2484 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2486 2003-11-27 Bruno Haible <bruno@clisp.org>
2488 * wait-process.c: On Windows, include windows.h. Needed on mingw.
2490 2003-11-17 Bruno Haible <bruno@clisp.org>
2492 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2494 2003-11-24 Bruno Haible <bruno@clisp.org>
2496 * xallocsa.h: New file, from GNU gettext.
2497 * xallocsa.c: New file, from GNU gettext.
2499 2003-11-24 Bruno Haible <bruno@clisp.org>
2501 * allocsa.h: New file, from GNU gettext.
2502 * allocsa.c: New file, from GNU gettext.
2504 2003-11-24 Bruno Haible <bruno@clisp.org>
2506 * eealloc.h: New file.
2508 2004-01-15 Jim Meyering <jim@meyering.net>
2510 Merge from coreutils.
2512 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2513 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2514 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2516 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2517 optional configure-time default.
2519 * version-etc.c (version_etc_copyright): Update copyright date.
2521 * xreadlink.c (xreadlink): Correct outdated comment.
2523 2004-01-15 Paul Eggert <eggert@twinsun.com>
2525 Merge from coreutils.
2527 * posixver.c: Include posixver.h.
2529 * same.c: Include <stdbool.h>, <limits.h>.
2530 (_POSIX_NAME_MAX): Define if not defined.
2532 (same_name): If file names are silently truncated, report
2533 that the file names are the same if they are the same after
2534 the silent truncation.
2536 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2537 conversion function.
2538 * xstrtod.c (xstrtod): Likewise. All callers changed to
2539 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2542 2004-01-14 Paul Eggert <eggert@twinsun.com>
2544 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2545 with like-named macro in fnmatch.c.
2546 (EXT): Use an internal constant instead.
2548 Merge fnmatch patches from glibc.
2549 * fnmatch.c (mbsinit): Remove define.
2550 Add libc_hidden_ver (__fnmatch, fnmatch).
2551 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2552 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2554 2003-12-14 Karl Berry <karl@gnu.org>
2556 * config.charset: update from gettext-runtime.
2558 2003-12-03 Paul Eggert <eggert@twinsun.com>
2560 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2561 Bug reported by Alfred M. Szmidt.
2563 2003-11-29 Karl Berry <karl@gnu.org>
2565 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2567 2003-11-23 Paul Eggert <eggert@twinsun.com>
2568 Bruno Haible <bruno@clisp.org>
2570 * printf-parse.h: Don't include sys/types.h.
2571 (ARG_NONE): New macro.
2572 (char_directive): Change type of *arg_index fields to size_t.
2573 * printf-parse.c: Don't include sys/types.h.
2574 (SSIZE_MAX): Remove macro.
2575 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2576 Remove unnecessary overflow check.
2577 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2580 2003-11-24 Paul Eggert <eggert@twinsun.com>
2582 * alloca.c: Remove dependency on xalloc module.
2583 (xalloc_die): Remove.
2584 (memory_full) [!defined emacs]: New macro.
2585 [!defined emacs]: Don't include xalloc.h.
2586 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2587 address arithmetic overflows. Change datatypes a bit to avoid
2590 2003-11-22 Jim Meyering <jim@meyering.net>
2592 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2594 2003-11-17 Bruno Haible <bruno@clisp.org>
2596 * vasnprintf.c (alloca): Remove fallback definition.
2597 (freea): Remove definition.
2598 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2599 Reported by Paul Eggert.
2601 2003-11-17 Jim Meyering <jim@meyering.net>
2603 On systems without utime and without a utimes function capable of
2604 dealing with a NULL struct utimbuf* argument, this utime replacement
2605 could -- in unusual circumstances -- leak a file descriptor.
2606 * utime.c: Include <unistd.h> and <errno.h>.
2607 (utime_null): Be sure to close `fd' and to preserve errno.
2608 Reported by Geoff Collyer via Arnold Robbins.
2610 2003-11-16 Paul Eggert <eggert@twinsun.com>
2611 Bruno Haible <bruno@clisp.org>
2613 Protect against address arithmetic overflow.
2614 * printf-args.h: Include stddef.h.
2615 (arguments): Change type of field 'count' to size_t.
2616 * printf-args.c (printf_fetchargs): Use size_t instead of
2617 'unsigned int' where appropriate.
2618 * printf-parse.h: Include sys/types.h.
2619 (char_directive): Change type of *arg_index fields to ssize_t.
2620 (char_directives): Change type of fields 'count', max_*_length to
2622 * printf-parse.c: Include sys/types.h and xsize.h.
2623 (SSIZE_MAX): Define fallback value.
2624 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2625 instead of 'int' where appropriate. Check a_allocated, d_allocated
2626 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2627 * vasnprintf.c: Include xsize.h.
2628 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2629 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2630 overflow. Avoid wraparound when converting a width or precision from
2633 2003-11-16 Bruno Haible <bruno@clisp.org>
2635 Update from GNU gettext.
2636 * printf-parse.c: Generalize to it can be compiled for wide strings.
2637 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2638 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2639 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2640 SNPRINTF): New macros.
2641 Don't include <alloca.h> if the file is used inside libintl.
2642 (local_wcslen): New function, for Solaris 2.5.1.
2643 (VASNPRINTF): Use it instead of wcslen.
2645 2003-11-16 Bruno Haible <bruno@clisp.org>
2647 * xsize.h (xmax): New function.
2648 (xsum, xsum3, xsum4): Declare as "pure" functions.
2650 2003-11-12 Paul Eggert <eggert@twinsun.com>
2652 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2653 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2654 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2655 heuristic is just as accurate as far as we know, and it removes a
2656 dependency on size_max.m4 and ptrdiff_max.m4.
2658 2003-11-12 Paul Eggert <eggert@twinsun.com>
2660 * xstrtol.c (__xstrtol): Remove "break" immediately after
2661 "return", to pacify some unknown compiler. Problem reported
2664 2003-11-11 Bruno Haible <bruno@clisp.org>
2666 * xsize.h (SIZE_MAX): Remove fallback definition.
2667 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2670 2003-11-10 Paul Eggert <eggert@twinsun.com>
2672 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2673 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2674 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2676 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2677 not (size_t) -1, since it's defined here.
2679 2003-11-06 Paul Eggert <eggert@twinsun.com>
2681 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2682 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2683 Reject sizes of exactly SIZE_MAX bytes.
2684 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2685 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2687 2003-11-05 Bruno Haible <bruno@clisp.org>
2689 * xsize.h: Include limits.h, to avoid a possible collision with
2690 SIZE_MAX defined in <limits.h> on Solaris.
2692 2003-11-04 Bruno Haible <bruno@clisp.org>
2694 * xsize.h: New file.
2695 * linebreak.c: Include xsize.h.
2696 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2697 argument for overflow.
2698 Suggested by Paul Eggert.
2700 2003-10-31 Bruno Haible <bruno@clisp.org>
2702 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2703 to avoid (extremely rare) race condition.
2704 Suggested by Paul Eggert.
2706 2003-11-03 Jim Meyering <jim@meyering.net>
2708 * userspec.c: Include "userspec.h".
2709 * userspec.h: New file.
2711 2003-10-31 Paul Eggert <eggert@twinsun.com>
2713 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2714 * mountlist.c (SIZE_MAX): Define if not defined already.
2715 (read_filesystem_list): Set and use me_type_malloced.
2716 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2717 whatever the type happens to be), for brevity and consistency.
2718 Check for size calculation overflow on Alphas running OSF/1.
2720 2003-10-31 Jim Meyering <jim@meyering.net>
2722 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2724 * linebuffer.c: Include <string.h> for declaration of memset.
2726 2003-10-30 Paul Eggert <eggert@twinsun.com>
2727 Bruno Haible <bruno@clisp.org>
2729 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2730 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2732 2003-10-29 Paul Eggert <eggert@twinsun.com>
2734 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2735 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2737 * quotearg.c (quotearg_n_options): Use it.
2738 * group-member.c: Include <stdbool.h>.
2739 (free_group_info): Arg is now const *; don't free arg.
2740 (get_group_info): Now returns bool and accepts struct group_info *,
2741 rather than returning a malloc'ed struct group_info *.
2742 All uses changed. Check for overflow in internal size calculation.
2744 * getusershell.c (readname): Simplify the code by using x2nrealloc
2745 rather than xmalloc/xrealloc.
2746 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2747 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2748 conformance bug: the old code used a pointer after freeing the
2749 storage that it addressed.
2750 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2751 rather than doing it by hand.
2752 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2753 the buffer preserved. Use free and xmalloc instead.
2754 * quotearg.c (quotearg_n_options): Likewise.
2755 Use a simpler test for size overflow. Don't use xalloc_oversized
2756 because unsigned int might be wider than size_t (!); this suggests
2757 that we should switch from unsigned int to size_t for slot numbers.
2759 2003-10-27 Bruno Haible <bruno@clisp.org>
2761 * stdbool_.h: Better support for BeOS.
2763 2003-10-27 Paul Eggert <eggert@twinsun.com>
2765 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2766 to allocate the returned structure. Do not allocate a subarray,
2767 as x2nrealloc will do that.
2768 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2769 instead of xnrealloc.
2770 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2772 2003-10-26 Paul Eggert <eggert@twinsun.com>
2774 * xalloc.h (xalloc_oversized): New static inline function, for
2775 callers that want to do their own size-overflow checking. Include
2776 <stdbool.h>, since xalloc_oversized returns bool.
2777 * xalloc.c (array_size_overflow): Remove. All callers changed
2778 to use xalloc_oversized.
2780 Add two functions x2realloc, x2nrealloc, for programs that grow
2781 arrays dynamically by doubling their sizes.
2782 * xalloc.h (x2realloc, x2nrealloc): New decls.
2783 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2786 Port to C99 semantics for 'inline' of external functions.
2787 Bug reported by Bruno Haible.
2788 * xmalloc.c (xnmalloc_inline): New static inline function,
2789 with the old contents of xnmalloc.
2790 (xnmalloc, xmalloc): Use it.
2791 (xnrealloc_inline): New static inline function,
2792 with the old contents of xnrealloc.
2793 (xnrealloc, xrealloc): Use it.
2795 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2797 2003-10-25 Paul Eggert <eggert@twinsun.com>
2799 Fix several address-calculation bugs in the hash modules,
2800 plus some minor code cleanup.
2802 * hash.h: Include <stdbool.h>, for bool.
2803 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2804 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2805 hash_get_n_entries, hash_get_max_bucket_length,
2806 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2807 hash_rehash): Use size_t rather than unsigned.
2808 * hash.c (struct hash_table, hash_get_n_buckets,
2809 hash_get_n_buckets_used, hash_get_n_entries,
2810 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2811 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2812 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2814 (SIZE_MAX): Define if not defined.
2815 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2816 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2818 Use const * when possible.
2819 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2820 (check_tuning): Fix bug: if tuning parameters were very close to
2821 0 or 1, rounding errors could have caused subscript violations.
2822 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2823 (hash_initialize): Add 'fail:' label
2824 to free table and return NULL, and use it to simplify code.
2825 Use calloc rather than clearing the storage ourself.
2826 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2827 buffer size calculations.
2828 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2829 Include <stddef.h>, for size_t.
2830 * hash-pjw.c (hash_pjw): Likewise.
2831 Switch to method described by Bruno Haible.
2832 Include <limits.h>, for CHAR_BIT.
2833 (SIZE_BITS): New macro.
2835 2003-10-21 Paul Eggert <eggert@twinsun.com>
2837 * getndelim2.c (getndelim2): When size calculation overflows,
2838 ceiling the allocation at NMAX bytes rather than silently
2839 discarding input bytes before NMAX is reached. This makes
2840 a difference only if NMAX exceeds SIZE_MAX / 2.
2842 * obstack.c: Merge from glibc.
2843 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2844 Add libc_hidden_def (_obstack_newchunk).
2845 (_obstack_free) [! defined _LIBC]: Remove.
2846 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2847 a clone of the function body.
2848 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2849 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2851 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2852 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2855 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2856 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2857 Don't use lvalue casts, as GCC plans to remove support for them
2858 in GCC 3.5. Reported by Joseph S. Myers. This bug
2859 was also present in the non-GCC version, indicating that this
2860 code had always been buggy and had never been widely used.
2861 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2862 Use the fast variant of each macro, rather than copying the
2863 definiens of the fast variant; that way, we'll be more likely to
2864 catch future bugs in the fast variants.
2866 2003-10-20 Bruno Haible <bruno@clisp.org>
2868 * wait-process.h: New file, from GNU gettext.
2869 * wait-process.c: New file, from GNU gettext.
2871 2003-10-19 Jim Meyering <jim@meyering.net>
2873 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2875 2003-10-16 Paul Eggert <eggert@twinsun.com>
2877 * getgroups.c: Include <errno.h>, <stdlib.h>.
2878 (getgroups): First arg is int, not size_t.
2879 Don't let 'free' mangle errno.
2881 2003-10-16 Jim Meyering <jim@meyering.net>
2883 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2885 2003-10-15 Paul Eggert <eggert@twinsun.com>
2887 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2889 (new_exclude, add_exclude_file): Initial size no longer needs to
2891 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2892 our own address arithmetic overflow checking.
2894 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2895 (fnmatch): Do not alloca more than 2000 wide characters;
2896 instead, use malloc for large buffers.
2897 Check for address arithmetic overflow, and return -1
2898 with errno set to ENOMEM in that case.
2899 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2900 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2901 instead, return -1. Check for address arithmetic overflow.
2903 2003-10-14 Paul Eggert <eggert@twinsun.com>
2905 Handle invalid suffixes and overflow independently, so that
2906 callers can treat them independently as needed. Fix some bugs in
2907 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2908 suffix for a human-readable blocksize. The major caller-visible
2909 change is the addition of a new
2910 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2911 that both overflow and suffix chars were found.
2913 * human.c (humblock): Don't check separately for invalid suffix
2914 char; that is xstrtoumax's job (now that its bug is fixed).
2915 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2916 INTMAX_MAX]: New macros.
2917 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2918 TYPE_MAXIMUM): New macros.
2919 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2920 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2921 if overflow occurs, as it's what __strtol does and it's more useful
2923 (__xstrtol): If __strtol reports some error other than ERANGE,
2924 reflect it to the caller as LONGINT_INVALID. If it reports
2925 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2926 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2927 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2929 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2930 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2931 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2932 [defined UINTMAX_MAX]: New macros.
2934 2003-10-14 Bruno Haible <bruno@clisp.org>
2936 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2937 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2938 Also use volatile where needed.
2940 2003-10-12 Paul Eggert <eggert@twinsun.com>
2942 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2943 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2944 and define in terms of the other primitives.
2945 * xmalloc.c: Include stdbool.h; do not include exit.h.
2946 (SIZE_MAX): Define if not already defined.
2947 (array_size_overflow): New function.
2948 (xalloc_die): Abort instead of exiting if 'error' returns.
2949 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2950 (xmalloc, xrealloc): Use them.
2951 (xcalloc): Check for address arithmetic overflow.
2952 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2953 a bit faster than strcpy.
2955 2003-10-08 Paul Eggert <eggert@twinsun.com>
2957 Merge getpass from libc, plus a few fixes.
2959 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2960 Include <stdbool.h>.
2961 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2962 __fsetlocking to empty.
2963 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2964 do include <bits/libc-lock.h>.
2965 Do not include <fcntl.h>; not needed.
2966 [_LIBC]: Include <wchar.h>.
2967 (NOTCANCEL_MODE): New macro.
2968 (flockfile, funlockfile) [_LIBC]: New macros.
2969 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2970 [!_LIBC]: New macros.
2971 (call_fclose): New function.
2972 (getpass): Use it. Save tty stream separately; this simplifies the
2973 code and makes it more reliable if stdin happens to equal stdout.
2974 Invoke __fsetlocking on tty.
2975 Handle thread cancellation if needed.
2976 Namespace cleanup (use __tcgetattr, __getline).
2977 Use bool for Booleans.
2978 [USE_IN_LIBIO]: Handle wide streams.
2979 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2980 stream might go where.
2982 * unlocked-io.h: Include <stdio.h>, so that the caller
2983 doesn't have to include <stdio.h> before us.
2984 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2985 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2986 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2987 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2988 if not declared, so that we can use getpass.c code from libc without
2990 (flockfile, ftrylockfile, funlockfile): New macros.
2992 2003-10-06 Bruno Haible <bruno@clisp.org>
2994 * version-etc-2.h: Remove file.
2995 * version-etc-2.c: Remove file.
2997 2003-09-25 Jim Meyering <jim@meyering.net>
2998 Bruno Haible <bruno@clisp.org>
3000 This lets translators provide better translations for the
3001 "Written by ..." part of --version output.
3002 * version-etc.h: Include stdarg.h.
3003 (version_etc_copyright): Declare as readonly.
3004 (version_etc): Make this function variadic with a NULL-terminated list
3005 of author name strings.
3006 (version_etc_va): New declaration.
3007 * version-etc.c: Include stdarg.h, stdlib.h.
3008 (version_etc_copyright): Declare as readonly.
3009 (version_etc_va): New function. Provide a different translatable string
3010 for each possible number of authors < 10. Abbreviate when there are 10
3012 (version_etc): Make this function variadic. Call version_etc_va.
3013 Suggestion from Gary V. Vaughan.
3015 * long-options.h (parse_long_options): Change prototype: the authors
3016 string is moved to the end and becomes variadic.
3017 * long-options.c: Include stdarg.h.
3018 (parse_long_options): Make this function variadic, too.
3019 Call version_etc_va, not version_etc.
3021 2003-10-06 Bruno Haible <bruno@clisp.org>
3023 * fatal-signal.h: New file, from GNU gettext.
3024 * fatal-signal.c: New file, from GNU gettext.
3026 2003-10-04 Karl Berry <karl@gnu.org>
3028 * argp*: update from libc.
3030 2003-10-01 Larry Jones <lawrence.jones@eds.com>
3032 * getpass.c (getpass): Use a no-op fseek when switching from input to
3033 output mode on the same stream.
3035 2003-09-29 Paul Eggert <eggert@twinsun.com>
3037 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
3038 Fix arg typo in previous patch.
3040 2003-09-28 Jim Meyering <jim@meyering.net>
3042 * error.c: Correct cpp indentation.
3044 2003-09-27 Paul Eggert <eggert@twinsun.com>
3046 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
3047 Omit the special code that used __typeof__, since we worry that
3048 it could be more trouble than it's worth. See:
3049 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
3050 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
3054 2003-09-26 Jim Meyering <jim@meyering.net>
3056 * error.c (error_tail): Move some declarations
3057 into inner scope where the local variables are used.
3059 2003-09-26 Bruno Haible <bruno@clisp.org>
3061 * stpncpy.h (gnu_stpncpy): New declaration.
3062 (stpncpy): Define as alias for gnu_stpncpy.
3063 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
3065 2003-09-26 Paul Eggert <eggert@twinsun.com>
3067 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
3068 (error_tail): Do not loop, reallocating temporary buffer, since
3069 the output cannot contain more wide characters than the input
3070 contains bytes, the size must be big enough already. This avoids
3071 one potential size overflow calculation. Check for size overflow
3072 when calculating temporary buffer size. Free temporary buffer
3073 when done, if it was allocated with malloc; this plugs a memory
3074 leak. Remove casts from void * to pointers, that are no longer
3075 needed now that we're assuming C89 or better.
3077 Merge error changes from glibc.
3079 * error.c, error.h: Update copyright notice header to match glibc.
3080 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
3081 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
3082 Disable cancellation while printing error.
3083 * error.h: Prepend __ to parameter names.
3085 2003-09-25 Karl Berry <karl@gnu.org>
3087 * argp-fmtstream.c, argp-help.c: update from libc.
3089 2003-09-25 Bruno Haible <bruno@clisp.org>
3091 * version-etc-2.h: New file, from version-etc.h with modifications.
3092 * version-etc-2.c: New file, from version-etc.c with modifications.
3094 2003-09-25 Simon Josefsson <jas@extundo.com>
3096 * xgetdomainname.h: New file.
3097 * xgetdomainname.c: New file.
3099 2003-09-25 Simon Josefsson <jas@extundo.com>
3100 Bruno Haible <bruno@clisp.org>
3102 * getdomainname.h: New file.
3103 * getdomainname.c: New file.
3105 2003-09-24 Paul Eggert <eggert@twinsun.com>
3107 * linebuffer.c (freebuffer): Don't free the argument, just
3108 the buffer associated with the argument. Bug reported by
3111 2003-09-19 Karl Berry <karl@gnu.org>
3113 * argp.h: update from libc.
3115 2003-09-16 Paul Eggert <eggert@twinsun.com>
3117 * linebuffer.c (readlinebuffer): Return NULL immediately upon
3118 input error, instead of returning NULL the next time we are called
3119 (and therefore losing track of errno).
3121 2003-09-15 Paul Eggert <eggert@twinsun.com>
3123 * getndelim2.c (getndelim2): Don't trash errno when a read
3124 fails, so that the caller gets the proper errno.
3126 * readutmp.c (read_utmp): Likewise.
3127 Check for fstat error. Close stream and free storage
3130 2003-09-14 Bruno Haible <bruno@clisp.org>
3132 * fwriteerror.h: New file.
3133 * fwriteerror.c: New file.
3135 2003-09-14 Jim Meyering <jim@meyering.net>
3137 * getloadavg.c: Correct cpp indentation.
3138 * strdup.c: Likewise.
3139 * vasnprintf.c: Likewise.
3141 2003-09-12 Paul Eggert <eggert@twinsun.com>
3143 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
3144 * obstack.c [!defined _LIBC]: Likewise.
3145 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
3146 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
3147 * exitfail.c: Don't include stdlib.h; no longer needed.
3149 More changes to assume C89 or better.
3151 * error.c (error_tail): Assume vprintf.
3153 * argmatch.c (getenv): Remove decl.
3154 * progreloc.c (get_full_program_name): Define via prototype.
3155 * setenv.c (clearenv): Likewise.
3156 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
3158 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
3159 (malloc, memcpy): Remove decls.
3160 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
3161 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
3162 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
3163 (memcpy): Remove macro.
3164 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
3165 (__P): Remove. All uses removed.
3166 (PTR): Remove. All uses changed to void *.
3167 (CHAR_BIT, NULL): Remove.
3168 (spaces, zeros, memset_space, memset_zero)
3169 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
3171 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
3172 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
3173 Define with prototype.
3174 Remove now-unnecessary prototype decl.
3175 (extra_args_spec): Assume ANSI C. All uses changed.
3176 (extra_args_spec_iso): Remove.
3177 (my_strftime, emacs_strftimeu): Define via prototype.
3178 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
3180 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
3181 * strtoimax.c: Include <stdlib.h> unconditionally.
3182 (strtoul, strtol): Remove decls.
3183 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
3185 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
3186 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
3187 (LOCALE_PARAM_PROTO): New macro.
3188 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
3189 (INTERNAL (strtol), strtol): Define with a prototype.
3190 (PARAMS): Remove. All uses removed.
3191 * tempname.c: Include <string.h> unconditionally.
3192 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
3193 * xgethostname.c (main): Define with a prototype.
3194 * xmalloc.c: Include "xalloc.h" first, to check interface.
3195 Include <stdlib.h> unconditionally.
3196 (calloc, malloc, realloc, free): Remove decls.
3197 * xstrtod.c: Include "xstrtod.h" first, to check interface.
3198 Include <stdlib.h> unconditionally. Sort include file names.
3200 (xstrtod): Define with a prototype.
3201 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
3202 (strtol, strtoul): Remove decls.
3204 2003-09-11 Paul Eggert <eggert@twinsun.com>
3206 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
3207 Include <stdlib.h>, <string.h> unconditionally.
3208 Remove now-unnecessary cast to char *.
3209 * strnlen.c: Include <string.h> unconditionally.
3210 * yesno.c (yesno): Define with a prototype.
3212 2003-09-10 Bruno Haible <bruno@clisp.org>
3214 * strcspn.c: Include <string.h> unconditionally.
3215 * strpbrk.c: Include <string.h> unconditionally.
3216 * strstr.c: Include <string.h> unconditionally.
3217 * unicodeio.c: Include <string.h> unconditionally.
3218 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
3219 * unsetenv.c: Likewise.
3220 * xreadlink.c: Include <stdlib.h> unconditionally.
3221 * yesno.c: Include <stdlib.h> unconditionally.
3222 (rpmatch): Add prototype.
3224 2003-09-10 Jim Meyering <jim@meyering.net>
3226 * error.c: Correct indentation of cpp directives.
3228 2003-09-09 Paul Eggert <eggert@twinsun.com>
3232 * acosl.c (main): Use a prototype.
3233 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
3236 * getloadavg.c (getloadavg, main): Define via prototypes.
3238 * getopt.h (struct option.name): Assume C89, and use 'const'.
3239 (getopt, etopt_long, getopt_long_only, _getopt_internal)
3240 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
3242 * getopt.c (const): Remove macro.
3243 Include <string.h> unconditionally.
3244 (my_index): Remove; all uses changed to strchr.
3245 (strlen): Remove decl.
3246 (exchange): Remove forward decl; no longer needed.
3247 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
3248 Define with prototype.
3249 * getopt1.c (const): Remove macro.
3250 (getopt_long, getopt_long_only, main): Define with prototype.
3252 * getugroups.c: Include <string.h> unconditionally.
3254 * getusershell.c: Include <stdlib.h> unconditionally.
3255 (getusershell, setusershell, endusershell, readname, main):
3256 Define with prototypes.
3258 * group-member.c: Include group-member.h first.
3259 Include <stdlib.h> unconditionally.
3261 * hard-locale.c: Include hard-locale.h first.
3262 Include <stdlib.h>, <string.h> unconditionally.
3264 * hash.c (free, malloc): Remove decls.
3265 Include <stdlib.h> unconditionally.
3267 * human.c: Include <stdlib.h>, <string.h> unconditionally.
3268 (getenv): Do not declare.
3270 * idcache.c: Include <string.h> unconditionally.
3272 * long-options.c: Include long-options.h first, to test interface.
3273 Include <stdlib.h> unconditionally.
3275 * makepath.c: Include makepath.h first, to test interface.
3276 Include <stdlib.h> and <string.h> unconditionally.
3278 * linebuffer.c: Include <stdlib.h>.
3279 (free): Remove decl.
3281 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
3282 rpl_malloc returns void *, not char *.
3283 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
3285 * md5.h: Include <limits.h> unconditionally.
3286 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
3287 (__P): Remove; all uses removed.
3288 * md5.c: Include "md5.h" first.
3289 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
3290 md5_buffer, md5_process_bytes, md5_process_block):
3291 Define with prototypes.
3292 * sha.h (__P): Remove all uses. (It wasn't defined??)
3293 * sha.c: Include "sha.h" first.
3294 Include <stdlib.h>, <string.h> unconditionally.
3296 * memchr.c (__ptr_t): Remove; all uses changed to void *.
3297 * memcmp.c (__ptr_t): Likewise.
3298 * memrchr.c (__ptr_t): Likewise.
3299 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
3300 Include <string.h> unconditionally.
3301 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
3302 * memchr.c: Include <stdlib.h> unconditionally.
3303 * memchr.c (LONG_MAX): Remove.
3304 * memrchr.c (LONG_MAX): Likewise.
3305 * memchr.c (__memchr): Define via a prototype.
3306 * memrchr.c (__memrchr): Likewise.
3307 * memcmp.c (__P): Remove, and remove all uses.
3308 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
3309 Remove forward decls; no longer needed.
3310 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
3311 Use types required by C89 in prototype.
3313 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
3314 * savedir.c: Likewise.
3315 * mkdir.c (free): Remove decl.
3316 * rmdir.c (rmdir): Define with a prototype.
3317 * savedir.c: Include savedir.h first, to test interface.
3319 * mktime.c (STDC_HEADERS): Remove.
3320 Include <stdlib.h>, <string.h> unconditionally.
3322 * modechange.c: Include <stdlib.h> unconditionally.
3323 (malloc): Remove decl.
3325 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
3326 (free): Remove decl.
3328 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
3329 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
3330 (This type really should be intptr_t, but that's a C99ism.)
3331 (_obstack_memcpy): Remove: all uses changed to memcpy.
3332 Include <string.h> unconditionally.
3333 (struct obstack): Assume __STDC__ for types of members
3334 chunkfun, freefun, extra_arg.
3335 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
3336 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
3337 obstack_begin, obstack_specify_allocation,
3338 obstack_specify_allocation_with_arg, obstack_chunkfun,
3339 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
3340 Remove unprototyped decls and the macros that use them.
3341 * obstack.c (POINTER): Remove. All uses changed to void *.
3342 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
3343 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
3344 (defined __STDC__ && __STDC__)]:
3345 Remove nonprototyped code.
3346 Include <stdlib.h> unconditionally.
3347 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
3348 _obstack_allocated_p, _obstack_free, obstack_free,
3349 _obstack_memory_used, print_and_abort):
3350 Define using prototypes.
3351 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
3352 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
3353 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
3354 obstack_next_free, obstack_object_size, obstack_room) [0]:
3355 Remove unused, unprototyped code.
3357 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
3359 * physmem.c (physmem_total, physmem_available, main): Define
3362 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
3363 (main): Define with a prototype.
3365 * posixver.c (getenv): Remove decl.
3367 * putenv.c (malloc): Returns void *, not char *.
3368 Include <string.h> unconditionally.
3369 (strchr, memcpy, NULL): Do not define.
3371 * readtokens.c: Include readtokens.h first, to test interface.
3372 Include <stdlib.h>, <string.h> unconditionally.
3373 (init_tokenbuffer): Define with a prototype.
3375 * regex.c (PARAMS): Remove. All uses removed.
3376 All uses of _RE_ARGS removed, too.
3377 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3379 (bzero): Assume memset exists.
3380 (memcmp, memcpy, NULL): Remove.
3381 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
3382 char, or assignments to local vars of type signed char.
3383 (init_syntax_once, PREFIX(extract_number_and_incr),
3384 PREFIX(print_partial_compiled_pattern),
3385 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
3386 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
3387 PREFIX(regex_grow_registers), PREFIX(regex_compile),
3388 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
3389 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
3390 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
3391 wcs_compile_range, byte_compile_range, truncate_wchar,
3392 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
3393 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
3394 count_mbs_length, wcs_re_match_2_internal,
3395 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3396 PREFIX(alt_match_null_string_p),
3397 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3398 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3399 regfree, PREFIX(extract_number)): Define with prototype. Remove
3400 now-unnecessary declaration, if any.
3401 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3403 Remove now-unnecessary casts among pointer types.
3404 * regex.h (_RE_ARGS): Remove. All uses removed.
3406 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3407 (free): Remove decl.
3409 * rpmatch.c: Include <stdlib.h> unconditionally.
3411 * same.c: Include <stdlib.h>, <string.h> unconditionally.
3412 (free): Remove decl.
3414 * save-cwd.c: Include <stdlib.h> unconditionally.
3415 * xgetcwd.c: Likewise.
3417 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3418 (free): Remove decl.
3420 * strchrnul.c (strchrnul): Define with a prototype.
3421 Fix bug: c_in was not converted to char before searching.
3423 The following changes are not K&R related:
3425 * group-member.h: Include <sys/types.h>, so that this file is
3427 * makepath.h: Likewise.
3429 * getusershell.c (readname, default_index, line_size, readname):
3430 Use size_t, not int, for sizes.
3431 (readname): If the size overflows, report an error instead of
3434 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3436 * getndelim2.c: Assume stdlib.h per the C89 spec.
3438 2003-09-08 Paul Eggert <eggert@twinsun.com>
3440 Assume C89 or better; remove K&R cruft.
3441 A few of these changes were first proposed by Derek Robert Price
3442 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3444 * addext.c: Include <string.h> unconditionally.
3445 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3446 Don't declare getenv or malloc.
3448 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3449 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3451 (find_stack_direction, alloca): Use prototypes.
3453 * atexit.c (atexit): Define using a prototype.
3455 * basename.c, dirname.c, stripslash.c:
3456 Include <string.h> unconditionally.
3458 * bcopy.c: Include <stddef.h>.
3459 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3461 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3463 * error.h (error, error_at_line, error_print_progname)
3464 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3465 * error.c: Include error.h first, to check interface.
3466 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3467 (VA_START): Remove; all uses changeed to va_start.
3468 (exit, strerror): Remove decls.
3469 (error_print_progname): Prototype uncondionally.
3470 Don't include <errno.h>; no longer needed.
3471 (private_strerror): Remove.
3472 (error_tail): Always define.
3473 (error, error_at_line): Assume C89 or better; always use prototypes.
3474 * fatal.c: Include "fatal.h" first, to test interface.
3475 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3476 (VA_START): Remove; all uses changed to va_start.
3477 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3479 (exit): Remove decl.
3480 (fatal): Prototype unconditionally. Assume va_start works.
3481 Abort at end, to pacify gcc.
3483 * euidaccess.c (main): Define with a prototype.
3485 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3487 * exitfail.c: Include <stdlib.h> unconditionally.
3489 * fnmatch_.h (__P): Remove. All uses changed to assume
3491 * fnmatch.c: Include fnmatch.h first, to test interface.
3492 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3493 (getenv): Remove decl.
3494 (fnmatch): Define using a prototype.
3495 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3496 (FCT): Define using a prototype.
3498 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3500 * gethostname.c: Include <stddef.h>.
3501 (gethostname): Define with prototype. Length is size_t, not int.
3503 2003-09-08 Paul Eggert <eggert@twinsun.com>
3505 * getversion.c: Remove; was migrated to backupfile.c in 1997.
3506 getversion.c should have been removed then, but was accidentally
3509 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3510 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3512 2003-09-07 Paul Eggert <eggert@twinsun.com>
3514 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3515 copy_tm_result. Bug reported by Simon Josefsson in
3516 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3518 2003-09-06 Paul Eggert <eggert@twinsun.com>
3520 * time_r.c, time_r.h: New files.
3522 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3524 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3525 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3527 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3529 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3530 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3533 * timegm.c: Switch to glibc implementation, with the following changes:
3534 [defined HAVE_CONFIG_H]: Include <config.h>.
3535 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3536 (__mktime_internal) [!defined _LIBC]: New decl.
3537 (__gmtime_r) [!defined _LIBC]: New macro and function.
3538 (timegm): Use a prototype, since gnulib assumes C89.
3539 Do not bother declaring tmp to be const, as it's not really usefu.
3540 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3541 (timegm): Declare only if HAVE_DECL_TIMEGM.
3543 2003-09-03 Paul Eggert <eggert@twinsun.com>
3545 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3546 Bug reported by Lute Kamstra in
3547 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3549 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3550 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3551 course with correspondingly smaller numbers for tomorrow and
3552 yesterday. From Tadayoshi Funaba. Originally installed into
3553 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3556 2003-08-31 Simon Josefsson <jas@extundo.com>
3558 * timegm.h: New file.
3559 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3561 2003-08-31 Karl Berry <karl@gnu.org>
3563 * argp.h: update from libc.
3565 2003-08-28 Bruno Haible <bruno@clisp.org>
3567 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3568 warning on QNX, which defines O_BINARY to 000000.
3570 2003-08-24 Bruno Haible <bruno@clisp.org>
3572 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3573 MSVC7 <stdio.h> is included later.
3575 2003-08-20 Bruno Haible <bruno@clisp.org>
3577 * progname.h: New file, from GNU gettext.
3578 * progname.c: New file, from GNU gettext.
3579 * progreloc.c: New file, from GNU gettext.
3581 2003-08-19 Bruno Haible <bruno@clisp.org>
3583 * xstrdup.c: Assume <string.h> exists.
3585 2003-08-18 Jim Meyering <jim@meyering.net>
3587 * setenv.h: Indent nested cpp directive.
3588 * vasnprintf.c: Remove trailing blanks.
3590 2003-08-17 Simon Josefsson <jas@extundo.com>
3591 Bruno Haible <bruno@clisp.org>
3593 * xstrndup.h: New file.
3594 * xstrndup.c: New file.
3596 2003-08-17 Bruno Haible <bruno@clisp.org>
3598 * strndup.h: New file.
3600 2003-08-16 Paul Eggert <eggert@twinsun.com>
3602 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3603 space, undoing this 2003-08-12 change:
3604 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3606 2003-08-16 Jim Meyering <jim@meyering.net>
3608 Merge from coreutils.
3609 * xstrtoimax.c: #else #if -> #elif.
3610 * xstrtoumax.c: Likewise.
3612 2003-08-15 Paul Eggert <eggert@twinsun.com>
3614 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3615 rather than tab, after '#' in shell-script copyright notices.
3616 Suggested by Bruno Haible.
3618 2003-08-15 Jim Meyering <jim@meyering.net>
3619 and Paul Eggert <eggert@twinsun.com>
3621 Merge from coreutils.
3622 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3623 member but strut utmpx does not. Needed for AIX 4.3.3.
3624 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3626 2003-08-15 Jim Meyering <jim@meyering.net>
3628 Merge from coreutils.
3629 * xgethostname.c: Include <stdlib.h>.
3630 (xghostname): Don't exit for anything other than memory-related
3631 failure; just return NULL.
3632 * userspec.c: Include "posixver.h".
3633 (parse_user_spec): Accept `.' as a separator only
3634 in pre-POSIX-200112 mode.
3635 * strtoimax.c: Use #elif rather than #else #if.
3636 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3637 Remove function, now that we can rely on a working tzset function.
3638 [!_LIBC]: Ensure that the required autoconf test has been run.
3639 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3640 Use underlying_strftime for %r.
3641 * sha.c: Merge in some clean-up and optimization changes from glibc.
3642 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3643 Ensure that it is a multiple of 64.
3644 Rearrange loop exit tests so as to avoid performing an
3645 additional fread after encountering an error or EOF.
3646 * realloc.c: Update copyright date.
3648 2003-08-14 Jim Meyering <jim@meyering.net>
3650 Merge from coreutils.
3651 * obstack.h: Whitespace changes.
3652 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3653 and xcalloc return values.
3654 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3655 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3656 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3657 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3658 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3660 Use mntctl's return value to drive the entry-processing loop, since
3661 we can't rely on the value of the vmt_length member in the last
3662 entry. On some systems doing so could result in exhausting
3663 virtual memory. Based in part on a patch from Mike Jetzer.
3665 2003-08-14 Jim Meyering <jim@meyering.net>
3666 and Paul Eggert <eggert@twinsun.com>
3668 Merges from coreutils, plus other fixes.
3669 * physmem.c: Merge in portability changes from gcc/libiberty
3670 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3671 for credits and details. Thanks to Kaveh Ghazi for helping
3672 to keep these files in sync.
3673 (ARRAY_SIZE): Define it.
3674 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3675 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3676 (memcasecmp): Don't assume size_t fits in unsigned int.
3677 Remove casts and duplicate code.
3678 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3679 (memcpy): Remove definition.
3680 Merge in some clean-up and optimization changes from glibc.
3681 [BLOCKSIZE]: Move definition to top of file.
3682 Ensure that it is a multiple of 64.
3683 Rearrange loop exit tests so as to avoid performing an
3684 additional fread after encountering an error or EOF.
3685 * md5.h (md5_uintptr): Define.
3686 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3687 return to the initial working directory. Preserve errno
3689 * idcache.c: Include "xalloc.h".
3690 (xmalloc, xrealloc): Remove decls.
3691 (getuser): Remove casts no longer required in C89.
3692 * human.c: Include stdio.h, for sprintf.
3693 * group-member.c: Include "xalloc.h".
3694 (xmalloc, xrealloc): Remove decls.
3695 (get_group_info): Remove casts no longer required in C89.
3696 * getusershell.c (readname): Remove casts no longer required in C89.
3697 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3698 * getline.c: Whitespace fix, from coreutils.
3700 2003-08-13 Paul Eggert <eggert@twinsun.com>
3702 * exclude.c: Include <ctype.h>
3703 (IN_CTYPE_DOMAIN): New macro.
3705 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3708 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3709 Undo previous (whitespace-only) change.
3711 2003-08-12 Paul Eggert <eggert@twinsun.com>
3713 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3714 Normalize leading white space and remove trailing white space.
3715 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3716 notice, as per ../config/srclist-update.
3718 Merge from coreutils.
3719 * euidaccess.h: New file.
3720 * euidaccess.c: Include it.
3721 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3722 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3723 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3725 2003-08-11 Bruno Haible <bruno@clisp.org>
3727 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3728 (vasnprintf): Use it instead of wcslen.
3730 2003-08-11 Bruno Haible <bruno@clisp.org>
3732 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3733 value to ensure that _Bool promotes to int. Use #define for _Bool when
3734 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3736 2003-08-10 Karl Berry <karl@gnu.org>
3738 * regex.h: update from libc (whitespace fix).
3740 2003-08-09 Paul Eggert <eggert@twinsun.com>
3742 Merge some files from coreutils. These changes were
3743 originally made by Jim Meyering.
3744 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3745 many older Unixes require this.
3746 * alloca.c (alloca): Remove cast to argument of free;
3747 no longer needed in C89.
3748 * alloca_.h, regex.h: Fix white space to match
3749 what GNU indent does.
3751 2003-08-05 Paul Eggert <eggert@twinsun.com>
3753 * bumpalloc.h: Remove.
3755 2003-08-04 Paul Eggert <eggert@twinsun.com>
3757 * getloadavg.c: Change copyright notice and spacing to conform to
3760 Merge from coreutils.
3761 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3763 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3764 from Karl Berry, implemented by Jim Meyering.
3765 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3766 from Dmitry V. Levin.
3767 Remove anachronistic cast of xrealloc.
3768 * fnmatch_.h (__const): Remove. Use 'const'.
3769 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3770 type. Otherwise, it wouldn't compile with at least /bin/cc on
3771 ymp-cray-unicos9.0.2.X.
3772 Combine two mostly-identical uses of alloca into one.
3773 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3775 2003-08-04 Dave Love <d.love@dl.ac.uk>
3779 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3780 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3781 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3782 obsolete NLIST_NAME_UNION.
3783 [__GNU__]: Undef BSD and FSCALE.
3784 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3786 2003-08-03 Paul Eggert <eggert@twinsun.com>
3788 * stdbool_.h (_Bool): Make it signed char, instead of
3789 an enum type, so that it's guaranteed to promote to int. See:
3790 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3792 2003-07-31 Paul Eggert <eggert@twinsun.com>
3794 * strerror.c: Include config.h, limits.h. Declare sprintf.
3795 (strerror): Don't assume that a printable int fits in 14 bytes.
3797 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3798 Bruno Haible <bruno@clisp.org>
3800 * getline.h (getline, getdelim): Change return type to ssize_t.
3801 * getline.c (getline, getdelim): Likewise.
3802 Remove _GNU_SOURCE define; now it's defined in config.h through
3805 2003-07-22 Paul Eggert <eggert@twinsun.com>
3807 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3808 over-parenthesization in macros.
3810 Sync with coreutils.
3812 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3815 Use `exit_failure' for xalloc and xmemcoll instead of their own
3816 private exit-failure variables.
3817 * xalloc.h (xalloc_exit_failure): Remove.
3818 * xmalloc.c: Likewise. Include exitfail.h.
3819 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3820 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3821 * xmemcoll.c: Likewise. Include exitfail.h.
3822 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3824 2003-07-18 Paul Eggert <eggert@twinsun.com>
3826 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3827 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3828 to test that it can stand by itself. Include "exitfail.h".
3829 Clients should set exit_failure instead.
3830 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3832 2003-07-18 Andreas Schwab <schwab@suse.de>
3834 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3836 2003-07-18 Bruno Haible <bruno@clisp.org>
3838 * getndelim2.h: New file.
3839 * getndelim2.c: Make into a module of its own. Include config.h,
3841 (getndelim2): Make non-static. Change return type to ssize_t.
3842 * getline.h: Change argument names.
3843 * getline.c: Include getndelim2.h instead of getndelim2.c.
3844 * getnline.c: Include getndelim2.h.
3846 2003-07-17 Bruno Haible <bruno@clisp.org>
3848 * Makefile.am: Remove file.
3849 * Makefile.in: Remove file.
3851 2003-07-17 Bruno Haible <bruno@clisp.org>
3853 * getnline.h: New file.
3854 * getnline.c: New file.
3855 * getndelim2.c: New file, extracted from getline.c.
3856 (getndelim2): Renamed from getdelim2, with added nmax argument.
3857 * getline.c: Include getndelim2.c.
3858 (getdelim2): Moved out to getndelim2.c.
3859 (getline, getdelim): Update.
3861 2003-07-15 <karl@gnu.org>
3863 * vasnprintf.c: update from gettext.
3865 2003-07-15 Jim Meyering <jim@meyering.net>
3867 * makepath.c (make_path): Enclose diagnostic in _(...).
3869 2003-07-14 Paul Eggert <eggert@twinsun.com>
3871 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3872 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3873 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3874 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3875 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3876 updated automatically by ../config/srclist-update. This changes
3877 their license from LPGL to GPL.
3879 2003-07-14 Jim Meyering <jim@meyering.net>
3881 Don't emit diagnostics. Let callers do that.
3882 * save-cwd.c: Don't include "error.h".
3883 (save_cwd): Don't call error. Ensure that errno is valid
3884 when returning nonzero.
3886 * save-cwd.h (restore_cwd): Update prototype.
3887 * save-cwd.c (restore_cwd): Remove two parameters.
3888 Simplify. Don't call error upon failure. Let callers do that.
3889 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3890 when auditing is enabled. But don't bother updating the #if.
3892 2003-07-14 Simon Josefsson <jas@extundo.com>
3894 * mempcpy.h: New file.
3895 * mempcpy.c: New file.
3897 2003-07-14 Paul Eggert <eggert@twinsun.com>
3899 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3900 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3901 unicodeio.c, unicodeio.h, unlocked-io.h:
3902 Switch from LGPL to GPL.
3904 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3906 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3907 it breaks C++ compilation.
3908 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3910 2003-07-10 Jim Meyering <jim@meyering.net>
3912 * vasnprintf.c: Remove trailing blanks.
3913 Make cpp indentation consistent.
3915 2003-07-09 Paul Eggert <eggert@twinsun.com>
3917 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3918 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3919 Switch from LGPL to GPL.
3921 2003-07-07 Paul Eggert <eggert@twinsun.com>
3923 * mktime.c: Fix some boundary cases and remove need for floating point.
3925 Issue a compile-time diagnostic if time_t is floating point, or if
3926 two's complement arithmetic is not in effect, or if arithmetic
3927 right shift does not propagate the sign. These assumptions were
3928 all in the original code but they weren't checked.
3930 (TIME_T_MIDPOINT, verify): New macros.
3931 (__isleap): Remove; it has integer overflow problems.
3932 (leapyear): New function, without those problems.
3933 (ydhms_tm_diff): Remove; splitting into two parts.
3934 (ydhms_diff): New function, containing the arithmetic part of
3935 the old ydhms_tm_diff function. Issue a compile-time
3936 diagnostic if we are not using C99 integer division.
3937 Avoid casts when possible.
3938 (guess_time_tm): New function, containing the checking part of
3939 the old ydhms_tm_diff function. Return the new value, rather than
3940 the difference between it and the old. Accept a new argument T
3941 so that *T specifies the old value. Check for overflow in the result.
3943 (__mktime_internal): Use a time_t offset, not a long int offset.
3944 This undoes the 2003-06-04 change, which is no longer needed now
3945 that we have better overflow checking.
3946 (localtime_offset): Likewise.
3948 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3949 and long are 64-bit but int is only 32-bit.
3950 (ydhms_diff): Use long int to store year1 and yday1.
3951 Issue a compile-time diagnostic if long int is not wide enough.
3953 (__mktime_internal): Use long int to store adjusted year and yday.
3954 Use plain C rather than preprocessor commands, if that doesn't
3956 Check for overflow (and try to repair) after each probe
3957 rather than checking only at the very end. This avoids some bugs
3958 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3959 does not equal GMT offset at maximum time).
3960 Use integer to check for overflow rather than floating point; this
3961 is more portable to non-IEEE hosts, and is a tad faster.
3962 When we detect that we are oscillating between two values,
3963 don't check whether tm_isdst has the requested value, since
3964 we already know the answer. When tm_isdst has the wrong value,
3965 use a different heuristic to find the right one, based on the
3966 extreme values actually observed in practice in tz2003a,
3967 rather than the (overly optimistic) "previous 3 calendar quarters".
3969 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3970 "T const" to accommodate glibc style.
3971 (check_result): Use less-confusing report format. "long" -> "long int.
3973 Don't loop if the iteration overflows time_t.
3974 Allow a negative step in the iteration.
3976 2003-07-01 Paul Eggert <eggert@twinsun.com>
3978 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3979 having it depend on HAVE_SYS_TYPES_H.
3981 2003-06-25 Bruno Haible <bruno@clisp.org>
3983 * readlink.c: New file.
3985 2003-06-20 Bruno Haible <bruno@clisp.org>
3987 Assume C89, so PARAMS isn't needed.
3988 * unicodeio.h (PARAMS): Remove.
3989 * unicodeio.c: Don't use PARAMS.
3991 2003-06-18 Jim Meyering <jim@meyering.net>
3993 Merge changes from coreutils.
3994 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3995 Remove explicit declarations of xmalloc and realloc.
3997 (read_utmp): Remove anachronistic cast of xmalloc.
3999 2003-06-17 Paul Eggert <eggert@twinsun.com>
4001 Assume C89, so PARAMS isn't needed.
4002 * backupfile.h (PARAMS): Remove. All uses removed.
4003 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
4004 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
4005 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
4006 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
4007 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
4008 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
4009 xstrtol.h: Likewise.
4010 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
4011 same.h, strverscmp.h: Do not include config.h; no longer needed.
4012 Anyway, config.h should always be included before any other file.
4014 2003-06-11 Simon Josefsson <jas@extundo.com>
4016 * sysexit_.h: New file.
4018 2003-05-20 Derek Price <derek@ximbiot.com>
4020 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
4022 2003-06-10 Simon Josefsson <jas@extundo.com>
4024 * strchrnul.h: New file.
4025 * strchrnul.c: New file.
4027 2003-06-10 Simon Josefsson <jas@extundo.com>
4029 * argp.h: New file, from glibc.
4030 * argp-ba.c: New file, from glibc.
4031 * argp-eexst.c: New file, from glibc.
4032 * argp-fmtstream.c: New file, from glibc.
4033 * argp-fmtstream.h: New file, from glibc.
4034 * argp-fs-xinl.c: New file, from glibc.
4035 * argp-help.c: New file, from glibc.
4036 * argp-namefrob.h: New file, from glibc.
4037 * argp-parse.c: New file, from glibc.
4038 * argp-pv.c: New file, from glibc.
4039 * argp-pvh.c: New file, from glibc.
4040 * argp-xinl.c: New file, from glibc.
4042 2003-06-07 Jim Meyering <jim@meyering.net>
4044 * readtokens.h: Put `Free Software Foundation, Inc.'
4045 in place of my name in the copyright comment.
4046 Remove definition and uses of __P.
4049 * stat.c: Don't declare xmalloc explicitly.
4050 Instead, include "xalloc.h".
4051 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
4052 xrealloc, and xcalloc return values.
4053 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
4055 * xgetcwd.h: Remove definition/uses of PARAMS.
4057 2003-06-06 Jim Meyering <jim@meyering.net>
4059 * stdbool_.h: Renamed from stdbool.h.in.
4061 2003-06-06 Jim Meyering <jim@meyering.net>
4063 Merge from coreutils.
4064 * same.c: (same_name): Declare *_basename locals to be `const'.
4065 Consolidate declarations and initializations of *_base* locals.
4067 Merge from coreutils.
4068 This avoids a core dump on systems without GNU putenv,
4069 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
4070 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
4071 (unsetenv): New static function, from GNU libc.
4072 (rpl_putenv): Use it.
4074 * modechange.c: Remove trailing blanks.
4076 Merge from coreutils.
4077 * fsusage.c: Remove declaration of statfs.
4078 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
4080 * posixtm.c: Include <stdbool.h> unconditionally.
4082 2003-06-05 Paul Eggert <eggert@twinsun.com>
4084 * mktime.c (__mktime_internal): When resolving a tm_isdst
4085 mismatch, look in future quarters as well as past. This fixes a
4086 bug when processing fall-backwards gaps immediately after a long
4087 period of daylight-saving time.
4089 * mktime.c: Assume freestanding C89 or better.
4090 (HAVE_LIMITS_H): Remove. Assume it's 1.
4091 (__P): Remove; not used.
4092 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
4093 (mktime, not_equal_tm, print_tm, check_result,
4094 main): Use prototypes. Use const * where appropriate.
4095 (main): Fix typo in testing code that uncovered by above changes.
4096 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
4098 2003-06-04 Paul Eggert <eggert@twinsun.com>
4100 * mktime.c: Fix Debian bug 177940
4101 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
4102 (localtime_offset): Now long int, not time_t, because we want it
4103 to be guaranteed to be signed. All uses changed.
4104 (__mktime_internal): If overflow would occur when adding offset,
4107 Merge 'human' changes from coreutils. Rewrite to support
4108 locale-specific notations like thousands separators.
4109 * human.c: Simplify authorship notice.
4110 Include human.h immediately after config.h.
4111 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
4112 <limits.h>: Do not include, since human.h does.
4113 (SIZE_MAX, UINTMAX_MAX): New macros.
4114 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
4115 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
4116 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
4117 (power_letter): Renamed from suffixes.
4118 (generate_suffix_backwards): Remove.
4119 (adjust_value): Now takes int style (because of human.h changes)
4120 and long double value (for greater precision on some platforms).
4121 (group_number): New function.
4122 (human_readable): Use it. Use integer options, not enum.
4123 Put the options before the sizes in the arg list.
4124 Support all the new options.
4125 The old human_readable function has been removed;
4126 use inttostr.h instead.
4127 (human_readable, default_block_size, humblock):
4128 Use uintmax_t, not int, for block sizes.
4129 (human_readable_inexact, block_size_types): Remove.
4130 (block_size_opts): New constant.
4131 (human_options): Renamed from human_block_size, with new signature
4132 that allows block sizes up to UINTMAX_MAX. All callers changed.
4133 * human.h: Add copyright and authorship notice.
4134 Include <limits.h> and <stdbool.h> unconditionally.
4135 (PARAMS): Remove. All uses removed.
4136 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
4137 (enum human_inexact_style): Remove tag; now a nameless enum.
4138 (human_floor, human_ceiling, human_round_to_even): Now have
4139 values 2, 0, 1 rather than -1, 1, 0.
4140 (human_group_digits, human_suppress_point_zero, human_autoscale,
4141 human_base_1024, human_SI, human_B): New constants.
4142 (human_readable_inexact, human_block_size): Remove.
4143 (human_readable): Size args are now uintmax_t, not int.
4144 (human_options): New decl.
4146 * exclude.c: (new_exclude, add_exclude): Remove casts that are
4147 unnecessary now that we assume C89 or better. This change
4148 imported from coreutils.
4150 * mktime.c (__mktime_internal): Do not reject negative timestamps
4151 arbitrarily. This is the same patch as 2003-05-28, but it got lost
4152 in the 2003-05-30 sync from glibc.
4154 .h files should stand alone, but we shouldn't include <sys/types.h>
4155 if we can get away with just <stddef.h>.
4157 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
4158 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
4159 rather than <sys/types.h>, as we merely need size_t.
4160 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
4162 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
4163 Include <stdio.h>, to get FILE.
4164 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
4165 memcasecmp.h has included <stddef.h> and all we need is size_t.
4166 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
4167 our interface, instead of including <sys/types.h>
4169 2003-06-02 Paul Eggert <eggert@twinsun.com>
4172 Fix some minor time-related bugs with POSIX time arguments.
4173 Some valid time stamps were being rejected (notably -1, and
4174 time stamps before 1900 on 64-bit hosts). And some invalid
4175 time stamps were being accepted, e.g. September 31.
4177 * posixtm.h (posixtime): Return bool instead of time_t, so
4178 that we can return (time_t) -1 successfully.
4179 * posixtm.c: Likewise.
4180 [HAVE_STDBOOL_H]: Include <stdbool.h>.
4181 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
4182 (t): Remove static var.
4183 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
4184 of static var. All uses changed.
4185 (year): Do not reject years before 1900; they can occur with
4187 (posix_time_parse): Do not check for out-of-range components;
4188 that is now the caller's responsibility, since our checks were
4189 only approximations.
4190 (posixtime): Use mktime to check for out-of-range components,
4191 since it knows them exactly.
4192 If mktime returns (time_t) -1, check whether an error actually occurred
4193 by invoking localtime on -1.
4194 (main) [TEST_POSIXTIME]: Check for input data errors, and report
4195 posixtime failures better.
4196 Improve the test data (in comments only).
4198 2003-05-30 <karl@gnu.org>
4200 * mktime.c: update from libc.
4202 2003-05-30 Bruno Haible <bruno@clisp.org>
4204 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
4205 * localcharset.h: Likewise.
4206 * localcharset.c: Likewise.
4208 2003-05-28 Paul Eggert <eggert@twinsun.com>
4210 Assume the headers required for C89 freestanding compilers.
4211 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
4212 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
4213 without checking for HAVE_LIMITS_H.
4214 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
4215 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
4217 * fatal.c: Include <stdarg.h> without checking for __STDC__.
4218 * exclude.c: Include <stdbool.h> unconditionally.
4219 * tempname.c: Include <stddef.h> unconditionally.
4220 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
4221 * modechange.c, rpmatch.c (NULL): Don't define, since
4222 <stddef.h> does that.
4223 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
4224 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
4225 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
4226 * xstrtol.c: Likewise.
4227 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
4228 * savedir.c: Include <stddef.h> instead of defining NULL.
4230 * addext.c (addext): Use assignment rather than cast, to avoid
4231 warnings on some platforms.
4233 * mktime.c (__mktime_internal): Do not reject negative timestamps
4236 2003-05-10 Bruno Haible <bruno@clisp.org>
4238 * linebreak.c (iconv_string_length): Don't return -1 just because the
4239 string is longer than 4 KB.
4241 2003-05-12 Jim Meyering <jim@meyering.net>
4243 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
4244 the space-padded-by-default conversion specifiers, %e, %k, %l.
4246 2003-05-03 Bruno Haible <bruno@clisp.org>
4248 Upgrade to Unicode-4.0.
4249 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
4250 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
4251 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
4252 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
4253 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
4254 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
4255 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
4256 Change width of U+E0100..U+E01EF from 1 to 0.
4258 2003-04-25 Bruno Haible <bruno@clisp.org>
4260 * copy-file.c: Include <stddef.h>, for size_t.
4262 2003-04-25 Jim Meyering <jim@meyering.net>
4264 * copy-file.c (copy_file_preserving): Declare buf_size to be
4265 of type size_t, not int.
4267 2003-04-11 Jim Meyering <jim@meyering.net>
4269 Merge changes from Coreutils.
4271 2003-03-22 Jim Meyering <jim@meyering.net>
4273 * strftime.c (widen): Cast alloca return value to proper type.
4275 2003-01-19 Ulrich Drepper <drepper@redhat.com>
4278 * strftime.c (my_strftime): Handle very large width
4279 specifications for numeric values correctly. Improve checks for
4282 2003-01-19 Jim Meyering <jim@meyering.net>
4284 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
4285 (nl_get_alt_digit) [! defined my_strftime]: Define.
4286 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
4287 _nl_get_alt_digit and _nl_get_walt_digit.
4289 * strftime.c (my_strftime): Merge in locale-related changes from libc.
4290 These changes have no effect outside of _LIBC.
4292 2003-04-10 Bruno Haible <bruno@clisp.org>
4294 * findprog.h: New file, from GNU gettext.
4295 * findprog.c: New file, from GNU gettext.
4297 2003-04-05 Jim Meyering <jim@meyering.net>
4299 Merge changes from Coreutils.
4301 * exclude.h (PARAMS): Remove definition and uses.
4302 * exclude.c: Remove uses of `PARAMS'.
4304 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
4305 Add test-cases for DOS filenames. Declare program_name.
4306 (main): Set up program_name. Patch by Rich Dawe.
4308 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4310 Use mntctl's return value to drive the entry-processing loop, since
4311 we can't rely on the value of the vmt_length member in the last
4312 entry. On some systems doing so could result in exhausting
4313 virtual memory. Based in part on a patch from Mike Jetzer.
4315 2003-04-04 Bruno Haible <bruno@clisp.org>
4317 * linebreak.h: New file, from GNU gettext.
4318 * linebreak.c: New file, from GNU gettext with slight modifications.
4319 * lbrkprop.h: New file, from GNU gettext.
4321 2003-04-03 Bruno Haible <bruno@clisp.org>
4323 * utf8-ucs4.h: New file, from GNU gettext.
4324 * utf16-ucs4.h: New file, from GNU gettext.
4325 * ucs4-utf8.h: New file, from GNU gettext.
4326 * ucs4-utf16.h: New file, from GNU gettext.
4328 2003-04-02 Bruno Haible <bruno@clisp.org>
4330 * binary-io.h: New file, from GNU gettext.
4332 2003-04-01 Bruno Haible <bruno@clisp.org>
4334 * pathname.h: New file, from GNU gettext.
4335 * concatpath.c: New file, from GNU gettext.
4337 2003-03-30 Bruno Haible <bruno@clisp.org>
4339 * copy-file.c (copy_file_preserving): Don't set owner if the function
4340 chown() doesn't exist.
4342 2003-03-28 Bruno Haible <bruno@clisp.org>
4344 * copy-file.h: New file, from GNU gettext.
4345 * copy-file.c: New file, from GNU gettext.
4347 2003-03-18 Jim Meyering <jim@meyering.net>
4349 * quote.c (quote_n): Fix typo in comment.
4351 2003-03-14 Jim Meyering <jim@meyering.net>
4353 Merge changes from Coreutils.
4354 * obstack.h (obstack_object_size): Declare temporary, __o,
4355 to be const, in order to avoid warnings.
4356 (obstack_room): Likewise.
4357 (obstack_empty_p): Likewise.
4359 2003-03-13 Paul Eggert <eggert@twinsun.com>
4361 Merge changes from Bison.
4362 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
4363 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4364 when compiling Bison 1.875's `bitset bset = obstack_alloc
4365 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4366 * hash.c: Include <stdbool.h> unconditionally.
4368 2003-03-09 Paul Eggert <eggert@twinsun.com>
4370 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
4371 Reported by Bruce Becker; see:
4372 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
4374 2003-03-03 Paul Eggert <eggert@twinsun.com>
4375 Bruno Haible <bruno@clisp.org>
4377 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
4378 Reported by John Hughes, see
4379 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
4381 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
4383 * poll_.h: New file.
4386 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
4388 * mathl.h: New file.
4389 * acosl.c: New file.
4390 * asinl.c: New file.
4391 * atanl.c: New file.
4392 * ceill.c: New file.
4395 * floorl.c: New file.
4396 * frexpl.c: New file.
4397 * ldexpl.c: New file.
4399 * sincosl.c: New file.
4401 * sqrtl.c: New file.
4403 * trigl.c: New file.
4404 * trigl.h: New file.
4406 2003-02-17 Bruno Haible <bruno@clisp.org>
4408 * mkdtemp.h: New file, from GNU gettext.
4409 * mkdtemp.c: New file, from GNU gettext.
4411 2003-01-31 Bruno Haible <bruno@clisp.org>
4413 * rename.c: #undef rename before defining rpl_rename.
4414 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4416 2003-01-30 Bruno Haible <bruno@clisp.org>
4418 * printf-args.h: New file, from GNU gettext.
4419 * printf-args.c: New file, from GNU gettext.
4420 * printf-parse.h: New file, from GNU gettext.
4421 * printf-parse.c: New file, from GNU gettext.
4422 * vasnprintf.h: New file, from GNU gettext.
4423 * vasnprintf.c: New file, from GNU gettext.
4424 * asnprintf.c: New file, from GNU gettext.
4425 * vasprintf.h: New file, from GNU gettext with modifications.
4426 * vasprintf.c: New file, from GNU gettext.
4427 * asprintf.c: New file, from GNU gettext.
4429 2003-01-29 Bruno Haible <bruno@clisp.org>
4431 * stpncpy.h: New file, from GNU gettext with modifications.
4432 * stpncpy.c: New file, from GNU gettext with modifications.
4434 2003-01-28 Bruno Haible <bruno@clisp.org>
4436 * c-ctype.h: New file, from GNU gettext, with changes suggested by
4438 * c-ctype.c: New file, from GNU gettext, with changes suggested by
4441 2003-01-27 Bruno Haible <bruno@clisp.org>
4443 * xsetenv.h: New file, from GNU gettext.
4444 * xsetenv.c: New file, from GNU gettext.
4446 2003-01-23 Bruno Haible <bruno@clisp.org>
4448 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4450 2003-01-22 Bruno Haible <bruno@clisp.org>
4452 * exit.h: New file, from GNU gettext.
4454 2003-01-11 Bruno Haible <bruno@clisp.org>
4456 * stpcpy.h (stpcpy): Use ANSI C function declarations.
4457 * strcase.h (strcasecmp, strncasecmp): Likewise.
4459 2003-01-14 Jim Meyering <jim@meyering.net>
4461 * same.c (same_name): Tweak a comment.
4463 2003-01-11 Bruno Haible <bruno@clisp.org>
4465 * same.c (same_name): Reorder tests so as to avoid calling stat()
4466 when a string comparison is sufficient.
4468 2003-01-11 Bruno Haible <bruno@clisp.org>
4470 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4473 2003-01-11 Bruno Haible <bruno@clisp.org>
4475 * hash-pjw.c: Add comment about low quality of this function.
4477 2003-01-12 Paul Eggert <eggert@twinsun.com>
4479 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4480 to avoid collisions with libcurses and libreadline.
4482 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4483 * getstr.h, getstr.c: Remove.
4484 * getline.c: Include "getline.h", to check interface.
4485 Move body of old getstr.c here: this defines MIN_CHUNK and
4486 declares getdelim2, which is renamed from getstr.
4487 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4489 * linebuffer.c (readlinebuffer): Renamed from readline.
4491 * linebuffer.h: Likewise.
4492 (readline): Remove backward-compatibility macro.
4494 2003-01-12 Jim Meyering <jim@meyering.net>
4496 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4498 2003-01-10 Bruno Haible <bruno@clisp.org>
4500 * alloca_.h: New file.
4501 * getdate.y: Unconditionally include alloca.h.
4502 * makepath.c: Likewise.
4503 * setenv.c: Likewise.
4504 * userspec.c: Likewise.
4506 2003-01-09 Bruno Haible <bruno@clisp.org>
4508 * stdbool.h.in: New file.
4510 2003-01-08 Bruno Haible <bruno@clisp.org>
4512 * safe-read.c: Include specification header first, to ensure its
4514 * full-write.c: Likewise.
4516 2003-01-08 Jim Meyering <jim@meyering.net>
4518 * full-write.c: Undefine and define-away `const' after inclusion
4519 of errno.h, not before. Suggestion from Bruno Haible.
4521 2003-01-07 Jim Meyering <jim@meyering.net>
4523 * full-write.c: Rework so that it may serve to define full_read, too.
4524 * full-read.c: Simply #define FULL_READ and include full-write.c.
4526 2003-01-06 Jim Meyering <jim@meyering.net>
4528 * version-etc.c: Update year in translatable copyright string.
4530 2002-12-25 Bruno Haible <bruno@clisp.org>
4532 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4533 * xstrtol.h: Likewise.
4534 * xstrtoimax.c: Likewise.
4535 * xstrtoumax.c: Likewise.
4536 * human.h: Likewise.
4538 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4539 on systems that have <inttypes.h> but not <stdint.h>.
4541 2002-12-31 Paul Eggert <eggert@twinsun.com>
4543 * memcoll.c (memcoll): Fall back on a simple algorithm using
4544 memcmp if strcoll doesn't work.
4546 2002-12-23 Bruno Haible <bruno@clisp.org>
4548 * localcharset.h: New file.
4549 * localcharset.c: Include it.
4550 * unicodeio.c: Likewise.
4552 2002-12-22 Bruno Haible <bruno@clisp.org>
4554 * utime.c (utime_null): No need to call ftruncate if the file was
4557 2002-12-23 Bruno Haible <bruno@clisp.org>
4559 * memcoll.c (STRCOLL): New macro.
4562 2002-12-22 Bruno Haible <bruno@clisp.org>
4564 * getstr.h (getstr): Define, to avoid clash with libcurses.
4565 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4567 2002-12-22 Bruno Haible <bruno@clisp.org>
4569 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4571 2002-12-23 Bruno Haible <bruno@clisp.org>
4573 * getline.h: Include <stddef.h>, for size_t.
4575 * unicodeio.h: Include <stddef.h>, for size_t.
4576 * unicodeio.c: Don't include <stddef.h>.
4578 2002-12-17 Bruno Haible <bruno@clisp.org>
4580 * canon-host.c (strdup): Remove unused declaration.
4582 * fsusage.c: Include full_read.h.
4583 (get_fs_usage): Use full_read instead of safe_read.
4585 * utime.c (utime_null): Use SAFE_READ_ERROR.
4587 2002-12-11 Bruno Haible <bruno@clisp.org>
4589 * setenv.h: Rewritten to cope with systems that have setenv() but not
4591 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4594 2002-12-11 Bruno Haible <bruno@clisp.org>
4596 * setenv.c (alloca): Fall back to malloc.
4598 (setenv): Use freea() to free memory allocated with alloca().
4600 2002-11-13 Bruno Haible <bruno@clisp.org>
4602 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4603 function declarations.
4604 * unsetenv.c (unsetenv): Likewise.
4606 2002-03-04 Bruno Haible <bruno@clisp.org>
4608 Portability to AIX 4.3.3.
4609 * unsetenv.c: New file, extracted from setenv.c.
4610 * setenv.c: Move the unsetenv() function to unsetenv.c.
4612 2001-12-20 Bruno Haible <bruno@clisp.org>
4614 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4615 use malloc instead. For SunOS 4.
4617 2001-12-11 Bruno Haible <bruno@clisp.org>
4619 * setenv.c: Declare alloca.
4620 (compar_fn_t): New typedef.
4621 (KNOWN_VALUE, STORE_VALUE): Use it.
4623 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4626 2002-12-10 Paul Eggert <eggert@twinsun.com>
4628 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4629 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4630 Choose values that are less likely to collide with system fnmatch
4632 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4633 defined (e.g., a pure POSIX system).
4634 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4635 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4637 2002-12-06 Jim Meyering <jim@meyering.net>
4639 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4641 Merge in changes from libc's misc/error.c, in preparation
4642 for the merge of gnulib's changes back into libc.
4644 * error.c (_): Define only if not already defined.
4645 Move definition to follow all #include directives.
4646 Include unlocked-io.h only if !_LIBC.
4647 [_LIBC]: Include <libio/libioP.h>.
4648 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4649 (fflush): Tweak definition to use INTUSE.
4652 2002-12-05 Paul Eggert <eggert@twinsun.com>
4654 * alloca.c [defined emacs]: Include "lisp.h".
4655 (xalloc_die) [defined emacs]: New macro.
4656 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4657 [! defined emacs]: Include <xalloc.h>.
4658 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4659 (pointer): Typedef to POINTER_TYPE *.
4660 (malloc): Remove decl; we now always use xmalloc.
4661 (alloca): Use old-style definition, since Emacs needs this.
4662 Check for arithmetic overflow when computing combined size.
4664 2002-12-04 Paul Eggert <eggert@twinsun.com>
4666 Do not generate unlocked-io.h automatically, since it's easier to
4667 maintain it by hand.
4669 * unlocked-io.h: New file, from GNU diffutils,
4670 but with proper copyright notice and attribution.
4672 * Makefile.am: Add copyright notice.
4673 (libfetish_a_SOURCES): Add unlocked-io.h.
4674 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4675 (DISTCLEANFILES, io_functions): Remove macros.
4676 (EXTRA_DIST): Remove gen_uio.
4677 (unlocked-io.h): Remove rule.
4679 2002-12-04 Jim Meyering <jim@meyering.net>
4681 Reflect the fact that stat.c and lstat.c are no longer generated.
4682 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4683 (DISTCLEANFILES): Likewise.
4684 (EXTRA_DIST): Likewise.
4685 (all_local): Don't depend on stat.c or lstat.c.
4686 (stat.c, lstat.c): Remove rules.
4687 (EXTRA_DIST): Remove xstat.in.
4689 * xstat.in: Remove file. Contents moved into stat.c.
4690 * stat.c: New file. Contents mostly from xstat.in.
4691 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4692 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4694 * safe-read.c: Rework so that it may serve to define safe_write, too.
4695 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4697 2002-12-03 Jim Meyering <jim@meyering.net>
4699 * safe-read.c, safe-write.c: Change variable names and comments, but
4700 not semantics, to minimize the differences between these two files.
4701 (safe_read): Change comment to mention SAFE_READ_ERROR.
4703 * safe-read.c (IS_EINTR): Define.
4704 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4706 2002-12-02 Bruno Haible <bruno@clisp.org>
4708 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4709 Define, taken from safe-read.c.
4710 (INT_MAX): Provide fallback.
4711 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4712 * safe-write.h (SAFE_WRITE_ERROR): Define.
4714 * safe-read.c (EINTR): Remove definition.
4715 (safe_read): Don't use EINTR if it is absent.
4717 2002-12-02 Jim Meyering <jim@meyering.net>
4719 * safe-read.c (EINTR): Define.
4720 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4721 (INT_MAX): Provide fallback.
4722 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4724 * safe-read.h (SAFE_READ_ERROR): Define.
4726 2002-12-01 Jim Meyering <jim@meyering.net>
4728 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4729 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4731 2002-11-27 Paul Eggert <eggert@twinsun.com>
4733 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4734 hash_rehash): Replace `if (limit <= value) abort ();' with
4735 `if (! (value < limit)) abort ();', for readability.
4737 2002-11-26 <karl@gnu.org>
4739 * strdup.c: copy from libc again, with jim's ok.
4740 * .cppi-disable: re-add strdup.c
4742 2002-11-25 <karl@gnu.org>
4744 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4745 instead of "strtol.c".
4747 2002-11-25 Jim Meyering <jim@meyering.net>
4749 * mktime.c: Sync from libc, now that it has the latest fix.
4751 2002-11-24 <karl@gnu.org>
4753 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4754 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4756 2002-11-24 Jim Meyering <jim@meyering.net>
4758 Update from coreutils:
4760 * mktime.c: Merge in changes from libc.
4762 Avoid a link-time failure on some Linux systems.
4763 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4764 (__mon_yday): Declare with the STATIC attribute.
4765 (__mktime_internal): Likewise.
4766 Based on a report from Greg Schafer.
4768 2002-11-23 Jim Meyering <jim@meyering.net>
4770 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4771 Use `unsigned', not `int', as type of index.
4773 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4775 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4777 2002-11-22 Paul Eggert <eggert@twinsun.com>
4779 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4780 hint that one should use `if (! x) abort ();' rather than `assert
4781 (x);', and anyway it's one less thing to worry about configuring.
4782 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4783 hash_rehash, hash_insert): Use abort rather than assert.
4785 2002-11-22 Paul Eggert <eggert@twinsun.com>
4787 * quotearg.h: Allow multiple inclusion by surrounding with
4788 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4789 so that we can be included first.
4790 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4791 * quotearg.c: Include quotearg.h immediately after config.h.
4792 No need to include stddef.h or sys/types.h any more.
4793 Surround local include files with "", not "<>".
4794 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4795 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4796 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4797 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4798 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4799 (ISPRINT): Remove; no longer needed now that we assume C89.
4801 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4804 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4805 quotearg_char): Use SIZE_MAX rather than
4806 (size_t) -1 when we are talking about "infinity".
4808 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4810 2002-11-22 Bruno Haible <bruno@clisp.org>
4812 * safe-read.h: Assume C89. Add comments.
4813 (safe_read): Change return type to size_t.
4814 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4815 counts > SSIZE_MAX correctly.
4816 * safe-write.h: New file.
4817 * safe-write.c: New file.
4818 * full-read.h: New file.
4819 * full-read.c: New file.
4820 * full-write.h: Assume C89. Add comments.
4821 * full-write.c: Include safe-write.h.
4822 (full_write): Rewritten to use safe_write.
4823 Suggested by Jim Meyering and Paul Eggert.
4825 2002-11-21 Bruno Haible <bruno@clisp.org>
4827 Remove case insensitive option matching.
4828 * argmatch.h (argcasematch): Remove declaration.
4829 (ARGCASEMATCH): Remove macro.
4830 (__xargmatch_internal): Remove case_sensitive argument.
4831 (XARGMATCH): Update.
4832 (XARGCASEMATCH): Remove macro.
4833 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4834 case_sensitive argument.
4835 (argcasematch): Remove function.
4836 (__xargmatch_internal): Remove case_sensitive argument.
4837 (main): Use XARGMATCH instead of XARGCASEMATCH.
4839 * xmalloc.c: Change compile-time error message. Add comment about
4840 required autoconf version.
4842 2002-11-21 Jim Meyering <jim@meyering.net>
4844 * strdup.c (strdup): Tweak comment and initial #if/#include.
4846 Merge in changes from the coreutils.
4848 2002-09-25 Paul Eggert <eggert@twinsun.com>
4849 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4850 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4851 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4852 int. Work more efficiently if X is the same width as uintmax_t.
4853 Do not compare X to -1, to avoid bogus compiler warning.
4854 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4855 Don't assume that f_frsize and f_bsize are the same type.
4857 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4860 * makepath.c (make_path): Restore umask *before* creating the final
4862 (make_path): Minor reformatting.
4864 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4865 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4867 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4868 ones. At least on GNU/Linux systems, `auto' means something else.
4871 2002-11-20 Paul Eggert <eggert@twinsun.com>
4873 Merge argmatch cleanups from Bison. Assume C89.
4875 * argmatch.c: Include config.h here, not in argmatch.h.
4876 Include stdlib.h, for EXIT_FAILURE.
4877 Always include <string.h>, since we assume C89.
4878 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4879 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4880 Include <stddef.h> instead, since it's all we need for size_t.
4881 (PARAMS): Remove. All uses removed.
4882 (ARRAY_CARDINALITY): Do not bother to #undef.
4883 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4884 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4885 Remove unnecessary parentheses.
4886 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4887 Insert necessary parentheses.
4888 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4889 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4891 2002-11-19 Bruno Haible <bruno@clisp.org>
4893 * mbswidth.c: Include mbswidth.h right at the beginning.
4894 * mbswidth.h: Include <stddef.h>, for size_t.
4896 * mbswidth.h (PARAMS): Remove macro.
4897 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4898 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4900 * gcd.h (PARAMS): Remove macro.
4901 (gcd): Use ANSI C function declarations.
4902 * gcd.c (gcd): Likewise.
4904 2002-11-15 Bruno Haible <bruno@clisp.org>
4906 * strcspn.c: Include <stddef.h>.
4907 (strcspn): Use ANSI C function declaration. Change return type to
4909 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4910 (strpbrk): Use NULL.
4911 * strpbrk.h (PARAMS): Remove macro.
4912 (strpbrk): Use ANSI C function declaration.
4913 * strstr.c: Don't include <sys/types.h>.
4914 * strstr.h (PARAMS): Remove macro.
4915 (strstr): Use ANSI C function declarations.
4917 2002-11-06 Bruno Haible <bruno@clisp.org>
4919 * gcd.h (gcd): Change argument type to 'unsigned long'.
4920 * gcd.c (gcd): Likewise.
4922 2002-11-05 Bruno Haible <bruno@clisp.org>
4924 * gcd.h: New file, from gettext-0.11.5.
4925 * gcd.c: New file, from gettext-0.11.5.
4927 2002-11-05 Bruno Haible <bruno@clisp.org>
4929 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4930 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4931 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4932 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4934 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4935 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4937 * closeout.c: Include gettext.h instead of <libintl.h>.
4938 * human.c: Include gettext.h instead of <libintl.h>.
4939 * quotearg.c: Include gettext.h instead of <libintl.h>.
4940 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4941 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4942 * userspec.c: Include gettext.h instead of <libintl.h>.
4943 * version-etc.c: Include gettext.h instead of <libintl.h>.
4944 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4945 (textdomain): Remove definition.
4946 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4948 * long-options.c: Remove include of <libintl.h> and definition of _.
4949 * same.c: Remove include of <libintl.h> and definition of _.
4951 2002-11-04 Bruno Haible <bruno@clisp.org>
4953 * stpcpy.h: New file, from GNU gettext-0.11.5.
4954 * strcase.h: New file, from GNU gettext-0.11.5.
4955 * strpbrk.h: New file, from GNU gettext-0.11.5.
4956 * strstr.h: New file, from GNU gettext-0.11.5.
4957 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4959 2002-05-09 Bruno Haible <bruno@clisp.org>
4961 * config.charset: Update for newest glibc. Add canonical names
4962 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4964 2002-05-09 Bruno Haible <bruno@clisp.org>
4966 * localcharset.c (get_charset_aliases): Add more Windows specific
4969 2002-05-08 Owen Taylor <otaylor@redhat.com>
4971 * config.charset: A few additions for Solaris.
4973 2001-12-05 Bruno Haible <bruno@clisp.org>
4975 * localcharset.c (locale_charset): Don't return an empty string.
4977 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4979 * config.charset: msdos in uk_UA uses CP1125.
4981 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4983 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4984 * localcharset.c (locale_charset): Declare as extern "C".
4986 2002-02-15 Bruno Haible <bruno@clisp.org>
4988 * config.charset [msdosdjgpp]: For Russian, use CP866.
4990 2002-02-11 Bruno Haible <bruno@clisp.org>
4992 * config.charset: Add support for NetBSD.
4994 2002-09-25 <karl@gnu.org>
4996 * strdup.c: copy from libc/string (via ../config/srclist*).
4997 * getopt*: copy from libc/posix.
4998 * gettext.h: copy from gettext.
4999 * .cppi-disable: add strdup.c, gettext.h.
5001 2002-07-01 Jim Meyering <meyering@lucent.com>
5003 * c-stack.c: Include sys/time.h.
5004 From Volker Borchert.
5006 2002-06-11 Paul Eggert <eggert@twinsun.com>
5008 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
5009 New macro. Use it uniformly instead of
5010 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
5011 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
5012 reported by Vin Shelton.
5014 2002-06-22 Jim Meyering <meyering@lucent.com>
5016 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
5017 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
5019 2002-06-22 Paul Eggert <eggert@twinsun.com>
5021 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
5022 Do not assume SA_SIGINFO behavior.
5023 Bug reported by Jim Meyering on NetBSD 1.5.2.
5025 2002-06-22 Jim Meyering <meyering@lucent.com>
5027 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
5029 * exitfail.c, exitfail.h: Likewise.
5030 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
5032 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
5034 (EXTRA_DIST): Add fnmatch_loop.c.
5035 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
5037 * fnmatch_loop.c: New file, from diffutils-2.8.2.
5038 * fnmatch.c: Update from diffutils-2.8.2.
5039 * fnmatch_.h: New file. From diffutils-2.8.2.
5040 * fnmatch.h: Remove file.
5042 2002-06-18 Paul Eggert <eggert@twinsun.com>
5044 * file-type.h: Report an error if neither S_ISREG nor
5045 S_IFREG is defined, instead of using a test specific to glibc
5046 2.2. This should be safe, since POSIX requires S_ISREG and
5047 Unix Version 7 had S_IFREG. We don't need to check for
5048 <sys/types.h> since we don't use any symbols that it defines.
5050 2002-06-15 Jim Meyering <meyering@lucent.com>
5052 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
5053 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
5054 have been included before this file.
5056 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
5058 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
5059 so that each temporary file name is unique and valid in the first
5060 8 characters, for operation under DOS.
5062 2002-06-15 Jim Meyering <meyering@lucent.com>
5064 Work even with DJGPP 2.03, which lacks support for symlinks.
5066 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
5068 * lchown.c (S_ISLNK): Likewise.
5070 2002-06-14 Jim Meyering <meyering@lucent.com>
5072 * file-type.h: Use the version from diffutils-2.8.2.
5073 * file-type.c: Likewise.
5075 2002-05-27 Jim Meyering <meyering@lucent.com>
5077 Fix a problem seen only on nonconforming systems whereby ls.c's
5078 use of localtime, and then of gettimeofday would cause trouble:
5079 the localtime call used to initialize rpl_gettimeofday's save
5080 mechanism would clobber ls's current local time information so
5081 that in any long listing the first file would always be listed
5082 with date 1970-01-01. Analysis by Volker Borchert.
5084 * gettimeofday.c (localtime): Undefine.
5085 (rpl_localtime): New function.
5087 2002-05-22 Jim Meyering <meyering@lucent.com>
5089 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
5090 * file-type.h: New file.
5091 * file-type.c (file_type): New file/function. Extracted from diffutils.
5093 2002-04-29 Paul Eggert <eggert@twinsun.com>
5095 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
5097 2002-04-28 Paul Eggert <eggert@twinsun.com>
5099 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
5100 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
5101 of 127, since 64 is the largest conceivable number for ancient
5103 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
5105 2002-04-28 Jim Meyering <meyering@lucent.com>
5107 * sig2str.c (WTERMSIG): Remove definition (unused).
5109 2002-04-28 Paul Eggert <eggert@twinsun.com>
5111 * sig2str.h, sig2str.c: New files.
5112 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
5114 2002-04-24 Jim Meyering <meyering@lucent.com>
5116 * gettext.h: New file, from Gettext.
5117 * Makefile.am (INCLUDES): Remove -I../intl.
5118 (libfetish_a_SOURCES): Add gettext.h.
5120 2002-04-16 Jim Meyering <meyering@lucent.com>
5122 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
5123 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
5124 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
5126 2002-04-12 Jim Meyering <meyering@lucent.com>
5128 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
5130 2002-03-10 Jim Meyering <meyering@lucent.com>
5132 * makepath.c (make_path): Remove a comma from a diagnostic.
5133 Suggestion from Santiago Vila.
5135 2002-03-08 Jim Meyering <meyering@lucent.com>
5137 * rename.c: Mention that this wrapper is needed also on
5138 mips-dec-ultrix4.4 systems.
5140 2002-03-02 Jim Meyering <meyering@lucent.com>
5142 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
5143 not HAVE_CLOCK_SETTIME.
5145 2002-02-27 Paul Eggert <eggert@twinsun.com>
5147 * nanosleep.h: Rename to....
5148 * timespec.h: New name for nanosleep.h. All uses changed.
5150 * gettime.c: New file.
5151 * settime.c: New file.
5154 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
5155 timespec.h. Remove nanosleep.h.
5157 2002-02-25 Paul Eggert <eggert@twinsun.com>
5159 * acl.c, acl.h: New files.
5160 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
5162 2002-02-24 Jim Meyering <meyering@lucent.com>
5164 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
5165 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
5166 cause trouble. Reported by Nelson Beebe.
5168 2002-02-23 Paul Eggert <eggert@twinsun.com>
5170 * path-concat.c (xpath_concat): Reorder code to pacify
5171 compilers that don't know that xalloc_die never returns.
5173 2002-02-20 Jim Meyering <meyering@lucent.com>
5175 * getdate.c: Regenerate using bison-1.33.
5177 2002-02-15 Paul Eggert <eggert@twinsun.com>
5179 * posixver.c, posixver.h: New files.
5180 * Makefile.am (libfetish_a_SOURCES): Add them.
5182 2002-02-02 Paul Eggert <eggert@twinsun.com>
5183 Bruno Haible <bruno@clisp.org>
5185 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
5186 (fwrite_success_callback): New declaration.
5187 * unicodeio.c (unicode_to_mb): New function, extracted from
5188 print_unicode_char. Call failure callback instead of error.
5189 (fwrite_success_callback): New function.
5190 (exit_failure_callback): New function.
5191 (fallback_failure_callback): New function.
5192 (print_unicode_char): Call unicode_to_mb.
5194 2002-01-26 Jim Meyering <meyering@lucent.com>
5196 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
5198 2002-01-22 Jim Meyering <meyering@lucent.com>
5200 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
5201 Otherwise, some versions of automake would omit the rule that makes
5202 Makefile from Makefile.in.
5204 2001-01-21 Paul Eggert <eggert@twinsun.com>
5206 * xmemcoll.h, xmemcoll.c: New files.
5207 * Makefile.am (libfetish_a_SOURCES): Add them.
5208 * memcoll.c: Include errno.h, and declare errno if not defined.
5209 (memcoll): Set errno to zero if there is no error.
5211 * quotearg.c (quotearg_buffer_restyled):
5212 Fix bug with quoting buffers containing NUL when backslashing escapes.
5213 This bug was exposed by the other changes in this patch.
5214 (quotearg_n_options): New arg ARGSIZE.
5215 All callers changed.
5216 (quoting_options_from_style): New function.
5217 (quotearg_n_style): Use it.
5218 (quotearg_n_style_mem): New function.
5220 * quotearg.h (quotearg_n_style_mem): New function.
5222 2002-01-16 Jim Meyering <meyering@lucent.com>
5224 * getdate.y: Add three semicolons, each just before a closing brace.
5225 Bison (as of version 1.31) no longer papers over that mistake.
5227 2002-02-14 Paul Eggert <eggert@twinsun.com>
5229 * backupfile.c (ISDIGIT): Comment fix.
5230 * getdate.y (ISDIGIT): Likewise.
5231 * posixtm.c (ISDIGIT, year): Likewise.
5232 * strverscmp.c (ISDIGIT): Likewise.
5233 * userspec.c (ISDIGIT): Likewise.
5235 2002-01-05 Jim Meyering <meyering@lucent.com>
5237 * version-etc.c (version_etc_copyright): Update copyright year.
5239 2001-01-19 Paul Eggert <eggert@twinsun.com>
5241 * closeout.c (close_stdout_status): If ferror (stdout), do
5242 not silently exit merely because the output buffer happens to
5243 have nothing pending.
5245 2001-12-18 Paul Eggert <eggert@twinsun.com>
5247 See the big note in ../ChangeLog.
5248 * human.c (suffixes): Prefer K to k for 1024.
5249 (generate_suffix_backwards): New function.
5250 (human_readable_inexact): Use it.
5251 * xstrtol.c (__xstrtol): If there is no number but there
5252 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
5253 Accept 'K' as well as 'k'.
5255 2001-12-15 Jim Meyering <meyering@lucent.com>
5257 * regex.h (__restrict_arr): Update from libc.
5259 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
5260 as `remote' if the name starts with `//'. Suggested by Michael Stone.
5263 2001-12-10 Jim Meyering <meyering@lucent.com>
5265 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
5266 Instead, include "xalloc.h".
5267 (initbuffer): Don't cast xmalloc return value to char*.
5268 (readline): Reword comment.
5269 Don't cast xrealloc return value to char*
5272 2001-12-09 Jim Meyering <meyering@lucent.com>
5274 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
5275 `signed and unsigned type in conditional expression'.
5276 * posixtm.c (posix_time_parse): Likewise.
5278 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
5280 * readtokens.c (readtoken): Declare an index to be of type unsigned
5281 to avoid a pedantic warning.
5283 * getstr.c: Don't include assert.h.
5284 (getstr): Remove warning-evoking assertions.
5285 Return -1 if offset parameter is out of bounds.
5286 Change the type of a local from int to size_t.
5288 * strftime.c (my_strftime_localtime_r): Include this function
5289 definition in the `#if ! HAVE_TM_GMTOFF' block.
5291 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
5292 Include xalloc.h instead.
5294 2001-12-02 Jim Meyering <meyering@lucent.com>
5296 * tempname.c: Don't declare getenv, thus reverting the change of
5297 2001-11-18. It's no longer necessary, now that stdlib.h is always
5300 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
5301 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
5303 2001-11-30 Akim Demaille <akim@epita.fr>
5305 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
5306 before being defined.
5308 2001-11-27 Paul Eggert <eggert@twinsun.com>
5310 * quotearg.h (quotearg_n, quotearg_n_style):
5311 First arg is int, not unsigned.
5312 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
5313 (SIZE_MAX, UINT_MAX): New macros.
5314 (quotearg_n_options): Abort if N is negative.
5315 Avoid overflow check on hosts where size_t is 64 bits and int
5316 is 32 bits, as overflow is impossible there.
5317 Fix off-by-one typo that caused unnecessary reallocation.
5319 2001-11-27 Jim Meyering <meyering@lucent.com>
5321 * tempname.c: Merge with version from libc.
5322 * regex.c: Likewise.
5324 * tempname.c: Include stdlib.h unconditionally. On some old systems
5325 for which STDC_HEADERS is 0, it was not included, resulting in a
5326 warning about an integer-to-pointer conversion problem with getenv.
5327 Reported by Volker Borchert.
5329 2001-11-26 Jim Meyering <meyering@lucent.com>
5331 * gtod.h: Remove file.
5332 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
5333 * gettimeofday.c: Don't include gtod.h.
5334 (GTOD_init): Remove function.
5335 (rpl_gettimeofday): Do its job here instead, rather than aborting.
5336 Suggestion from Volker Borchert.
5338 2001-11-23 Jim Meyering <meyering@lucent.com>
5340 * hash.h (struct hash_table): Don't define here. Merely declare it.
5341 * hash.c (struct hash_table): Define it here instead.
5343 2001-11-22 Jim Meyering <meyering@lucent.com>
5345 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
5347 2001-11-18 Paul Eggert <eggert@twinsun.com>
5349 * tempname.c (TMP_MAX): Remove; no longer needed.
5350 (TEMPORARIES): New macro.
5351 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
5352 removes an artificial limitation (e.g. HP-UX 10.20, where
5355 2001-11-18 Jim Meyering <meyering@lucent.com>
5357 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
5360 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
5361 files will be created before anything else.
5363 2001-11-17 Jim Meyering <meyering@lucent.com>
5365 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
5366 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
5367 rather than group writable. Patch by Juan F. Codagnone.
5369 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
5370 Instead, include "xalloc.h".
5372 * mountlist.c: Include unlocked-io.h after all system headers.
5373 Remove explicit declarations of xmalloc, xrealloc,
5374 and xstrdup. Instead, include "xalloc.h".
5376 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
5377 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
5378 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
5380 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
5381 Reported by Padraig Brady.
5383 * mkstemp.c: #undef mkstemp.
5385 (rpl_mkstemp): Rename from mkstemp.
5388 2001-11-16 Jim Meyering <meyering@lucent.com>
5390 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
5391 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
5392 determine the amount of total physical memory, use pstat_getstatic.
5393 HPUX-11 doesn't define _SC_PHYS_PAGES.
5394 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
5395 If sysconf couldn't be used to determine the amount of available
5396 physical memory, use both pstat_getstatic and pstat_getdynamic.
5397 Based on a patch from Bob Proulx.
5399 2001-11-05 Jim Meyering <meyering@lucent.com>
5401 * xstat.in (slash_aware_lstat): Correct a misleading comment.
5403 2001-11-03 Jim Meyering <meyering@lucent.com>
5405 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
5406 in argmatch_to_argument call.
5408 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5411 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5412 e.g., a fault due to an attempt to free a NULL pointer.
5414 2001-11-01 Jim Meyering <meyering@lucent.com>
5416 * dirfd.c, dirfd.h: New files.
5417 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5419 * hash.c (hash_print) [TESTING]: Clean up.
5421 2001-10-22 Paul Eggert <eggert@twinsun.com>
5423 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5424 to avoid a warning if -Wall.
5426 2001-10-21 Paul Eggert <eggert@twinsun.com>
5428 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5430 2001-10-21 Jim Meyering <meyering@lucent.com>
5432 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5433 this code would end up calling gettext even in packages built
5435 * getopt.c (_): Likewise.
5436 * regex.c (_): Likewise.
5438 2001-10-20 Paul Eggert <eggert@twinsun.com>
5440 * error.c (strerror_r): Do not declare unless !_LIBC.
5441 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5442 Use strerror_r that is only a macro, even if it is not a function.
5443 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5444 (private_strerror): Use prototypes, not old-style function definition.
5445 (print_errno_message): New function.
5446 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5448 (error_tail, error, error_at_line): Use it.
5450 2001-10-11 Jim Meyering <meyering@lucent.com>
5452 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5453 and quote_n (1, ... to avoid clobbering a buffer.
5455 2001-10-05 Jim Meyering <meyering@lucent.com>
5457 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5458 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5459 * hash-pjw.h: New file.
5461 2001-09-30 Jim Meyering <meyering@lucent.com>
5463 * mountlist.c [MOUNTED_GETFSSTAT]:
5464 Include <sys/ucred.h>, for Apple Darwin.
5465 Include sys/mount.h and sys/fs_types.h only if available.
5467 (read_filesystem_list): Use FS_TYPE.
5469 2001-09-29 Paul Eggert <eggert@twinsun.com>
5471 * exclude.c (excluded_filename): 0 -> false, since it's
5474 2001-09-28 Paul Eggert <eggert@twinsun.com>
5476 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5477 #defines strtoimax. Also treat the other strto* functions
5480 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5481 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5482 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5484 2001-09-26 Jim Meyering <meyering@lucent.com>
5486 Most macros in unlocked-io.h had the wrong number of arguments.
5487 * gen-uio: New script.
5488 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5489 * unlocked-io.hin: Remove file.
5490 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5491 rather than trying to embed it here.
5492 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5493 Reported by Padraig Brady.
5495 2001-09-25 Volker Borchert <bt@teknon.de>
5497 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5499 2001-09-23 Jim Meyering <meyering@lucent.com>
5501 * mountlist.c: Remove useless parentheses in #if directives.
5502 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5503 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5505 2001-09-22 Jim Meyering <meyering@lucent.com>
5507 * localcharset.c: Update from latest gettext.
5508 * config.charset: Likewise.
5510 2001-09-20 Jim Meyering <meyering@lucent.com>
5512 * xstrtol.c (strtoimax): Guard declaration with
5513 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5514 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5515 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5516 (strtoumax): Likewise, for completeness (it wasn't necessary).
5518 2001-09-06 Paul Eggert <eggert@twinsun.com>
5520 * strtoimax.c (HAVE_LONG_LONG):
5521 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5522 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5523 to work around bug in IBM C compiler.
5525 2001-09-16 Jim Meyering <meyering@lucent.com>
5527 * mkdir.c: New file.
5529 2001-09-04 Paul Eggert <eggert@twinsun.com>
5531 * xgetcwd.c: Revert some of the previous change; intead,
5532 fix the HAVE_GETCWD_NULL code to behave more like the
5533 !HAVE_GETCWD_NULL code used to.
5536 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5539 2001-09-04 Paul Eggert <eggert@twinsun.com>
5541 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5542 Use ssize_t, not int, to store result of readlink.
5543 Check for ssize_t overflow as well as size_t overflow,
5544 as POSIX says the result of readlink is implementation-defined
5545 when ssize_t overflows.
5546 Remove unnecessary cast to char*.
5547 Use free+malloc instead of realloc, as the storage doesn't need
5548 to be preserved and it's clearer and can be more efficient that way.
5549 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5550 * xreadlink.h (xreadlink): Update prototype.
5552 2001-09-03 Paul Eggert <eggert@twinsun.com>
5554 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5555 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5556 spotted by Jim Meyering.
5558 2001-09-03 Jim Meyering <meyering@lucent.com>
5560 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5562 2001-09-03 Paul Eggert <eggert@twinsun.com>
5564 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5565 like the HAVE_GETCWD_NULL code.
5566 Include pathmax.h if not HAVE_GETCWD.
5567 Do not include xalloc.h.
5568 (INITIAL_BUFFER_SIZE): New symbol.
5569 Do not use xmalloc / xrealloc, since the caller is responsible for
5570 handling errors. Preserve errno around `free' during failure.
5571 Do not overrun buffer when using getwd.
5573 2001-09-03 Paul Eggert <eggert@twinsun.com>
5575 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5576 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5578 2001-09-02 Jim Meyering <meyering@lucent.com>
5580 * error.c: Update from GNU libc.
5582 2001-09-01 Jim Meyering <meyering@lucent.com>
5584 * xreadlink.c: New file.
5585 * xreadlink.h: New file.
5586 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5588 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5589 doesn't conflict with sparc Solaris 7's definition in
5590 /usr/include/sys/int_types.h.
5592 * exclude.c: Use `""', not `<>' to #include non-system header files.
5593 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5594 and strncasecmp as r-values. Unixware didn't have declarations.
5596 2001-08-31 Jim Meyering <meyering@lucent.com>
5598 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5599 Use an initial, malloc'd, buffer of length 128 rather than
5600 a statically allocated one of length 1024.
5602 2001-08-30 Paul Eggert <eggert@twinsun.com>
5604 * xgetcwd.c: Don't include pathmax.h.
5605 Include stdlib.h and unistd.h if available.
5607 (xmalloc, xstrdup, free): Remove decls.
5608 (xgetcwd): Don't assume sizes fit in unsigned.
5609 Check for overflow when computing sizes.
5610 Simplify reallocation code.
5612 2001-08-28 Paul Eggert <eggert@twinsun.com>
5614 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5616 * strtoimax.c: Renamed from strtoxmax.c, removing the
5619 Also, make the following further changes to make this file's
5620 configuration more similar to that of strtol.c:
5621 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5622 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5623 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5624 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5625 changed to signed values.
5627 And make the following changes as well:
5628 Fix copyright notice, as 1999 was missing.
5629 (verify): New macro.
5630 (strtoimax): Check sizes at compile-time, not run-time.
5631 Prefer strtol to strtoll if both work.
5632 (main): Remove; it was not that useful and was a pain to maintain.
5634 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5636 2001-08-30 Paul Eggert <eggert@twinsun.com>
5638 * savedir.c (savedir): Remove size parameter, as POSIX says that
5639 a directory's st_size can have an arbitrary value, so the old
5640 usage could waste an arbitrary amount of memory. All uses
5642 * savedir.h: Update prototype.
5644 2001-08-30 Paul Eggert <eggert@twinsun.com>
5646 * xstrtol.c (strtoimax): New decl.
5648 2001-08-28 Paul Eggert <eggert@twinsun.com>
5650 * xstrtol.h: Add copyright notice.
5651 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5652 LONGINT_INVALID_SUFFIX_CHAR.
5654 2001-08-30 Paul Eggert <eggert@twinsun.com>
5656 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5659 2001-08-30 Paul Eggert <eggert@twinsun.com>
5661 * hash.c: Remove '2001' from copyright notice.
5663 2001-08-30 Paul Eggert <eggert@twinsun.com>
5665 * full-write.h: New file.
5666 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5667 * full-write.c: Correct credits, as cccp.c no longer
5668 exists and anyway it was so heavily changed from the old cccp
5669 code as to be unrecognizable. Include full-write.h.
5670 (full_write) Return size_t, with short writes meaning failure.
5671 All callers changed. This fixes a bug with large buffers
5673 * utime.c: Include full-write.h.
5675 2001-08-30 Paul Eggert <eggert@twinsun.com>
5677 Merge 'exclude' changes from tar 1.13.22.
5678 This fixes one or two unlikely storage allocation overflow bugs,
5679 but doesn't change user-visible behavior otherwise.
5681 2001-08-30 Paul Eggert <eggert@twinsun.com>
5683 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5684 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5685 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5686 Include if available.
5687 (<xalloc.h>): Include
5688 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5689 (verify): New macro. Use it to verify that EXCLUDE macros do not
5690 collide with FNM macros.
5691 (struct patopts): New struct.
5692 (struct exclude): Use it, as exclude patterns now come with options.
5693 (new_exclude): Support above changes.
5694 (new_exclude, add_exclude_file):
5695 Initial size must now be a power of two to simplify overflow checking.
5696 (free_exclude, fnmatch_no_wildcards): New function.
5697 (excluded_filename): No longer requires options arg, as the options
5698 are determined by add_exclude. Now returns bool, not int.
5699 (excluded_filename, add_exclude):
5700 Add support for the fancy new exclusion options.
5701 (add_exclude, add_exclude_file): Now takes int options arg.
5702 Check for arithmetic overflow when computing sizes.
5703 (add_exclude_file): xrealloc might modify errno, so don't
5704 realloc until after errno might be used.
5706 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5708 (free_exclude): New decl.
5709 (add_exclude, add_exclude_file): Now takes int options arg.
5710 (excluded_filename): No longer requires options arg, as the options
5711 are determined by add_exclude. Now returns bool, not int.
5713 2001-08-30 Paul Eggert <eggert@twinsun.com>
5715 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5717 2001-08-27 Jim Meyering <meyering@lucent.com>
5719 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5721 * version-etc.c (N_): Remove definition.
5722 Revert most of last change.
5723 Instead, simply don't mark the `Copyright...' string for translation.
5724 Based on advice from Paul Eggert.
5726 * strtoxmax.c: Tweak comment.
5728 2001-08-26 Jim Meyering <meyering@lucent.com>
5730 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5731 of copyright with `%s' so translators don't get an untranslated
5733 (COPYRIGHT_YEAR): Define.
5734 (version_etc): Use fprintf rather than fputs.
5735 Suggestion from Ulrich Drepper.
5737 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5739 * strtoll.c: New file, from GNU libc.
5740 * xstrtoimax.c: New file.
5742 * xstrtol.h: Add xstrtoimax.
5743 * strtoumax.c: New file. Simply include "strtoumax.c".
5744 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5746 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5747 * strtoxmax.c: ... then renamed to this.
5749 2001-08-13 Paul Eggert <eggert@twinsun.com>
5751 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5752 Port to Solaris 8, where 'sed' requires a space after the 'r'
5753 command, and where sh dislikes "$/". Clean up the spacing a bit.
5754 Redirect output to $tmp just once.
5756 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5758 * addext.c (<errno.h>): Include.
5759 (errno): Declare if not defined.
5760 (addext): Work correctly when pathconf returns -1 and leaves
5761 errno alone because there is no limit. Also, work even if
5762 pathconf returns a value greater than SIZE_MAX.
5764 2001-08-12 Jim Meyering <meyering@lucent.com>
5766 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5767 Simply `return getcwd (NULL, 0);'.
5768 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5769 Use 1300 as initial value for length, not PATH_MAX.
5771 * pathmax.h: Clean up cpp syntax.
5773 2001-08-12 Jim Meyering <meyering@lucent.com>
5775 * gettimeofday.c: New file.
5777 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5779 2001-08-04 Jim Meyering <meyering@lucent.com>
5781 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5782 to get in sync with glibc.
5784 2001-08-03 Paul Eggert <eggert@twinsun.com>
5786 The following changes are from gettext 0.10.39 as maintained by
5789 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5790 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5791 with inverted sense. All uses changed.
5793 * mbswidth.c: Don't include <limits.h>.
5794 Include <stdlib.h> and <string.h> unconditionally.
5795 (iswcntrl, mbsinit, ISCNTRL): New macros.
5796 (mbsnwidth): Use K&R style function declarations.
5797 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5798 can optimize it when MB_CUR_MAX == 1.
5799 The width of control characters is zero, not 1.
5801 2001-07-15 Jim Meyering <meyering@lucent.com>
5803 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5804 (BUILT_SOURCES): Add unlocked-io.h.
5805 (io_functions): Define.
5806 (unlocked-io.h): New rule.
5807 (DISTCLEANFILES): Add unlocked-io.h.
5808 (all-local): Depend on unlocked-io.h, to ensure it is created.
5810 * unlocked-io.hin: New file
5812 * regex.c: Update from glibc.
5814 2001-07-05 Jim Meyering <meyering@lucent.com>
5816 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5818 (libfetish_a_SOURCES): Put all .h files here instead.
5819 Remove a thus-exposed (better checks in automake) duplicate and
5820 two unnecessary .h files.
5822 2001-06-11 Jim Meyering <meyering@lucent.com>
5824 * regex.c: Update from GNU libc.
5826 2001-05-27 Jim Meyering <meyering@lucent.com>
5828 * readutmp.h (UT_TYPE): Define.
5830 2001-05-24 Jim Meyering <meyering@lucent.com>
5832 * argmatch.c: Include "quote.h".
5833 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5834 quote function. Reported by Göran Uddeborg.
5836 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5838 * dirname.c (dir_name): Compute append_dot using path, not newpath
5839 which is not yet declared.
5841 2001-05-11 Paul Eggert <eggert@twinsun.com>
5843 * Makefile.am (libfetish_a_SOURCES):
5844 Add strftime.c, since we now compile it on all hosts.
5846 * strftime.c (my_strftime):
5847 Define to nstrftime if emacs, but only if my_strftime is not defined.
5848 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5849 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5850 Add one more extra argument: a nanoseconds value.
5853 (my_strftime function): Add %N format.
5854 (emacs_strftimeu): Renamed from emacs_strftime,
5855 with extra ut argument.
5857 2001-05-11 Paul Eggert <eggert@twinsun.com>
5859 dirname code cleanup. base_name now behaves more compatibly
5860 with POSIX basename when given file names that have trailing
5861 slashes, and similarly for dir_name. Add new primitives
5862 base_len and dir_len. Put the directory-name-related decls
5865 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5866 * backupfile.c (base_name): Likewise.
5867 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5868 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5869 * makepath.c (strip_trailing_slashes): Likewise.
5870 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5872 * rename.c (strip_trailing_slashes): Likewise.
5873 * same.c (base_name): Likewise.
5874 * stripslash.c (ISSLASH): Likewise.
5876 * addext.c: Include <dirname.h> after size_t is defined.
5877 * backupfile.c: Likewise.
5879 * addext.c (addext): Use base_len to trim redundant
5880 trailing slashes instead of doing it ourselves.
5881 But do not trim the last slash if it is not redundant.
5883 * backupfile.c (find_backup_file_name,
5884 max_backup_version): Use base_len instead of rolling it ourselves.
5885 Handle the case of "" and (on DOS) "C:" correctly.
5887 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5888 Include <string.h>, <dirname.h>.
5889 (base_name): Allow file names ending in slashes, other than names
5890 that are all slashes. In this case, return the basename followed
5891 by the slashes. This is more general, and can be used in places
5892 where the original base_name purposely had an assertion failure.
5893 (base_len): New function.
5895 * dirname.c: Include <string.h> instead of <stdlib.h>.
5896 Do not include <assert.h>; no longer needed.
5898 (memrchr): Remove decl.
5899 (dir_name_r): Remove.
5900 (dir_len): Renamed from dirlen. All callers changed.
5901 Rewrite in terms of base_name, for simplicity and consistency.
5902 (dir_name): Never return NULL. All callers changed.
5903 Do not include <stdlib.h> in test program; no longer needed.
5904 return 0; is fine for test program.
5906 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5908 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5910 * path-concat.c (path_concat): Use base_len to compute
5911 base length, not strlen; this means we cannot rely on memcpy
5914 * same.c (STREQ): Remove.
5915 (same_name): Handle the case where the basename ends in trailing '/'.
5917 * stripslash.c (strip_trailing_slashes): Return nonzero if
5918 a slash was stripped. Do not strip the last slash after a
5921 2001-04-08 Jim Meyering <meyering@lucent.com>
5923 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5924 recomputed; that's necessary when the offset spans a DST transition.
5925 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5927 2001-04-02 Jim Meyering <meyering@lucent.com>
5929 * regex.h, regex.c: Update from GNU libc.
5931 2001-03-19 Paul Eggert <eggert@twinsun.com>
5933 * version-etc.c (version_etc_copyright): Update to 2001.
5935 2001-03-16 Paul Eggert <eggert@twinsun.com>
5937 * tempname.c (uint64_t): Define to uintmax_t if
5938 not defined, and if UINT64_MAX is not defined.
5939 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5940 Reported by John David Anglin.
5942 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5944 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5945 alias if codeset is empty.
5946 * config.charset (BeOS): Use wildcard syntax.
5948 2001-03-13 Jim Meyering <meyering@lucent.com>
5950 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5951 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5954 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5956 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5958 * unicodeio.c (print_unicode_char): Simplify accordingly.
5960 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5962 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5963 support for DOS/DJGPP.
5965 2001-02-28 Paul Eggert <eggert@twinsun.com>
5967 * Makefile.am (libfetish_a_SOURCES):
5968 Add dup-safer.c, fopen-safer.c.
5969 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5971 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5973 2001-02-25 Paul Eggert <eggert@twinsun.com>
5975 The mkstemp replacement is taken from glibc 2.2.2, with some
5976 portability fixes for use outside glibc, as follows:
5978 * tempname.c (struct_stat64): New macro.
5979 (direxists, __gen_tempname): Use it.
5980 This avoids a portability problem with Solaris 8.
5982 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5983 (<stddef.h>, <stdint.h>, <string.h>):
5984 Include only if STDC_HEADERS || _LIBC.
5985 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5986 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5987 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5988 (__set_errno): Define this macro if <errno.h> doesn't.
5989 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5990 Define these macros if <stdio.h> doesn't.
5991 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5992 Define these macros if <sys/stat.h>
5993 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5994 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5995 __xstat64): Define if not _LIBC.
5996 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5997 (__gen_tempname): Invoke gettimeofday only if
5998 HAVE_GETTIMEOFDAY || _LIBC;
5999 otherwise, fall back on plain "time".
6000 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
6002 * mkstemp.c (__GT_FILE): Define to zero if not defined.
6004 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
6006 2001-02-17 Jim Meyering <meyering@lucent.com>
6008 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
6009 around included file name.
6011 * strnlen.c (__strnlen): Merge in a change from GNU libc.
6013 * strftime.c: Update from GNU libc (the only changes were to comments).
6015 2001-02-13 Bruno Haible <haible@clisp.cons.org>
6017 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
6019 2001-02-17 Paul Eggert <eggert@twinsun.com>
6021 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
6022 Remove workaround macros for hosts that have mbrtowc but not
6023 mbstate_t, as we now insist on proper declarations for both
6024 before using mbrtowc.
6026 2001-02-17 Jim Meyering <meyering@lucent.com>
6028 * regex.c: Update from libc.
6030 2001-02-16 Paul Eggert <eggert@twinsun.com>
6032 * alloca.c (malloc): Undef before defining, since stdlib.h
6033 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
6034 Reported by Mark Hounschell via Paul Eggert.
6036 2001-01-30 Bruno Haible <haible@clisp.cons.org>
6038 * config.charset: Update for FreeBSD 4.2.
6040 2001-01-26 Jim Meyering <meyering@lucent.com>
6042 * quotearg.c: Include stddef.h.
6043 * quote.c: Include stddef.h.
6044 Reported by Axel Kittenberger.
6046 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
6047 line in double quotes so that it evokes a better diagnostic.
6048 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
6049 Reported by Axel Kittenberger.
6051 2001-01-15 Bruno Haible <haible@clisp.cons.org>
6053 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
6054 to avoid a warning. Add back 'const' to inptr.
6056 2001-01-16 Jim Meyering <meyering@lucent.com>
6058 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
6061 2001-01-14 Jim Meyering <meyering@lucent.com>
6063 * rename.c: New file. From Volker Borchert.
6064 Include stdlib.h, string.h or strings.h, and xalloc.h.
6065 Use strip_trailing_slashes rather than open-coding it.
6067 2001-01-03 Paul Eggert <eggert@twinsun.com>
6069 * strftime.c: Sync with glibc time/strftime.c 1.81.
6071 2001-01-03 Jim Meyering <meyering@lucent.com>
6073 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
6074 local `inptr' to avoid warning with some system declarations of iconv.
6076 2000-12-29 Paul Eggert <eggert@twinsun.com>
6078 * modechange.c: Do not assume that mode_t uses the
6079 traditional octal encoding. E.g. "chmod 1 FOO" should set
6080 the other-execute bit of FOO even if S_IXOTH != 1.
6082 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
6083 WOTH, XOTH, ALLM): New macros.
6084 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
6085 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
6087 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
6088 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
6090 No need to use uintmax_t; unsigned long is long enough.
6091 Don't bother to get suffix since we don't use it.
6093 2000-12-24 Jim Meyering <meyering@lucent.com>
6095 * hash.c (is_prime): Return explicit boolean values.
6096 (hash_get_first): Return NULL to appease Irix5.6's 89.
6097 Reported by Nelson Beebe.
6099 2000-10-31 Bruno Haible <haible@clisp.cons.org>
6101 * localcharset.c (locale_charset): Add support for Win32.
6103 2000-12-18 Paul Eggert <eggert@twinsun.com>
6105 * physmem.h, physmem.c: New files.
6107 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
6108 (noinst_HEADERS): Add physmem.h.
6110 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
6111 't' for compatibility with Solaris 8 sort.
6113 2000-12-18 Bruno Haible <haible@clisp.cons.org>
6115 * config.charset: Add support for BeOS.
6117 2000-12-16 Jim Meyering <meyering@lucent.com>
6119 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
6120 SHELLS_FILE to a file name that's useful on djgpp systems.
6122 (ADDITIONAL_DEFAULT_SHELLS): Define.
6123 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
6124 Based mostly on a patch from Prashant TR.
6126 2000-12-16 Jim Meyering <meyering@lucent.com>
6128 This bug had a serious impact on chown: `chown N:M FILE' (for integer
6129 N and M) would have treated it like `chown N:N FILE'.
6131 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
6133 2000-10-31 Bruno Haible <haible@clisp.cons.org>
6135 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
6136 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
6137 to the list of canonical encodings. Rename EUC-CN to GB2312.
6139 2000-12-08 Andreas Schwab <schwab@suse.de>
6141 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
6142 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
6144 2000-12-07 Jim Meyering <meyering@lucent.com>
6146 * stripslash.c (ISSLASH): Define.
6147 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
6150 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
6151 (dir_name_r): Declare this function as static.
6152 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
6153 manifest itself on a name containing a mix of slashes and
6155 Make this function work with names starting with a DOS-style
6156 drive letter and colon prefix.
6157 (dir_name): Append `.' if necessary.
6158 Based mostly on patches from Prashant TR and Eli Zaretskii.
6160 * dirname.h (dir_name_r): Remove prototype.
6162 2000-12-05 Jim Meyering <meyering@lucent.com>
6164 * dirname.c (dir_name_r): Add `const' in a few local declarations.
6166 2000-12-04 Jim Meyering <meyering@lucent.com>
6168 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
6169 Also include memory.h, stdlib.h, unistd.h if appropriate.
6170 Reported by Andreas Jaeger (conflicting declaration of malloc).
6172 2000-12-02 Jim Meyering <meyering@lucent.com>
6174 * closeout.h: Make idempotent, to avoid some obscure warnings.
6176 2000-12-01 Paul Eggert <eggert@twinsun.com>
6178 * memrchr.c: Include <config.h> before any system include file.
6180 2000-11-29 Paul Eggert <eggert@twinsun.com>
6182 * dirname.c (dir_name_r): Fix typo: int -> size_t.
6184 2000-11-26 Jim Meyering <meyering@lucent.com>
6186 * memcoll.c: Include sys/types.h. From Werner Almesberger.
6188 2000-11-22 Paul Eggert <eggert@twinsun.com>
6190 * strftime.c (my_strftime): Do not invoke mbrlen with a
6191 size of (size_t) -1; it's not portable.
6193 2000-11-17 Akim Demaille <akim@epita.fr>
6195 * obstack.h: Formatting changes.
6196 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
6197 prevent type checking.
6198 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
6199 cast the value to (void *): assigning a `foo *' to a `void *'
6201 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
6203 2000-11-17 Jim Meyering <meyering@lucent.com>
6205 * strstr.c: Update from GNU libc.
6207 2000-11-16 Jim Meyering <meyering@lucent.com>
6209 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
6211 2000-11-11 Jim Meyering <meyering@lucent.com>
6213 * error.c: Add a couple #includes, merging from GNU libc version.
6215 2000-11-10 Jim Meyering <meyering@lucent.com>
6217 * obstack.h: Update from GNU libc.
6218 * obstack.c: Likewise.
6220 2000-11-06 Paul Eggert <eggert@twinsun.com>
6222 * getusershell.c (setusershell): Use rewind rather than
6223 fseek/fseeko, to avoid configuration hassles with fseeko.
6224 Don't bother opening SHELLS_FILE if shellstream is NULL;
6227 2000-11-05 Jim Meyering <meyering@lucent.com>
6229 * makepath.h (make_dir): Declare.
6230 * makepath.c (make_dir): Remove `static' attribute.
6233 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
6235 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
6236 last one in a bucket, advance to the next bucket.
6238 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
6240 * fnmatch.c: Do not comment out all the code if we are using
6241 the GNU C library, because in some cases we are replacing buggy
6242 code in the GNU C library itself.
6244 2000-10-30 Paul Eggert <eggert@twinsun.com>
6246 * error.h, getline.h, modechange.h:
6247 Remove "2000" from Copyright line, as the file hasn't been
6248 changed this year other than in the copyright notice.
6250 * xalloc.h: Add "2000" to Copyright line, as this file
6251 was changed this year.
6253 2000-10-30 Paul Eggert <eggert@twinsun.com>
6255 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
6256 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
6257 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
6259 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
6261 * regex.h (__restrict_arr): Move definition out of #ifndef block.
6262 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
6263 doesn't define __restrict_arr.
6265 2000-10-29 Jim Meyering <meyering@lucent.com>
6267 * xstat.in: Fix grammar in comment.
6269 2000-10-28 Jim Meyering <meyering@lucent.com>
6271 * memchr.c: Update from libc.
6272 Adjust for portability:
6273 [HAVE_STDLIB_H]: Include stdlib.h.
6274 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
6275 Undef __memchr, too.
6276 [!weak_alias]: Define __memchr to memchr.
6278 * regex.c: Update from libc.
6279 * regex.h: Likewise.
6280 * getopt1.c: Likewise.
6281 * memcmp.c: Likewise.
6283 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
6284 Avoid using fseek, when possible -- it's broken by design.
6285 Patch by Ulrich Drepper.
6287 2000-10-26 Jim Meyering <meyering@lucent.com>
6289 * strftime.c: Update from libc.
6291 2000-10-25 Jim Meyering <meyering@lucent.com>
6293 * obstack.c: Update from libc.
6295 2000-10-23 Jim Meyering <meyering@lucent.com>
6297 * hard-locale.c (hard_locale): Revert last change -- it was simply
6298 wrong. That set_locale call must not have any side effects.
6301 2000-10-22 Jim Meyering <meyering@lucent.com>
6303 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
6304 [CYCLIC]: Remove now-unused definition.
6306 * save-cwd.c (O_DIRECTORY): Define, if needed.
6307 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
6308 Suggestion from Ulrich Drepper.
6310 2000-10-21 Jim Meyering <meyering@lucent.com>
6312 * dirname.c (dir_name_r): New function, factored out of dir_name.
6313 (dir_name): Use dir_name_r.
6314 * dirname.h (dir_name_r): Declare it.
6316 2000-10-21 Jim Meyering <meyering@lucent.com>
6318 * dirname.c (memrchr): Declare if necessary.
6319 (dir_name): Remove the restriction that there be no
6320 trailing slashes. Now, this code skips past them, effectively
6322 [TEST_DIRNAME] (main): New unit tests.
6324 * memrchr.c: New file from GNU libc.
6325 Undef __memrchr, too.
6326 [!weak_alias]: Define __memrchr to memrchr.
6327 Guard weak_alias use with `#ifdef weak_alias'.
6329 2000-10-17 Jim Meyering <meyering@lucent.com>
6331 * quote.h (PARAMS): Define and use.
6332 Reported by Akim Demaille.
6334 * getopt.c: Update from libc.
6336 2000-10-16 Jim Meyering <meyering@lucent.com>
6338 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
6341 2000-09-25 Jim Meyering <meyering@lucent.com>
6343 * md5.h (rol): Define (from GnuPG).
6345 * sha.c: Give credit (GnuPG) where due.
6346 (M): Use rol rather than open-coding it.
6347 Add a FIXME comment.
6349 2000-09-21 Jim Meyering <meyering@lucent.com>
6351 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
6352 Reported by Michael Stone.
6354 2000-09-20 Jim Meyering <meyering@lucent.com>
6356 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
6357 (noinst_HEADERS): Add sha.h.
6358 Based on code from Scott G. Miller and from GnuPG.
6360 2000-09-15 Jim Meyering <meyering@lucent.com>
6362 * regex.c: Update from libc.
6364 2000-09-10 Jim Meyering <meyering@lucent.com>
6366 * getopt.c (_getopt_internal): Update from glibc.
6368 2000-09-09 Jim Meyering <meyering@lucent.com>
6370 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
6371 think it should be used as a general replacement for isascii.
6372 * fnmatch.c: Likewise.
6373 * mbswidth.c: Likewise
6374 * regex.c: Likewise.
6377 * userspec.c: Include sys/param.h and limits.h.
6379 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6380 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
6381 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
6382 UID, GID. Check range.
6384 2000-09-06 Jim Meyering <meyering@lucent.com>
6386 * getopt.c (_getopt_internal): Update from glibc.
6388 2000-08-30 Jim Meyering <meyering@lucent.com>
6390 * strftime.c: Merge in changes from GNU libc.
6392 2000-08-26 Jim Meyering <meyering@lucent.com>
6394 * closeout.c: Include "__fpending.h".
6395 (close_stdout_status): Return right away if there's nothing to flush.
6397 * Makefile.am (noinst_HEADERS): Add __fpending.h.
6398 * __fpending.c: New file.
6399 * __fpending.h: New file.
6401 2000-08-07 Paul Eggert <eggert@twinsun.com>
6403 Standardize on "memory exhausted" instead of "Memory exhausted"
6404 or "virtual memory exhausted".
6405 * obstack.c (print_and_abort): Use "memory exhausted", not
6406 "virtual memory exhausted".
6407 * same.c (same_name): Invoke xalloc_die instead of printing
6409 * userspec.c (parse_user_spec): Likewise.
6410 * bumpalloc.h: comment fix
6411 * same.c, userspec.c: Include xalloc.h.
6413 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6414 not char *const and pointing to a constant array.
6415 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6416 (xrealloc): Comment fix.
6418 * userspec.c (parse_user_spec):
6419 Don't translate a message until just before returning,
6420 to avoid unnecessary translation.
6422 2000-08-07 Jim Meyering <meyering@lucent.com>
6424 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6425 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6426 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6427 getgroups.c, gethostname.c, getopt.h, group-member.c,
6428 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6429 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6430 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6431 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6432 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6433 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6434 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6435 yesno.c: Back out Copyright date changes for each file with no change
6436 this year. This eases coordination with other programs using the same
6437 source code modules. From Paul Eggert.
6439 2000-08-03 Greg McGary <greg@mcgary.org>
6441 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6442 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6443 (EXTEND_BUFFER): Use them.
6445 2000-08-01 Jim Meyering <meyering@lucent.com>
6447 * dirname.c (ISSLASH): Define.
6448 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6449 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6450 both `\' and `/' may be use as path separators.
6451 Based on a patch from Prashant TR.
6453 2000-07-31 Paul Eggert <eggert@twinsun.com>
6455 * quotearg.c (quotearg_n_options): Don't make the initial
6456 slot vector a constant, since it might get modified.
6458 2000-07-31 Jim Meyering <meyering@lucent.com>
6460 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6461 * obstack.c (print_and_abort): Likewise.
6463 2000-07-30 Paul Eggert <eggert@twinsun.com>
6465 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6466 buffer, so that the caller can always quote one small
6467 component of a "memory exhausted" message in slot 0.
6468 From a suggestion by Jim Meyering.
6470 2000-07-30 Jim Meyering <meyering@lucent.com>
6472 * makepath.c (make_path): Quote the other instance, too.
6474 * quotearg.c (N_STATIC_SLOTVECS): Define.
6475 (STATIC_BUF_SIZE): Define.
6476 (quotearg_n_options): Use only statically allocated storage when
6477 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6478 than STATIC_BUF_SIZE.
6480 2000-07-29 Jim Meyering <meyering@lucent.com>
6482 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6483 * dirname.c (dir_name): Likewise.
6485 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6487 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6488 (dir_name): Assert that there are no trailing slashes.
6490 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6492 * mbswidth.h (mbswidth): Add a flags argument.
6493 (mbswidth): New declaration.
6494 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6495 * mbswidth.c (mbswidth): Add a flags argument.
6496 (mbsnwidth): New function.
6498 2000-07-24 Jim Meyering <meyering@lucent.com>
6500 * mbswidth.c: Remove useless #else. From Bruno Haible.
6502 2000-07-23 Paul Eggert <eggert@twinsun.com>
6504 * mbswidth.c (_XOPEN_SOURCE):
6505 Don't define; this causes problems on Solaris 7.
6506 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6508 2000-07-23 Paul Eggert <eggert@twinsun.com>
6511 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6512 so that mbstate_t is always defined.
6514 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6515 be 1 in at least one GCC installation, and this configuration
6516 error is likely to be common. Ignoring MB_LEN_MAX hurts
6517 performance on hosts that have mbrtowc but have only unibyte
6518 locales, but I assume these hosts are rare.
6520 2000-07-23 Paul Eggert <eggert@twinsun.com>
6522 * quotearg.c: Streamline by invoking multibyte code only if needed.
6523 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6524 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6525 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6526 invoke multibyte primitives.
6528 2000-07-23 Jim Meyering <meyering@lucent.com>
6530 * basename.c (base_name): Add an assertion.
6532 2000-07-15 Bruno Haible <clisp.cons.org>
6534 * quotearg.c: When the system forces us to redefine mbstate_t,
6535 shadow its mbsinit function.
6537 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6539 * mbswidth.h: New file.
6540 * mbswidth.c: New file.
6541 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6542 (noinst_HEADERS): Add mbswidth.h.
6544 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6546 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6549 2000-07-15 Jim Meyering <meyering@lucent.com>
6551 * makepath.c: Include quote.h.
6552 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6553 corresponding argument in a `quote (...)' call.
6554 Give better diagnostics.
6556 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6557 (noinst_HEADERS): Add quote.h.
6559 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6560 from tar's src/misc.c.
6561 * quote.h: New file. Prototypes for same.
6563 2000-07-10 Paul Eggert <eggert@twinsun.com>
6565 From a suggestion by Bruno Haible.
6566 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6567 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6568 to decide whether to define the BeOS workaround macro;
6569 this adjusts to the change to AC_MBSTATE_T.
6571 2000-07-13 Paul Eggert <eggert@twinsun.com>
6573 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6575 * quotearg.c (quoting_style_args, quoting_style_vals,
6576 quotearg_buffer_restyled): Add support for
6577 clocale_quoting_style. Undo previous change to
6578 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6579 and "{RIGHT QUOTATION MARK}" msgids.
6581 2000-07-05 Paul Eggert <eggert@twinsun.com>
6583 The old behavior of quoting `like this' doesn't look good with
6584 newer, ISO-style fonts. See:
6585 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6587 Instead, quote "like this" by default. Let the translator
6588 tailor the locale-specific quoting behavior by providing
6589 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6591 * quotearg.c (N_): New macro.
6592 (gettext_default): New function.
6593 (quotearg_buffer_restyled): Use
6594 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6595 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6597 2000-07-09 Jim Meyering <meyering@lucent.com>
6599 * Most files: Update copyright dates to include 2000.
6601 2000-07-08 Jim Meyering <meyering@lucent.com>
6603 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6605 (xgethostname): Remove now-unnecessary #ifdef.
6606 Move declaration of `err' into loop where it's used.
6608 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6610 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6611 by allocating a larger buffer. Test the gethostname return value for
6612 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6613 returns an error and ENAMETOOLONG isn't defined.
6615 2000-07-05 Paul Eggert <eggert@twinsun.com>
6616 and Bruno Haible <haible@clisp.cons.org>
6618 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6620 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6622 * quotearg.c (struct quoting_options): Simplify quote_these_too
6625 2000-07-03 Jim Meyering <meyering@lucent.com>
6627 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6628 Reported by Bruno Haible.
6630 2000-07-04 Jim Meyering <meyering@lucent.com>
6632 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6633 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6636 2000-07-03 Paul Eggert <eggert@twinsun.com>
6637 and Bruno Haible <haible@clisp.cons.org>
6639 * quotearg.c (mbrtowc):
6640 Assign to *pwc, and return 1 only if result is nonzero.
6641 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6643 2000-07-03 Jim Meyering <meyering@lucent.com>
6645 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6646 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6649 2000-07-02 Jim Meyering <meyering@lucent.com>
6651 * quotearg.c (mbstate_t): Don't define here.
6653 2000-07-02 Jim Meyering <meyering@lucent.com>
6655 * nanosleep.c (SIGCONT): Define if not already defined.
6657 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6659 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6660 per change in ../m4/ls-mntd-fs.m4.
6661 (read_filesystem_list): Ignore symbolic links.
6663 2000-06-29 Jim Meyering <meyering@lucent.com>
6665 * same.c: Include <string.h> or <strings.h>, as appropriate,
6666 for declaration of strcmp.
6668 * long-options.c: Include <stdlib.h>, for declaration of exit.
6670 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6671 Avoid warning by casting result to `char *' to remove `const'.
6673 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6675 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6677 2000-06-26 Paul Eggert <eggert@twinsun.com>
6679 savedir now sets errno on failure and invokes xmalloc to get memory.
6680 Fix a couple of other minor bugs while we're at it.
6682 * savedir.c (<unistd.h>): Do not include; there's no need.
6683 (NAMLEN): Remove macro.
6684 (malloc, realloc): Remove decls.
6686 ("xalloc.h"): Include.
6687 (NAME_SIZE_DEFAULT): New macro.
6688 (savedir): Use xmalloc / xrealloc to allocate memory.
6689 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6690 Skip "" directory entries.
6691 Use strlen to calculate directory entry length, since the old method
6692 is rarely used these days and isn't worth supporting.
6693 Don't use a pointer after freeing it.
6694 Check for integer overflow when calculating allocation size.
6695 Use memcpy to copy entries, instead of stpcpy.
6696 Set errno properly when returning NULL.
6697 Check for readdir error.
6699 2000-06-26 Jim Meyering <meyering@lucent.com>
6701 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6703 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6705 * getusershell.c (xmalloc, xrealloc): Remove functions.
6707 Don't include <stdlib.h>. Don't declare malloc, realloc.
6709 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6711 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6713 2000-06-24 Jim Meyering <meyering@lucent.com>
6715 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6717 2000-06-21 Jim Meyering <meyering@lucent.com>
6719 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6721 2000-06-19 Paul Eggert <eggert@twinsun.com>
6723 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6724 (mbrtowc, mbstate_t): Define substitutes if
6725 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6726 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6727 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6729 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6731 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6732 than 1024, return a memory chunk of least possible size, instead
6733 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6734 Use free/xmalloc instead of xrealloc to avoid copying for very long
6737 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6739 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6740 address, not strdup. Include <stdlib.h> and don't declare free().
6742 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6744 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6747 2000-06-21 Jim Meyering <meyering@lucent.com>
6749 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6750 (noinst_HEADERS): Add getstr.h.
6752 * getline.c (getstr): Move into a separate file.
6753 * getstr.c (getstr): New file, extracted from getline.c, with
6754 the following changes: new parameter, delim2; both delim[12]
6755 parameters have type `int', not `char'. The latter would lose
6756 with 8-bit delimiters.
6757 * getstr.h: New file.
6759 2000-06-19 Jim Meyering <meyering@lucent.com>
6761 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6763 2000-06-18 Jim Meyering <meyering@lucent.com>
6765 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6766 Besides, these days every porting target provides a mkdir function.
6768 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6769 (this snippet comes from src/system.h).
6771 2000-06-15 Paul Eggert <eggert@twinsun.com>
6773 * human.c (adjust_value): New function.
6774 (human_readable_inexact): Apply rounding style even when
6775 printing approximate values.
6777 2000-06-14 Paul Eggert <eggert@twinsun.com>
6779 * human.c (human_readable_inexact): Allow an input block
6780 size that is not a multiple of the output block size, and vice versa.
6781 Reported by Piergiorgio Sartor.
6783 2000-06-14 Paul Eggert <eggert@twinsun.com>
6785 * getdate.y (get_date): Apply relative times after time
6786 zone indicator, not before. Reported by Todd A. Jacobs.
6788 2000-06-13 Jim Meyering <meyering@lucent.com>
6790 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6792 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6794 2000-06-12 Paul Eggert <eggert@twinsun.com>
6796 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6798 2000-06-04 Paul Eggert <eggert@twinsun.com>
6800 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6802 2000-06-04 Jim Meyering <meyering@lucent.com>
6804 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6805 SunOS 4.1.4 for which gid_t is an unsigned type.
6807 2000-06-03 Jim Meyering <meyering@lucent.com>
6809 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6811 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6813 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6814 newer, don't install charset.alias.
6815 * config.charset: Change the Linux/glibc rules so they become empty
6816 on glibc-2.1 or newer.
6818 2000-06-02 Jim Meyering <meyering@lucent.com>
6820 * mountlist.c: Back out last change. Instead, do this...
6821 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6822 member using the same `ignore'-testing code.
6823 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6827 2000-05-29 Jim Meyering <meyering@lucent.com>
6829 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6830 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6832 2000-05-22 Jim Meyering <meyering@lucent.com>
6834 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6836 2000-05-18 Jim Meyering <meyering@lucent.com>
6838 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6839 back, too, since it may have been modified by allocate_entry.
6840 (hash_delete): Rewrite to use neither the assignment operator
6841 nor the comma operator in an if-expression.
6843 2000-05-15 Paul Eggert <eggert@twinsun.com>
6846 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6847 Remove; no longer needed.
6848 "quotearg.h": Add include.
6849 (file_name): Do not bother to explicitly initialize to NULL; it's less
6850 efficient on some hosts.
6851 (close_stdout_status): Remove test as to whether stdout was already
6852 closed; it breaks for the case "echo x | sort >&-".
6853 Quote file name colons.
6854 Do not assume that _("write error") lacks format strings.
6856 2000-05-15 Jim Meyering <meyering@lucent.com>
6858 * version-etc.c (version_etc_copyright): Update the copyright string
6859 used in all --version output.
6861 2000-05-14 Jim Meyering <meyering@lucent.com>
6863 * closeout.c (close_stdout_set_file_name): New function.
6864 (close_stdout_status): Use new file-scoped global.
6865 Return right away if fstat says the stdout file descriptor is invalid.
6866 * closeout.h (close_stdout_set_file_name): Declare.
6868 2000-05-10 Jim Meyering <meyering@lucent.com>
6870 * closeout.c [default_exit_status]: New file-scoped variable.
6871 (close_stdout_set_status): New function.
6872 * closeout.h (close_stdout_set_status): Declare.
6874 2000-05-08 Jim Meyering <meyering@lucent.com>
6876 * long-options.c: Don't include closeout.h.
6877 (parse_long_options): Don't call close_stdout for --version.
6879 2000-05-06 Jim Meyering <meyering@lucent.com>
6881 * strnlen.c: Undefine __strnlen and strnlen.
6882 [!weak_alias]: Define __strnlen to strnlen.
6884 * atexit.c: New file, from libiberty.
6886 2000-05-06 Jim Meyering <meyering@lucent.com>
6888 * closeout.c (close_stdout_status): Also check for errors on the
6891 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6893 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6894 instead of xmalloc, xrealloc, path_concat.
6895 (locale_charset): Treat empty environment variables as absent.
6896 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6898 2000-05-04 Jim Meyering <meyering@lucent.com>
6900 * getopt.c: Update from glibc.
6901 * obstack.c: Likewise.
6902 * obstack.h: Likewise.
6903 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6905 * regex.h: Likewise.
6906 * strndup.c: Likewise.
6907 * strnlen.c: New file, from glibc.
6909 2000-05-01 Jim Meyering <meyering@lucent.com>
6911 * full-write.c (full_write): Remove `FIXME' part of comment.
6913 2000-04-29 Jim Meyering <meyering@lucent.com>
6915 * path-concat.c: Declare strdup only if it's not defined.
6916 * canon-host.c: Likewise.
6918 2000-04-28 Jim Meyering <meyering@lucent.com>
6920 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6921 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6922 included first, then limits.h is included by locale.h by libintl.h.
6923 From John David Anglin.
6925 2000-04-25 Jim Meyering <meyering@lucent.com>
6927 * makepath.c (S_IRWXUGO): Define.
6928 (make_path): Always perform explicit chmod if MODE specifies any
6929 of the `special' permission bits. Prompted by a bug report against
6930 install from Mate Wierdl and Joost van Baal.
6932 2000-04-18 Jim Meyering <meyering@lucent.com>
6936 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6937 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6939 2000-04-17 Jim Meyering <meyering@lucent.com>
6941 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6942 the definition of it to rpl_strftime also defined-away the system's
6945 2000-04-15 Jim Meyering <meyering@lucent.com>
6947 Use `C' to denote so-called `contiguous' files, the same way
6949 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6950 (ftypelet): Use S_ISCTG.
6951 From Michael Deutschmann.
6953 2000-04-14 Jim Meyering <meyering@lucent.com>
6955 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6957 2000-04-08 Jim Meyering <meyering@lucent.com>
6959 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6960 names don't conflict. Reported by Eli Zaretskii.
6962 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6964 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6965 bug. Deal with the different error behavior of Irix iconv.
6967 2000-04-07 Jim Meyering <meyering@lucent.com>
6969 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6970 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6972 2000-04-05 Jim Meyering <meyering@lucent.com>
6974 Portability tweaks required for ultrix4.3.
6975 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6976 * readutmp.c: Include sys/types.h before sys/stat.h.
6977 * canon-host.c: Declare strdup.
6978 * path-concat.c: Likewise.
6979 From John David Anglin.
6981 2000-04-04 Jim Meyering <meyering@lucent.com>
6983 Be more DOS 8.3-friendly.
6984 * ref-add.sin: Renamed from ref-add.sed.in.
6985 * ref-del.sin: Renamed from ref-del.sed.in.
6986 * Makefile.am: Reflect renaming.
6987 Reported by Eli Zaretskii.
6989 Use a temporary file name that won't clash with `charset.alias'
6990 in the DOS 8.3 name space.
6991 * Makefile.am (charset_tmp): Define.
6992 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6993 (uninstall-local): Likewise.
6994 Reported by Eli Zaretskii.
6996 2000-03-29 Paul Eggert <eggert@twinsun.com>
6998 * time/strftime.c (my_strftime): Make sure we call the system
6999 strftime, not ourselves, when invoking the underlying strftime.
7001 2000-03-24 Jim Meyering <meyering@lucent.com>
7003 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
7004 (charset_alias): Define.
7005 (install-exec-local): Factor out common code.
7006 (uninstall-local): Split lines longer than 80.
7007 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
7009 (.sed.in.sed): New rule. Don't redirect directly to $@.
7010 (CLEANFILES): Add ref-add.sed and ref-del.sed.
7012 2000-03-19 Bruno Haible <haible@clisp.cons.org>
7014 * config.charset: Output a line containing "Packages using this file".
7015 * ref-add.sed.in, ref-del.sed.in: New files.
7016 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
7017 ref-del.sed): New rules.
7019 2000-03-17 Jim Meyering <meyering@lucent.com>
7021 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
7022 Otherwise, include <strings.h>
7024 2000-03-17 Bruno Haible <haible@clisp.cons.org>
7026 * unicodeio.c (utf8_wctomb): New function.
7027 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
7028 format instead of in UCS-4 with platform dependent endianness.
7030 2000-03-07 Paul Eggert <eggert@twinsun.com>
7032 * savedir.c (savedir): Work even if directory size is
7033 negative; this can happen with some screwy NFS configurations.
7035 2000-03-06 Jim Meyering <meyering@lucent.com>
7037 * localcharset.c (get_charset_aliases): Don't try to free file_name
7038 if it's NULL (because we ran out of memory). From Bruno Haible.
7040 2000-03-05 Jim Meyering <meyering@lucent.com>
7042 * localcharset.c ("path-concat.h"): Include.
7043 (get_charset_aliases): Use path_concat instead of ANSI string
7046 * unicodeio.h (PARAMS): Define.
7047 Use it to guard prototype.
7049 2000-03-04 Jim Meyering <meyering@lucent.com>
7051 * Makefile.am (install-exec-local): Create $(libdir) before installing
7053 (uninstall-local): Uncomment this rule so `make distcheck' works
7056 * unicodeio.c (<errno.h>): Include it.
7057 (errno): Declare if not defined.
7059 * localcharset.c: Add Bruno's comment justifying use of volatile.
7061 * config.charset: New version, incorporating remarks from a linux
7062 i18n mailing list. From Bruno Haible.
7064 2000-03-02 Jim Meyering <meyering@lucent.com>
7066 * Makefile.am (EXTRA_DIST): Add config.charset.
7068 2000-03-01 Jim Meyering <meyering@lucent.com>
7070 * localcharset.c: Guard some #includes with `#if HAVE_...'.
7071 * unicodeio.c: Likewise.
7073 2000-02-02 Bruno Haible <haible@clisp.cons.org>
7075 * config.charset: New file.
7076 * localcharset.c: New file.
7077 * unicodeio.h, unicodeio.c: New files.
7078 * Makefile.am (DEFS): Add -DLIBDIR=...
7079 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
7080 (noinst_HEADERS): Add unicodeio.h.
7081 (all-local, install-exec-local, charset.alias): New targets.
7083 2000-02-28 Paul Eggert <eggert@twinsun.com>
7085 * quotearg.c (ALERT_CHAR): New macro.
7086 (quotearg_buffer_restyled): Use it.
7088 2000-02-27 Jim Meyering <meyering@lucent.com>
7090 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
7091 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
7093 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
7094 not `#if STDC_HEADERS'.
7095 Declare malloc if needed.
7097 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
7098 now that autoconf always defines the HAVE_DECL_ symbols.
7099 * human.c: Likewise.
7101 * strtoumax.c: Likewise.
7103 * backupfile.c: Arrange for cpp to fail if the configure-time
7104 declaration check was not run.
7106 * human.c: Likewise.
7108 * strtoumax.c: Likewise.
7110 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
7111 then first look up the entire `.'-containing string as a login name.
7113 2000-02-18 Paul Eggert <eggert@twinsun.com>
7115 * getdate.y: Handle two-digit years with leading zeros correctly.
7116 (textint): New typedef.
7117 (parser_control): Member year changed from int to textint.
7119 (YYSTYPE): Removed; replaced by %union with int and textint members.
7120 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
7121 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
7122 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
7123 (tSNUMBER, tUNUMBER): Now of type <textintval>.
7124 (date, number, to_year): Use width of number in digits, not its value,
7125 to determine whether it's a 2-digit year, or a 2-digit time.
7126 (yylex): Store number of digits of numeric tokens.
7127 Reported by John Kendall.
7129 (parser_control): Changed from struct parser_control to typedef (for
7130 consistency). All uses changed.
7132 (tID): Removed; not used.
7133 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
7135 2000-02-14 Paul Eggert <eggert@twinsun.com>
7137 * getpagesize.h (getpagesize): Port to VMS for Alpha;
7138 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
7140 2000-02-12 Jim Meyering <meyering@lucent.com>
7142 * userspec.c (ISDIGIT): Define it.
7143 (isdigit): Remove definition.
7144 (is_number): Use ISDIGIT, not isdigit.
7145 <libintl.h>: Include.
7147 (parse_user_spec): Mark translatable strings.
7149 2000-02-10 Jim Meyering <meyering@lucent.com>
7151 With these changes, nanosleep.[ch] are finally enough like the other
7152 lib/* replacement files to compile on a few more losing systems.
7154 * nanosleep.h: Don't include config.h.
7155 Remove prototype from declaration of nanosleep.
7156 (PARAMS): Remove now-unneeded definition.
7157 * nanosleep.c: #undef nanosleep.
7158 (rpl_nanosleep): Rename from nanosleep.
7160 2000-02-03 Jim Meyering <meyering@lucent.com>
7162 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
7163 rather than with `#if HAVE_UTMPNAME'.
7165 2000-02-01 Jim Meyering <meyering@lucent.com>
7167 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
7169 2000-01-31 Jim Meyering <meyering@lucent.com>
7171 * nanosleep.h (nanosleep): Guard declaration with
7172 `#if ! HAVE_DECL_NANOSLEEP'.
7173 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
7174 the declaration in that vendor's sys/timers.h.
7175 Reported by Christian Krackowizer.
7177 * quotearg.c (ISASCII): Add #undef and move definition to follow
7178 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
7179 (ISPRINT): Likewise.
7180 Reported by Tom Tromey.
7182 2000-01-30 Jim Meyering <meyering@lucent.com>
7184 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
7185 uses of ->ut_name. The latter doesn't work with new Linux header files
7186 where only utmpx.ut_user is declared.
7188 * readutmp.h (UT_USER): Define.
7190 2000-01-23 Jim Meyering <meyering@lucent.com>
7192 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
7195 2000-01-22 Jim Meyering <meyering@lucent.com>
7197 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
7198 [! HAVE_DECL_STRTOULL]: Declare strtoull.
7199 Required for some AIX systems. Reported by Christian Krackowizer.
7200 [TESTING] (main): New function.
7202 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
7203 * dirname.c (dir_name): Support for DOS-style file names with drive
7206 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
7208 * strverscmp.c (ISDIGIT): Define.
7209 (strverscmp): Use ISDIGIT, not isdigit.
7211 2000-01-17 Paul Eggert <eggert@twinsun.com>
7213 * nanosleep.c (nanosleep):
7214 Don't use SA_INTERRUPT to decide whether to call sigaction, as
7215 POSIX.1 doesn't require SA_INTERRUPT and some systems
7216 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
7217 it's been part of POSIX.1 since day 1 (in 1988).
7219 2000-01-17 Jim Meyering <meyering@lucent.com>
7221 * interlock: Remove unused file. Reported by François Pinard.
7223 2000-01-16 Paul Eggert <eggert@twinsun.com>
7225 * quotearg.c (quotearg_buffer_restyled): Do not quote
7226 alert, backslash, formfeed, and vertical tab unnecessarily in
7227 shell quoting style.
7230 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
7231 Free Software Foundation, Inc.
7232 Copying and distribution of this file, with or without modification,
7233 are permitted provided the copyright notice and this notice are preserved.