Paul Eggert [Thu, 8 Jul 1999 03:45:21 +0000 (03:45 +0000)]
(read_and): Use excluded_filename instead of check_exclude.
Check base name of incoming file name, not entire file name, when
deciding whether to exclude it.
Paul Eggert [Sat, 3 Jul 1999 00:00:19 +0000 (00:00 +0000)]
Include signal.h.
(SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
(main): Ensure SIGCHLD is not ignored, so that we can fork and wait.
Paul Eggert [Fri, 2 Jul 1999 21:33:51 +0000 (21:33 +0000)]
(BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES, OBSOLETE_BLOCK_COMPRESS,
OBSOLETE_BLOCKING_FACTOR, OBSOLETE_BLOCK_NUMBER,
OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH, OBSOLETE_VERSION_CONTROL):
Make sure they can't be valid chars, so they don't overlap with char codes.
Use an enum instead of a lot of #defines.
(long_options, main, usage): Remove --ending-file option.
(OPTION_STRING): Remove -E.
Paul Eggert [Fri, 2 Jul 1999 21:25:09 +0000 (21:25 +0000)]
Don't include <ctype.h>; system.h already does this.
(ISODIGIT, ISSPACE): Remove; now in system.h.
(read_and): Excise ending_file_option.
(decode_header): No need to AND mode with 07777; MODE_FROM_OCT
does this now.
(from_oct): Cast ISSPACE arg to unsigned char.
(mode_from_oct): Translate modes from external to internal form.
Do not complain about unrecognized mode bits.
(decode_mode): Do not assume mode bits have traditional Unix values.
Paul Eggert [Fri, 2 Jul 1999 21:25:09 +0000 (21:25 +0000)]
(extr_init, make_directories, extract_archive):
Do not assume mode bits have traditional Unix values.
(set_mode): Use %04 not %0.4 format.
(extract_sparse_file): Do not use data_block uninitialized.
Check for lseek failures; use portable lseek whence values.
Paul Eggert [Fri, 2 Jul 1999 21:05:50 +0000 (21:05 +0000)]
(mode_to_oct): Do not assume internal mode_t and external octal modes
have the same bit patterns.
(start_header): Do not assume mode bits have traditional Unix values.
(finish_sparse_file): Use lseek whence macros instead of integers.
(dump_file): Do not assume mode bits have traditional Unix values.
Do not invoke finish_sparse_file on a negative file descriptor.
Paul Eggert [Fri, 25 Jun 1999 23:28:08 +0000 (23:28 +0000)]
(write_archive_buffer): New function.
(child_open_for_compress, flush_write, flush_read): Use it to write
buffers.
(open_archive): Report error if fstat of archive fails.
Improve efficiency of check for /dev/null.
Also, fix some corner cases with remote archives and /dev/null checking.
(close_archive): Test for input fifo only if not remote.
Truncate output archive only if it's not remote.
Paul Eggert [Sat, 19 Jun 1999 06:19:27 +0000 (06:19 +0000)]
(to_oct): Prepend leading zeros, not spaces.
Output a trailing NUL unless the value won't fit without it;
this is backward compatible with Unix tar (and with GNU Emacs).
(finish_header): No need to append NUL to chksum, now that
to_oct is doing it.
Paul Eggert [Wed, 16 Jun 1999 11:14:15 +0000 (11:14 +0000)]
(backup_type): Remove decl; backupfile.h now has it.
(intconv): Remove; use xstrto* fns instead.
("xstrtol.h"): Include.
(check_decimal): Remove.
(long_options, usage, OPTION_STRING, decode_options):
Remove -y, --bzip2, --unbzip2.
(decode_options): Use xget_version instead of get_version.
Check for overflow with -b and -L and RECORD_SIZE_OPTION.
Replace invocations of check_decimal with xstrtoumax.
Paul Eggert [Mon, 22 Mar 1999 22:06:22 +0000 (22:06 +0000)]
Include <quotearg.h>.
(from_oct): Add forward decl.
(read_header): Return HEADER_FAILURE if we can't parse the checksum.
(from_oct): Report an error only if TYPE is nonzero.
Quote any funny characters in bad header.
Paul Eggert [Tue, 2 Mar 1999 00:10:11 +0000 (00:10 +0000)]
(to_oct): New parameter substitute, giving a substitute value to use
when the original value is out of range. Do not append a space to the
output; modern tars don't. When a value is out of range, specify the
maximum value, not the number of bits.
(GID_NOBODY, UID_NOBODY): New macros.
(gid_to_oct, uid_to_oct): Use them as substitutes.
(finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
(dump_file): Check whether the file changed as we read it.
Paul Eggert [Tue, 2 Mar 1999 00:10:11 +0000 (00:10 +0000)]
(gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct, off_from_oct,
size_from_oct, time_from_oct, uid_from_oct, uintmax_from_oct):
Use TYPE_MAXIMUM instead of macros like OFF_MAX, which are not reliable
(e.g. OFF_MAX in AIX 4.2 is incorrect).
Paul Eggert [Wed, 27 Jan 1999 20:42:30 +0000 (20:42 +0000)]
(gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
size_to_oct, time_to_oct, uid_to_oct): Cast value to uintmax_t, for
benefit of pre-ANSI compilers with long long.
Paul Eggert [Wed, 27 Jan 1999 20:42:30 +0000 (20:42 +0000)]
(gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
off_from_oct, size_from_oct, time_from_oct, uid_from_oct):
Cast limit to uintmax_t, for
benefit of pre-ANSI compilers with long long.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(to_oct): Now static. Value arg is now uintmax_t. Accept new args
giving name of type of octal field, for error messages. Report an
error if the value is too large to fit in the field.
(gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
(write_eot, write_long, finish_header, deal_with_sparse,
finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
appropriate. Remove now-useless casts. Use unsigned long to print
*_t types, except use STRINGIFY_BIGINT for off_t.
(find_new_file_size): 1st arg is now off_t*.
(finish_sparse_file): Args now use off_t, not long.
Check for lseek error.
(create_archive, dump_file): Cast -1 to dev_t when necessary.
(dump_file): Device arg is now dev_t.
Avoid overflow when testing whether file has holes
by using the new ST_NBLOCKSIZE macro.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(record_start_block, save_totsize, save_sizeleft, real_s_totsize,
real_s_sizeleft, current_block_ordinal): Now off_t.
(write_error): Arg is now ssize_t.
(child_pid): Now pid_t.
(available_space_after): Now size_t.
(child_open_for_compress, child_open_for_uncompress, flush_write,
open_archive, flush_write, write_error, flush_read, close_archive):
Use pid_t, ssize_t, size_t when appropriate. Remove now-useless
casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
Paul Eggert [Fri, 31 Oct 1997 00:58:55 +0000 (00:58 +0000)]
(read_and, list_archive, read_header, decode_mode, print_header,
print_for_mkdir): Use mode_t, off_t, size_t when appropriate. Remove
now-useless casts. Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
(read_header): Check for overflow when converting header size.
(from_oct): Now static. Now returns uintmax_t. `where' arg is now
const char *. Size arg is now size_t. Now takes new type and maxval
args. Compute result using uintmax_t, not long. Report error if
field does not contain octal number in range.
(gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
uintmax_from_oct): New functions.
(stringify_uintmax_t_backwards): New function.
(decode_mode, print_for_mkdir): Mode arg is now mode_t.
(skip_file): Offset arg is now off_t.