]> Dogcows Code - chaz/tar/blobdiff - src/list.c
Fix `--test-label' and `--label -r' behavior.
[chaz/tar] / src / list.c
index 716c0b4230a3e50c07dc7ec98afbf6d6aa56381f..0474fb1e5ad40a02cab4f5c76f076ed7e1e9ffc3 100644 (file)
@@ -1412,22 +1412,23 @@ test_archive_label ()
   if (read_header (&current_header, &current_stat_info, read_header_auto)
       == HEADER_SUCCESS)
     {
-      char *s = NULL;
-       
       decode_header (current_header,
                     &current_stat_info, &current_format, 0);
       if (current_header->header.typeflag == GNUTYPE_VOLHDR)
        assign_string (&volume_label, current_header->header.name);
-
-      if (volume_label
-         && (name_match (volume_label)
-             || (multi_volume_option
-                 && (s = drop_volume_label_suffix (volume_label))
-                 && name_match (s))))
-       if (verbose_option)
-         print_volume_label ();
-      free (s);
+      
+      if (volume_label)
+       {
+         if (verbose_option)
+           print_volume_label ();
+         if (!name_match (volume_label) && multi_volume_option)
+           {
+             char *s = drop_volume_label_suffix (volume_label);
+             name_match (s);
+             free (s);
+           }
+       }
     }
   close_archive ();
-  names_notfound ();
+  label_notfound ();
 }
This page took 0.020075 seconds and 4 git commands to generate.