From: Lennart Poettering Date: Tue, 14 Jul 2026 12:44:01 +0000 (+0200) Subject: string-util: reorder characters in version charset X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9b2960d4dfc7a3a5ac4dc188f28aa434a46ca4d;p=thirdparty%2Fsystemd.git string-util: reorder characters in version charset Let's bring the version string character set into a systematic order, matching the order in which they appear and are defined in the UAPI.10 specification text. This makes it easier to compare the relevant functions. --- diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 3d3114612c3..a806d2ddfa3 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -1470,17 +1470,18 @@ bool version_is_valid(const char *s) { return false; /* This is a superset of the characters used by semver. We additionally allow "_". */ - if (!in_charset(s, ALPHANUMERICAL "._-+")) + if (!in_charset(s, ALPHANUMERICAL ".-+_")) return false; return true; } bool version_is_valid_versionspec(const char *s) { + if (!filename_part_is_valid(s)) return false; - if (!in_charset(s, ALPHANUMERICAL "-.~^")) + if (!in_charset(s, ALPHANUMERICAL ".-~^")) return false; return true;