From 166b1655e3fbe7b42b35c6148c44aa9c8cee9dff Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 2 Dec 2022 11:41:12 +0000 Subject: [PATCH] dependencies: Consume any excess space Signed-off-by: Michael Tremer --- src/libpakfire/dependencies.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libpakfire/dependencies.c b/src/libpakfire/dependencies.c index 4fa7b0f65..332a87f3f 100644 --- a/src/libpakfire/dependencies.c +++ b/src/libpakfire/dependencies.c @@ -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 -- 2.39.5