Paul Eggert [Wed, 29 Aug 2001 21:37:27 +0000 (21:37 +0000)]
(delay_set_stat): Fix off-by-one error in file
name size allocation that caused core dumps.
From Jan.Djarv@mbox200.swipnet.se.
(extract_archive): Use strcpy, not memcpy,
for consistency with other code that does similar things.
Paul Eggert [Wed, 29 Aug 2001 06:36:20 +0000 (06:36 +0000)]
Fix copyright notice.
(UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
(verify): New macro.
(INT): Renamed from uintmax_t.
(strtoumax, strtoull, strtoul): Remove.
(strtoimax, strtol, strtoll): New macros.
(strtoimax): Renamed from strtoumax. Interchange signed with unsigned.
Verify sizes at compile-time, not at run-time.
Prefer strtol to strtoll if both work.
(main): Remove.
Paul Eggert [Wed, 29 Aug 2001 06:36:20 +0000 (06:36 +0000)]
(jm_AC_PREREQ_XSTRTOUMAX): Quote first arg of AC_DEFUN.
Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
is needed to parse the include file.
Simplify logic behind the args to AC_REPLACE.
Paul Eggert [Wed, 29 Aug 2001 06:36:20 +0000 (06:36 +0000)]
(jm_AC_PREREQ_XSTRTOIMAX):
Require jm_AC_TYPE_UINTMAX_T and jm_AC_TYPE_UNSIGNED_LONG_LONG since they
are needed to parse the include file.
Do not require jm_AC_HEADER_INTTYPES_H; it's obsolete.
Check for inttypes.h.
Simplify logic behind the args to AC_REPLACE.
Paul Eggert [Wed, 29 Aug 2001 06:36:20 +0000 (06:36 +0000)]
(jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
(jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
Use AC_CHECK_TYPE instead of merely looking for the header.
Paul Eggert [Wed, 29 Aug 2001 06:36:20 +0000 (06:36 +0000)]
("pathmax.h"): Do not include; no longer needed.
(<stdlib.h>, <unistd.h>): Include if available.
("xalloc.h"): Include.
(xmalloc, xstrdup, free): Remove decls; no longer needed.
(xgetcwd): Don't assume sizes fit in 'unsigned'.
Check for overflow when path size gets too large.
Simplify failure code.
Paul Eggert [Mon, 27 Aug 2001 14:32:51 +0000 (14:32 +0000)]
(from_header): Do not issue a diagnostic if TYPE is zero.
However, check for error even for '-' or '+' case.
(print_header): Try parsing uids and gids as unsigned integers first,
and as a uid_t or gid_t only if that fails. This adds support for
listing positive uids and gids that are greater than UID_MAX and
GID_MAX.
Paul Eggert [Mon, 27 Aug 2001 14:27:54 +0000 (14:27 +0000)]
(struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
Support hard links to symbolic links.
(struct delayed_symlink): Remove 'names' member, replacing it with
'sources' and 'target' member. All uses changed.
(struct string_list): New type.
(delayed_set_stat, extract_archive): Use offsetof when computing sizes
for struct hack; this avoids wasted space in some cases.
(extract_archive): Fix test for absolute pathnames and/or "..".
Use link_error to report errors for links.
Remove redundant trailing '/' at "really_dir", for all uses, not
just before invoking mkdir.
If overwriting old files, do not worry so much about existing directories.
Fix mode computation in the case where the directory exists.
(apply_delayed_symlinks): If we can't make a hard link to a symbolic
link, make a copy of the symbolic link.
Paul Eggert [Mon, 27 Aug 2001 00:02:27 +0000 (00:02 +0000)]
Put leading '*' in direntry.
Accommodate new gfdl sectioning.
New option --recursion (the default) that is the inverse of --no-recursion.
New options --anchored, --ignore-case, --wildcards,
--wildcards-match-slash, and their negations (e.g., --no-anchored).
Along with --recursion and --no-recursion, these control how exclude
patterns are interpreted. The default interpretation of exclude
patterns is now --no-anchored --no-ignore-case --recursion
--wildcards --wildcards-match-slash.
Paul Eggert [Sat, 13 Jan 2001 06:04:48 +0000 (06:04 +0000)]
Add @setchapternewpage odd.
Remove -I as an alias for -T, for now.
Add @dircategory.
Update copyright. Remove "Published by".
Dates beginning with / or . are taken to be file names.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(time): Do not declare.
(usage): Remove -I as an alias for -T>
(OPTION_STRING): Remove -I.
(decode_options): Dates that look like an absolute path name,
or that start with '.', are presumed to be file names whose
dates are taken.
Remove 'I' as an aliase for 'T'.
Update copyright.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(relativize): New function.
> (relativize): New function, with much of old start_header's guts.
Handle filesystem prefixes.
(start_header): Use this new function.
(init_sparsearray): Don't bother to zero out the new array; it's not needed.
(deal_with_sparse): Fix array allocation bug.
(create_archive): Don't assume '/' is the only separator.
(dump_file): Likewise.
Don't worry about leading / in symlink targets.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(name_next): Don't assume '/' is the only directory separator.
(namelist_match): Likewise.
(add_hierarchy_to_namelist): Remove dirsize arg.
Do not assume '/' is the only directory separator.
(new_name): Likewise.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(<time.h>): Do not include; system.h now does this.
(time): Remove decl; likewise.
(child_open_for_uncompress): Use new full_write semantics.
(flush_write): Use ISSLASH instead of testing for '/'.
(flush_read): Likewise.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(<time.h>): Do not include; system.h now does this.
(make_directories): Skip filesystem prefixes.
Don't assume '/' is the only separator.
(extract_sparse_file): Use new full_write semantics.
On write error, return instead of invoking skip_file.
Do not free sparsearray; caller does this now.
(apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
separator.
(extract_archive): Don't assume file name lengths fit in int.
Report what got stripped from member name; it might be more than '/'.
Use new full_write semantics.
Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
mkdir to ignore it.
Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
Paul Eggert [Sun, 29 Oct 2000 05:30:02 +0000 (05:30 +0000)]
(NO_RECURSE_OPTION): Remove.
(long_options): Have getopt set the --no-recursion flag.
(decode_options): Initialize recursion_option to FNM_LEADING_DIR.
Remove case for NO_RECURSE_OPTION.
Paul Eggert [Wed, 25 Oct 2000 05:21:06 +0000 (05:21 +0000)]
(check_label_pattern): Make sure header name is a string before
passing it to fnmatch.
(init_volume_number): Check for global_volno overflow.
(new_volume): Check for global_volno overflow.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
New file, taken from fileutils 4.0.27, with the
following changes: Use @sc where appropriate. Document the ranges of
supported times more precisely. Add Eggert to getdate authors.
Document old Latin 12m/12pm tradition. Remove list of alphabetic time
zone names, as it wasn't correct and people shouldn't be relying on it
anyway. Relative items also account for non-DST adjustments. Fix
some misspellings.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
Include localedir.h, prepargs.h.
(long_options): Now static.
(long_options, usage, decode_options): -j is now short for --bzip2,
and -I is now an alias for -T.
(decode_options, main): argv is not const pointer now.
(decode_options): Invoke prepend_default_options to support TAR_OPTIONS.
In diagnostic, mention the string that was the invalid blocking factor,
tape length, group, owner, or record size.
--delete is no longer incompatible with -f -, undoing 2000-01-07 change.
(main): Invoke extract_finish at end of extraction.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
Include hash.h.
(gnu_list_name): Remove decl.
(struct link): Remove "next" member.
(linklist): Remove.
(start_header): Say "leading `FOO'" rather than "`FOO' prefix" for consistency
with other diagnostics.
(deal_with_sparse): Check for I/O error when closing the file.
(create_archive):
Do not allocate an array of size PATH_MAX, as PATH_MAX might be (size_t) -1.
Instead, allocate an array with the size that's needed.
(hash_link, compare_links): New functions.
(dump_file): Do not exhaust open file descriptors when descending deeply
into a directory, by using savedir rather than opendir/readdir.
Do not zero-fill the name buffer unnecessarily.
Hash the set of links already created, instead of using a linked list.
Fix some bugs in outputting sparse files which caused the sparse tables
to be incorrect.
When a file unexpectedly shrinks, output zeros rather than garbage.
Do not allocate an array of size PATH_MAX, as PATH_MAX might be (size_t) -1.
Instead, allocate an array with the size that's needed.