]> git.ipfire.org Git - pakfire.git/commitdiff
archive: Change how we search for realtive paths in archives
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Oct 2023 14:55:19 +0000 (14:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Oct 2023 14:55:19 +0000 (14:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/archive.c

index 1dfbdefde5f7b0313c2d2bb162cbaadb79250d97..68c6d4d512bb5e21d33fefe76f8a7bdddae32025 100644 (file)
@@ -622,7 +622,7 @@ static int __pakfire_archive_read_filter(struct pakfire* pakfire, struct archive
                return PAKFIRE_WALK_ERROR;
 
        // We found a match
-       if (strcmp(cookie->path, p) == 0)
+       if (strcmp(cookie->path + 1, p) == 0)
                return PAKFIRE_WALK_DONE;
 
        // Otherwise we skip the file
@@ -654,11 +654,6 @@ PAKFIRE_EXPORT FILE* pakfire_archive_read(struct pakfire_archive* archive, const
                return NULL;
        }
 
-       // Strip leading / from filenames, because tarballs don't use any leading slashes
-       path = pakfire_path_relpath("/", path);
-       if (!path)
-               return NULL;
-
        // Allocate a cookie
        cookie = calloc(1, sizeof(*cookie));
        if (!cookie) {