mirror of
https://github.com/systemd/systemd.git
synced 2026-07-13 02:51:14 +00:00
analyze: don't warn about version spec compliant versions
This commits adds version_is_valid_versionspec and uses it in analyze-compare-version.c. version_is_valid_versionspec differs from version_is_valid in that it acepts empty strings and since valid characters in a version spec version are all ASCII letters and digits as well as "-.~^", but ",_+" allowed by version_is_valid are not. Also give a more specific warning message on invalid characters.
This commit is contained in:
committed by
Luca Boccassi
parent
1dfa58edd3
commit
c46f5680ca
@@ -1436,3 +1436,13 @@ bool version_is_valid(const char *s) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool version_is_valid_versionspec(const char *s) {
|
||||
if (!filename_part_is_valid(s))
|
||||
return false;
|
||||
|
||||
if (!in_charset(s, ALPHANUMERICAL "-.~^"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user