mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-08-17 14:56:02 +00:00
Improve option sanity checking
Any two conflicting options are reported only if they both occur in the command line. Otherwise, options defined in the command line silently override those set in the TAR_OPTIONS environment variable. * src/common.h (option_source): New enum. (option_locus): New struct. * src/names.c (name_elt): New member: line. (name_add_file): Initialize line. (read_name_from_file): Keep track of input line number for diagnostic purposes. (handle_option): Take a pointer to struct name_elt as 2nd parameter; pass locus info to more_options(). * src/tar.c (tar_args): New member: loc. (option_class): New enum. (optloc_save,optloc_lookup) (option_set_in_cl,optloc_eq): New functions. (set_use_compress_program_option): Take into account option location. (set_old_files_option): New function. (parse_opt): Keep track of option locations. (more_options): Improve error reporting. (parse_default_options): New function. (decode_options): Parse TAR_OPTION and command line separately. Options from the latter silently override those from the former. * lib/prepargs.c: Remove. * lib/prepargs.h: Remove. * lib/Makefile.am: Update.
This commit is contained in:
@@ -41,7 +41,6 @@ noinst_HEADERS = \
|
||||
|
||||
libtar_a_SOURCES = \
|
||||
paxerror.c paxexit-status.c paxlib.h paxnames.c \
|
||||
prepargs.c prepargs.h \
|
||||
rtapelib.c \
|
||||
rmt.h \
|
||||
stdopen.c stdopen.h \
|
||||
|
||||
Reference in New Issue
Block a user