mirror of
https://github.com/systemd/systemd.git
synced 2026-08-12 22:17:19 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user