X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Flist.c;h=2eba9f651fb8a650db9a43d511c414b938a72169;hb=8be2b02752f5c3f3181b90c667fe08ffb87fb93b;hp=c5fd5f4b2970b423abfb52594ee9ce35531b9464;hpb=241bbee81b2136a216dab74ab1322ae6dd07555f;p=chaz%2Ftar diff --git a/src/list.c b/src/list.c index c5fd5f4..2eba9f6 100644 --- a/src/list.c +++ b/src/list.c @@ -28,6 +28,10 @@ ((unsigned char) (Char) >= '0' && (unsigned char) (Char) <= '7') #define ISSPACE(Char) (ISASCII (Char) && isspace (Char)) +#ifndef FNM_LEADING_DIR +# include +#endif + #include "common.h" union block *current_header; /* points to current archive header */ @@ -62,6 +66,12 @@ read_and (void (*do_something) ()) /* Valid header. We should decode next field (mode) first. Ensure incoming names are null terminated. */ + if (ending_file_option && + fnmatch (ending_file_option, current_file_name, + FNM_LEADING_DIR) == 0) { + goto all_done; + } + /* FIXME: This is a quick kludge before 1.12 goes out. */ current_stat.st_mtime = TIME_FROM_OCT (current_header->header.mtime); @@ -164,6 +174,7 @@ read_and (void (*do_something) ()) } break; } + all_done: ; apply_delayed_set_stat (); close_archive ();