Fix semantics of -K used together with explicit member names.

This also fixes the bug reported in
  http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00012.html

* src/common.h (starting_file_option): Describe the variable.
* src/names.c (add_starting_file): New function.
(name_match): Ignore everything before the member indicated by the
--starting-file option
* src/tar.c: Use add_starting_file to handle the -K option.
This commit is contained in:
Sergey Poznyakoff
2018-12-21 13:24:29 +02:00
parent 916fe62ae9
commit 983a82a376
4 changed files with 55 additions and 10 deletions

12
NEWS
View File

@@ -1,4 +1,4 @@
GNU tar NEWS - User visible changes. 2018-04-07
GNU tar NEWS - User visible changes. 2018-12-21
Please send GNU tar bug reports to <bug-tar@gnu.org>
@@ -15,6 +15,16 @@ recognized automatically.
When '-a' option is in effect, zstd compression is selected if the
destination archive name ends in '.zst' or '.tzst'.
* The -K option interacts properly with member names given in the command line
Names of members to extract can be specified along with the "-K NAME"
option. In this case, tar will extract NAME and those of named members
that appear in the archive after it, which is consistent with the
semantics of the option.
Previous versions of tar extracted NAME, those of named members that
appeared before it, and everything after it.
version 1.30 - Sergey Poznyakoff, 2017-12-17