Skip to contentSkip to conversation

lib: parser: Fix match_wildcard to correctly handle trailing stars

PATCH RESEND Superseded Inseob Kim 1 participant 1 message Aug 28, 2025 Library code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Inseob Kim

author
#0 lore raw

PATCH RESEND 1/1 lib: parser: Fix match_wildcard to correctly handle trailing stars

This fixes a bug of match_wildcard that incorrectly handles trailing asterisks. For example, match_wildcard("abc**", "abc") must return true, but it returns false.

---
 lib/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/parser.c +1 -1
index 73e8f8e5be73..62da0ac0d438 100644
@@ -315,7 +315,7 @@ bool match_wildcard(const char *pattern, const char *str)
 		}
 	}
 
-	if (*p == '*')
+	while (*p == '*')
 		++p;
 	return !*p;
 }
Signature · 1 line
2.51.0.268.g9569e192d0-goog