diff -ruN tar-1.13.25-orig/src/names.c tar-1.13.25/src/names.c --- tar-1.13.25-orig/src/names.c Wed Aug 29 14:33:54 2001 +++ tar-1.13.25/src/names.c Sat Apr 19 21:12:11 2003 @@ -531,7 +531,8 @@ if (p->regexp ? fnmatch (p->name, path, recursion_option) == 0 : (p->length <= length - && (path[p->length] == '\0' || ISSLASH (path[p->length])) + && (path[p->length] == '\0' || ISSLASH (path[p->length]) && + (recursion_option || path[p->length + 1] == '\0')) && memcmp (path, p->name, p->length) == 0)) return p; }