From: Sergey Poznyakoff Date: Thu, 13 Nov 2003 22:27:23 +0000 (+0000) Subject: (safer_name_suffix): Skip leading ./ X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=052118a907a138fc6d9189470ed05a9eb32f8fe9;p=chaz%2Ftar (safer_name_suffix): Skip leading ./ --- diff --git a/src/names.c b/src/names.c index 951a967..66648a0 100644 --- a/src/names.c +++ b/src/names.c @@ -1026,7 +1026,9 @@ safer_name_suffix (char const *file_name, bool link_target) { if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2])) prefix_len = p + 2 - file_name; - + else if (p[0] == '.' && ISSLASH (p[1])) + prefix_len = p + 1 - file_name; + do { char c = *p++;