diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-05-25 10:18:14 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-05-25 16:01:14 +0200 |
commit | c20b2f2421011a2c29fa04cc1955ed67b87daeb2 (patch) | |
tree | 5b1ab71fe8a5398e361678024d49fc47a10b2265 /src/analyze/analyze-compare-versions.c | |
parent | 620ecc9c4bb8769b2acb6c1b9b64b330d0f76fc1 (diff) | |
download | systemd-c20b2f2421011a2c29fa04cc1955ed67b87daeb2.tar.gz |
analyze: use '' instead of the empty string when showing versions
It looks like garbled output… I didn't use shell-escape, because the other
characters that are special for the shell that are used in versions should
not be escaped.
Diffstat (limited to 'src/analyze/analyze-compare-versions.c')
-rw-r--r-- | src/analyze/analyze-compare-versions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/analyze/analyze-compare-versions.c b/src/analyze/analyze-compare-versions.c index 9545326fa9..acc9bbfcf0 100644 --- a/src/analyze/analyze-compare-versions.c +++ b/src/analyze/analyze-compare-versions.c @@ -16,9 +16,9 @@ int verb_compare_versions(int argc, char *argv[], void *userdata) { if (argc == 3) { r = strverscmp_improved(ASSERT_PTR(argv[1]), ASSERT_PTR(argv[2])); printf("%s %s %s\n", - argv[1], + isempty(argv[1]) ? "''" : argv[1], r < 0 ? "<" : r > 0 ? ">" : "==", - argv[2]); + isempty(argv[2]) ? "''" : argv[2]); /* This matches the exit convention used by rpmdev-vercmp. * We don't use named values because 11 and 12 don't have names. */ |