bootctl: Print version number of detected binaries
authorArian van Putten <arian.vanputten@gmail.com>
Tue, 30 May 2023 17:12:36 +0000 (19:12 +0200)
committerArian van Putten <arian.vanputten@gmail.com>
Tue, 30 May 2023 17:20:55 +0000 (19:20 +0200)
In 9b9f6aa41204c995b7a3b3e99c50e92b0a8b3dde (#27069)
we changed get_file_version to return 0 instead of 1 on success.
However we did not update the printing of the version number to
handle this change so we would never print the version number.

src/boot/bootctl-status.c

index 3da6478259010004afa22e1e31f8cd6d687e18ff..0e4e87ae24106978f3d6053b6567ad712f45dfe8 100644 (file)
@@ -243,10 +243,7 @@ static int enumerate_binaries(
                 /* Do not output this entry immediately, but store what should be printed in a state
                  * variable, because we only will know the tree glyph to print (branch or final edge) once we
                  * read one more entry */
-                if (r > 0)
-                        r = asprintf(previous, "/%s/%s (%s%s%s)", path, de->d_name, ansi_highlight(), v, ansi_normal());
-                else
-                        r = asprintf(previous, "/%s/%s", path, de->d_name);
+                r = asprintf(previous, "/%s/%s (%s%s%s)", path, de->d_name, ansi_highlight(), v, ansi_normal());
                 if (r < 0)
                         return log_oom();