Skip to content

Commit

Permalink
bootctl: show "n/a" for empty boot option labels
Browse files Browse the repository at this point in the history
  • Loading branch information
kaysievers committed Feb 17, 2013
1 parent 7962afb commit 71bf4f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/boot/boot-efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ static int get_boot_entries(struct boot_info *info) {
err = efi_get_boot_option(list[i], &e->title, &e->part_uuid, &e->path);
if (err < 0)
continue;

if (isempty(e->title)) {
free(e->title);
e->title = NULL;
}
tilt_slashes(e->path);

e->id = list[i];
info->fw_entries_count++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/boot/bootctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int show_status(char **args, unsigned n) {
printf(" Firmware: %s (%s)\n", info->fw_type, strna(info->fw_info));

if (info->fw_entry_active >= 0) {
printf("Firmware entry: %s\n", info->fw_entries[info->fw_entry_active].title);
printf("Firmware entry: %s\n", strna(info->fw_entries[info->fw_entry_active].title));
if (info->fw_entries[info->fw_entry_active].path)
printf(" %s\n", info->fw_entries[info->fw_entry_active].path);
if (!sd_id128_equal(info->fw_entries[info->fw_entry_active].part_uuid, SD_ID128_NULL))
Expand All @@ -165,7 +165,7 @@ static int show_status(char **args, unsigned n) {
SD_ID128_FORMAT_VAL(info->loader_part_uuid));

if (info->loader_entry_active >= 0) {
printf(" Loader entry: %s\n", info->loader_entries[info->loader_entry_active].title);
printf(" Loader entry: %s\n", strna(info->loader_entries[info->loader_entry_active].title));
printf(" %s\n", info->loader_entries[info->loader_entry_active].path);
}

Expand Down

0 comments on commit 71bf4f6

Please sign in to comment.