X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fnames.c;h=6fc5ee5105ba68d0ceadde88b1391fa33bbeb516;hb=64cca92a1fbbda5e72887aa455e1a33a4106b8c3;hp=a8a03bb6434df6945826a78aab8474eab1f828a3;hpb=91493ea9b62a24ab139eedd4c919e4fcda9750c3;p=chaz%2Ftar diff --git a/src/names.c b/src/names.c index a8a03bb..6fc5ee5 100644 --- a/src/names.c +++ b/src/names.c @@ -20,9 +20,7 @@ #include "system.h" #include -#include #include -#include #include #include "common.h" @@ -610,9 +608,11 @@ bool all_names_found (struct tar_stat_info *p) { struct name const *cursor; - size_t len = strlen (p->file_name); - if (occurrence_option == 0 || p->had_trailing_slash) + size_t len; + + if (!p->file_name || occurrence_option == 0 || p->had_trailing_slash) return false; + len = strlen (p->file_name); for (cursor = namelist; cursor; cursor = cursor->next) { if (cursor->regexp @@ -636,7 +636,7 @@ names_notfound (void) ERROR ((0, 0, _("%s: Not found in archive"), quotearg_colon (cursor->name))); else - ERROR ((0, 0, _("%s: Required occurence not found in archive"), + ERROR ((0, 0, _("%s: Required occurrence not found in archive"), quotearg_colon (cursor->name))); } @@ -833,10 +833,7 @@ collect_and_sort_names (void) if (deref_stat (dereference_option, name->name, &statbuf) != 0) { - if (ignore_failed_read_option) - stat_warn (name->name); - else - stat_error (name->name); + stat_diag (name->name); continue; } if (S_ISDIR (statbuf.st_mode)) @@ -1024,9 +1021,9 @@ safer_name_suffix (char const *file_name, bool link_target) for (p = file_name + prefix_len; *p; ) { - if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2])) + if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2])) prefix_len = p + 2 - file_name; - + do { char c = *p++; @@ -1070,7 +1067,7 @@ safer_name_suffix (char const *file_name, bool link_target) }; WARN ((0, 0, _(diagnostic[link_target]))); } - + p = "."; }