Skip to content

Commit

Permalink
efibootmgr: print space before optional entry data
Browse files Browse the repository at this point in the history
Before:

    $ efibootmgr -u
    […]
    Boot0004* Arch Linux	HD(1,GPT,[…],0x800,0x145000)/\vmlinuz-linuxroot=LABEL=Arch rw nowatchdog initrd=\initramfs-linux.img

After:

    $ efibootmgr -u
    […]
    Boot0004* Arch Linux	HD(1,GPT,[…],0x800,0x145000)/\vmlinuz-linux root=LABEL=Arch rw nowatchdog initrd=\initramfs-linux.img

Note the extra space before "root=".

Signed-off-by: Carlo Teubner <[email protected]>
  • Loading branch information
c4rlo committed May 25, 2024
1 parent 0a85e9b commit b61c061
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/efibootmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ show_var_path(efi_load_option *load_option, size_t boot_data_size)
warning("Could not parse optional data");
return;
}
text_path = calloc(1, sizeof(" File(.")
text_path = calloc(1, sizeof("File(.")
+ strlen(a)
+ strlen(")"));
if (!text_path) {
Expand All @@ -1045,7 +1045,7 @@ show_var_path(efi_load_option *load_option, size_t boot_data_size)
}
char *b;

b = stpcpy(text_path, " File(.");
b = stpcpy(text_path, "File(.");
b = stpcpy(b, a);
stpcpy(b, ")");
free(a);
Expand Down Expand Up @@ -1083,6 +1083,8 @@ show_var_path(efi_load_option *load_option, size_t boot_data_size)
return;
}
}
if (strlen(text_path) > 0)
printf(" ");
printf("%s", text_path);
free(text_path);
printf("\n");
Expand Down

0 comments on commit b61c061

Please sign in to comment.