]> Dogcows Code - chaz/tar/commitdiff
(extract_archive): Implemented --strip-path
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 4 Sep 2003 15:44:44 +0000 (15:44 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 4 Sep 2003 15:44:44 +0000 (15:44 +0000)
src/extract.c

index d6af621c4307cf37130fef21838efc99a3183a32..d7aba0d95bad075c08e8f61b3d95af7af997b92e 100644 (file)
@@ -717,7 +717,16 @@ extract_archive (void)
     print_header (-1);
 
   file_name = safer_name_suffix (current_stat_info.file_name, 0);
-
+  if (strip_path_elements)
+    {
+      file_name = cut_path_elements (file_name, strip_path_elements);
+      if (!file_name)
+       {
+         skip_member ();
+         return;
+       }
+    }
+  
   apply_nonancestor_delayed_set_stat (file_name, 0);
 
   /* Take a safety backup of a previously existing file.  */
This page took 0.024185 seconds and 4 git commands to generate.