diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-08-26 16:28:06 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-09-01 23:15:14 +0200 |
commit | 8bd2cf6e11a1145a01c648663e45cc946f0495d9 (patch) | |
tree | 2d157edc6c841206f506d5f6c0ec472af0ca0823 /src/shared/condition.c | |
parent | compare: move test_order() → compare-operator.[ch] (diff) | |
download | systemd-8bd2cf6e11a1145a01c648663e45cc946f0495d9.tar.xz systemd-8bd2cf6e11a1145a01c648663e45cc946f0495d9.zip |
comapre: add generic implementation for comapring with verscmp+fnmatch
Diffstat (limited to 'src/shared/condition.c')
-rw-r--r-- | src/shared/condition.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/shared/condition.c b/src/shared/condition.c index d5aee1d793..31b3db1182 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -562,11 +562,7 @@ static int condition_test_firmware_smbios_field(const char *expression) { delete_trailing_chars(actual_value, WHITESPACE); /* Finally compare actual and expected value */ - if (operator == COMPARE_FNMATCH_EQUAL) - return fnmatch(expected_value, actual_value, FNM_EXTMATCH) != FNM_NOMATCH; - if (operator == COMPARE_FNMATCH_UNEQUAL) - return fnmatch(expected_value, actual_value, FNM_EXTMATCH) == FNM_NOMATCH; - return test_order(strverscmp_improved(actual_value, expected_value), operator); + return version_or_fnmatch_compare(operator, actual_value, expected_value); } static int condition_test_firmware(Condition *c, char **env) { |