]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Just skip entries where --strip-components removes everything.
authorTim Kientzle <kientzle@gmail.com>
Thu, 8 May 2008 20:48:01 +0000 (16:48 -0400)
committerTim Kientzle <kientzle@gmail.com>
Thu, 8 May 2008 20:48:01 +0000 (16:48 -0400)
Previously, this was failing for dir entries that had exactly
the right number of components, e.g. "a/" with --strip-components=1,
leading to odd warnings about "Invalid empty pathname"
PR: bin/121158

SVN-Revision: 37

tar/util.c

index 68ff8d8f5e35958d9abcef058408a9341e032a40..a539b288513e0a95986dba33b8e15a9cdb0dc14f 100644 (file)
@@ -368,6 +368,10 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
                                return (1);
                        }
                }
+               while (*name == '/')
+                       ++name;
+               if (*name == '\0')
+                       return (1);
        }
 
        /* Strip redundant leading '/' characters. */