]> git.ipfire.org Git - pakfire.git/commitdiff
dependencies: Consume any excess space
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Dec 2022 11:41:12 +0000 (11:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Dec 2022 11:41:12 +0000 (11:41 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/dependencies.c

index 4fa7b0f65be4b3e5d313c4df10434bf1a4b69eb8..332a87f3f8135c87dcbe3319c52beff2ec5e141e 100644 (file)
@@ -156,7 +156,7 @@ static Id pakfire_parse_dep(struct pakfire* pakfire, const char** s) {
        Pool* pool = pakfire_get_solv_pool(pakfire);
 
        // Consume any leading space
-       if (isspace(*p))
+       while (isspace(*p))
                p++;
 
        // Find the first part
@@ -169,7 +169,7 @@ static Id pakfire_parse_dep(struct pakfire* pakfire, const char** s) {
                id = pool_strn2id(pool, n, l, 1);
 
        // Consume any more space
-       if (isspace(*p))
+       while (isspace(*p))
                p++;
 
        if (*p == '<' || *p == '=' || *p == '>') {
@@ -189,7 +189,7 @@ static Id pakfire_parse_dep(struct pakfire* pakfire, const char** s) {
                }
 
                // Consume any more space
-               if (isspace(*p))
+               while (isspace(*p))
                        p++;
 
                // Find the length of EVR
@@ -206,6 +206,10 @@ static Id pakfire_parse_dep(struct pakfire* pakfire, const char** s) {
                id = pool_rel2id(pool, id, evr, flags, 1);
        }
 
+       // Consume any more space
+       while (isspace(*p))
+               p++;
+
        *s = p;
 
        return id;
@@ -247,7 +251,7 @@ static Id pakfire_parse_rich_dep(struct pakfire* pakfire, const char** dep, int
        }
 
        // Consume any space
-       if (isspace(*p))
+       while (isspace(*p))
                p++;
 
        // If we have successfully parsed something, we would expect a closing bracket