From: Sergey Poznyakoff Date: Thu, 4 Sep 2003 15:44:44 +0000 (+0000) Subject: (extract_archive): Implemented --strip-path X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=ddab1f615ee03a8125614af124567c8271dcc1b2;p=chaz%2Ftar (extract_archive): Implemented --strip-path --- diff --git a/src/extract.c b/src/extract.c index d6af621..d7aba0d 100644 --- a/src/extract.c +++ b/src/extract.c @@ -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. */