Fix --test-label' and --label -r' behavior.

* doc/tar.texi (Including a Label in the Archive): Revise
the section.
* NEWS: Update

* src/buffer.c (open_archive): Check volume label on
ACCESS_UPDATE as well.
* src/list.c (test_archive_label): Rewrite to match the
documentation.
* src/names.c (regex_usage_warning): Return int.
(names_notfound): Rewrite the conditional.
(label_notfound): New function.

* tests/label03.at: New testcase.
* tests/label04.at: New testcase.
* tests/label05.at: New testcase.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at: Likewise.
This commit is contained in:
Sergey Poznyakoff
2010-03-11 17:41:23 +02:00
parent 8d3cc6c3cf
commit 0ba8bdf5f3
10 changed files with 329 additions and 47 deletions
+1 -3
View File
@@ -1841,6 +1841,7 @@ open_archive (enum access_mode wanted_access)
switch (wanted_access)
{
case ACCESS_READ:
case ACCESS_UPDATE:
if (volume_label_option)
match_volume_label ();
break;
@@ -1850,9 +1851,6 @@ open_archive (enum access_mode wanted_access)
if (volume_label_option)
write_volume_label ();
break;
default:
break;
}
set_volume_start_time ();
}