]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
dependencies: Fix parsing complex dependencies
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Feb 2023 12:56:07 +0000 (12:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Feb 2023 12:56:07 +0000 (12:56 +0000)
It is possible that a complex dependency has more than one closing
bracket. In that case, we will take too much of the string.

This patch makes sure we take the first bracket.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/dependencies.c

index 4084d01f7a21de4ddd9f04e4143321fb9702b394..9a2f3b52724d5984a40917310a74f71c77cdc464 100644 (file)
@@ -126,7 +126,7 @@ static Id pakfire_parse_namespace(Pool* pool, const char* s) {
        Id namespace = pool_strn2id(pool, s, p - s, 1);
 
        // Find the end of the string
-       s = strrchr(p, ')');
+       s = strchr(p, ')');
        if (!s)
                return 0;