]> git.ipfire.org Git - pakfire.git/commitdiff
util: Correctly find the first part before =, >, <, etc.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Dec 2021 16:44:44 +0000 (16:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Dec 2021 16:44:44 +0000 (16:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/util.c

index b777069dff79211d312323fc0d82e42200c3b38d..a348c13b735cc80a014056e776137344413fac6b 100644 (file)
@@ -159,7 +159,13 @@ static Id pakfire_parse_dep(struct pakfire* pakfire, const char** s) {
                p++;
 
        // Find the first part
-       size_t l = skip(&p, &n);
+       n = p;
+
+       // Find the first part (before =, >= or <=)
+       while (*p && !isspace(*p) && *p != '<' && *p != '=' && *p != '>')
+               p++;
+
+       size_t l = p - n;
 
        // Add name to pool
        if (pakfire_string_startswith(n, "pakfire("))