Commit Graph

604 Commits

Author SHA1 Message Date
Paul Eggert
f0fccfdb5d Merge changes from fileutils. 2000-10-28 14:54:13 +00:00
Paul Eggert
8d37615dc4 (namelist_match): New function.
(name_match, name_scan): Use it, to eliminate duplicate code.
(names_notfound): Remove special case for Amiga.
2000-10-28 12:42:45 +00:00
Paul Eggert
7abb9b854d (flush_read): If read_full_records_option, try to fill the input buffer,
as --delete -f - needs this.
2000-10-28 05:54:42 +00:00
Paul Eggert
d2f18d9ecb (decode_options): Check that volume label is not too long to overflow
name in tar header block.
2000-10-25 05:21:06 +00:00
Paul Eggert
29c1020f91 (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.
2000-10-25 05:21:06 +00:00
Paul Eggert
31acaa13bf (EXTRA_DIST): Add strerror_r.m4. 2000-10-25 05:21:06 +00:00
Paul Eggert
22596ef599 Include <time.h>, since we invoke "time". 2000-10-24 06:37:55 +00:00
Paul Eggert
614f749ff7 (prepend_default_options): Don't use NULL, for portability. 2000-10-24 06:34:45 +00:00
Paul Eggert
9645edc0ba Add "working" to message. 2000-10-24 06:32:34 +00:00
Paul Eggert
f566b8f147 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.
2000-10-24 06:18:37 +00:00
Paul Eggert
e7d0a7724b Initial revision 2000-10-24 06:18:37 +00:00
Paul Eggert
f326d78fda Include localedir.h.
(main): Update copyright date to 2000.
2000-10-24 06:18:37 +00:00
Paul Eggert
caf6047e1e 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.
2000-10-24 06:18:37 +00:00
Paul Eggert
8111f9d34d 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.
2000-10-24 06:18:37 +00:00
Paul Eggert
e0fe240d7c Fix comments. 2000-10-24 06:18:37 +00:00
Paul Eggert
ae2b051832 Add Free Documentation License. New section
"Overwrite Old Files", and revamp that section to make it easier to
follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
documentation into getdate.texi.  Fix several minor typos.  Describe
TAR_OPTIONS.  Describe incompatibility between incremental backups and
--atime-preserve.  Describe incompatibility between --verify and other
options.  Mention that tar normally removes symbolic links rather than
following them, when extracting a file of the same name.
2000-10-24 06:18:37 +00:00
Paul Eggert
e89bcb7fb3 (we_are_root): Now global.
(struct delayed_symlink): New type.
(delayed_symlink_head): New var.
(extr_init, fatal_exit):
Invoke extract_finish on fatal errors, not apply_delayed_set_stat.
(set_mode, set_stat): Pointer args are now const pointers.
(check_time): New function.
(set_stat): Warn if setting a file's timestamp to be the future.
(make_directories): Do not save and restore errno.
(maybe_recoverable): Set errno to ENOENT if we cannot make missing
intermediate directories.
(extract_archive):
Invoke apply_nonancestor_delayed_set_stat here, not in caller.
Extract potentially dangerous symbolic links more carefully, deferring their
creation until the end, and using a regular file placeholder in the meantime.
Do not remove trailing / and /. from file names.
Do not bother checking for ".." when checking whether a directory
loops back on itself, as loopbacks can occur with symlinks too.
Also, in that case, do not bother saving and restoring errno; just
set it to EEXIST.
(apply_nonancestor_delayed_set_stat): A prefix is a potential ancestor if
it ends in slash too (as well as ending in a char just before slash).
(apply_delayed_set_stat): Remove.
(apply_delayed_symlinks, extract_finish): New functions.
2000-10-24 06:18:37 +00:00
Paul Eggert
2f04b655d8 (update_archive): Use skip_member. 2000-10-24 06:18:37 +00:00
Paul Eggert
bc8d000b64 (read_and):
Do not invoke apply_nonancestor_delayed_set_stat;
DO_SOMETHING is now responsible for that.
Do not invoke apply_delayed_set_stat; our caller is now responsible for that.
(read_header): Use signed char instead of signed_char.
Prevent later references to current_header from
mistakenly treating it as an old GNU header.
(from_header): Quote invalid base-64 strings in diagnostics.
(time_from_header): Do not warn about future timestamps in archive;
check_time now does that.
(tartime): Fix off-by-one error when copying year if OLD_CTIME.
(print_header): Quote unknown file types.
(skip_member): New function, replacing skip_extended_headers and
now skipping the whole member instead of just the extended headers.
All callers changed.  This makes the code handle extended headers
uniformly, and fixes some bugs.
2000-10-24 06:18:37 +00:00
Paul Eggert
5156a90a1e (full_write): Some buggy drivers return 0 when you
fall off a device's end.  Detect this.
2000-10-24 06:18:37 +00:00
Paul Eggert
8d8a85f9a2 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
2000-10-24 06:18:37 +00:00
Paul Eggert
8a098729c0 (extract_mangle): Fix diagnostic with wrong number of %s'es. 2000-10-24 06:18:37 +00:00
Paul Eggert
257a4160e4 (base_name): Do not include basename.h; declare base_name
instead.
(rexec): Don't declare unless using it.
(do_command): Simplify signal-handling code slightly.
2000-10-24 06:18:37 +00:00
Paul Eggert
4dcebd9655 (_GNU_SOURCE): Remove; autoconf now does this.
(child_open_for_compress, child_open_for_uncompress, close_archive):
Propagate any failure of the compression process back to "tar".
(open_archive, flush_write, flush_read, close_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.
(open_archive): Don't bother checking S_ISCHR of /dev/null.
(backspace_output): Don't try to backspace past start of archive.
(close_archive): Remove special case for DELETE_SUBCOMMAND.
2000-10-24 06:18:37 +00:00
Paul Eggert
8c308d8315 (EXTRA_DIST): Add decl.m4, error.m4, mbstate_t.m4, prereq.m4.
Remove signedchar.m4.
2000-10-24 06:18:37 +00:00
Paul Eggert
a6f11d4092 (AC_FUNC_MATCH): Detect d*/*1 vs d/s/1 bug. 2000-10-24 06:18:37 +00:00
Paul Eggert
85e724550f (_GNU_SOURCE): Remove; autoconf now does this.
Include <hash.h>.
(getpwuid, getgrgid): Declare only if system headers don't.
(gid_to_gname): Don't invoke setgrent.
(namelist): Now static, not global.
(nametail): New var.  All uses of namelast changed to use nametail,
with one extra level of indirection.
(name_gather): Use memcpy instead of strncpy + assignment of NUL.
(name_match): Set nametail too, when setting namelist to null.
(add_hierarchy_to_namelist): Change type of dir arg from char * to
struct name *, so that we don't have to look up the name again here.
Get change_dir from dir rather than as a separate arg.  Add dirsize arg,
and pass it along to get_directory_contents.  Remove unnecessary check
of directory type.
(new_name): Do not append a slash if PATH already ends in one.
(avoided_names, struct avoided_name): Remove.
(avoided_name_table): New var, replacing avoided_names.
(hash_avoided_name, compare_avoided_names): New function.
(add_avoided_name, is_avoided_name): Use hash table rather than linked list.
2000-10-24 06:18:37 +00:00
Paul Eggert
b20005e951 Mention the GNU C library. 2000-10-20 17:33:17 +00:00
Paul Eggert
2473f7fad6 Add a couple more test cases to catch bugs in glibc 2.1.95. 2000-10-20 05:27:04 +00:00
Paul Eggert
8caec82653 (<limits.h>): Include if HAVE_LIMITS_H.
(CHAR_BIT): Define if not defined.
2000-10-17 17:20:55 +00:00
Paul Eggert
9d290bf45e (<limits.h>): Do not include; human.h does it if needed.
(CHAR_BIT): Remove.
2000-10-17 17:20:55 +00:00
Paul Eggert
5ed9bdbf57 Initial revision 2000-09-09 15:57:28 +00:00
Paul Eggert
c86c626f04 Memory exhausted -> memory exhausted 2000-08-07 16:46:16 +00:00
Paul Eggert
9a742c498f (xalloc_msg_memory_exhausted): change to array from char *. 2000-08-07 16:02:21 +00:00
Paul Eggert
54278395ab Define mbstate_t to be int, not char, for compatibility with glibc
2.1.3 strftime.c.
2000-08-07 04:27:00 +00:00
Paul Eggert
1063141801 Simplify exhausted message. 2000-07-15 05:53:00 +00:00
Paul Eggert
cf4b8601b4 (AC_MBSTATE_T): Renamed from AC_MBSTATE_T_OBJECT. All uses changed.
Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
and mbstate_t, to a single-part test that simply defines mbstate_t.
2000-07-11 03:55:28 +00:00
Paul Eggert
f03a9c9335 fileutils 4.0x 2000-07-09 07:25:03 +00:00
Paul Eggert
a70cec699f Initial revision 2000-07-09 07:25:03 +00:00
Paul Eggert
12d0cc62bb (AC_MBSTATE_T_OBJECT): Test for mbstate_t only if the test
for an object-type mbstate_t fails.
2000-07-05 18:41:17 +00:00
Paul Eggert
73266a46f3 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
2000-07-03 22:04:18 +00:00
Paul Eggert
865e5f3295 textutils 2.0f 2000-07-02 20:04:14 +00:00
Paul Eggert
f996454418 (<unistd.h>): Do not include; there's no need.
(NAMLEN): Remove macro.
(malloc, realloc): Remove decls.
(stpcpy): Likewise.
("xalloc.h"): Include.
(NAME_SIZE_DEFAULT): New macro.
(savedir): Use xmalloc / xrealloc to allocate memory.
Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
Skip "" directory entries.
Use strlen to calculate directory entry length, since the old method
is rarely used these days and isn't worth supporting.
Check for integer overflow when calculating allocation size.
Use memcpy to copy entries, instead of stpcpy.
Set errno properly when returning NULL.
Check for readdir error.
2000-06-26 23:25:37 +00:00
Paul Eggert
ee21d9f1e3 Include stdio.h before wchar.h, to work around a bug
in glibc 2.1.3.
2000-06-26 18:53:06 +00:00
Paul Eggert
b0a7ff33fd Fix inaccorate comment for xrealloc. 2000-06-26 18:46:37 +00:00
Paul Eggert
c61d0787ce (adjust_value): New function.
(human_readable_inexact): Apply rounding style even when printing
approximate values.
2000-06-15 18:11:13 +00:00
Paul Eggert
c9dfa7a7e8 Avoid shadowing warnings.
From: Jim Meyering <meyering@ascend.com>
Date: 15 Jun 2000 14:40:00 +0200
2000-06-15 15:47:43 +00:00
Paul Eggert
bff9056e88 White space changes, to match fileutils. 2000-06-15 12:51:56 +00:00
Paul Eggert
e1c9c92abd (human_readable_inexact): Allow an input block size that is not a
multiple of the output block size, and vice versa.
2000-06-15 01:40:09 +00:00
Paul Eggert
44579f77cf (get_date): Apply relative times after time zone indicator, not
before.
2000-06-14 17:57:26 +00:00