Skip to content

Commit b61c061

Browse files
committed
efibootmgr: print space before optional entry data
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]>
1 parent 0a85e9b commit b61c061

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/efibootmgr.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ show_var_path(efi_load_option *load_option, size_t boot_data_size)
10351035
warning("Could not parse optional data");
10361036
return;
10371037
}
1038-
text_path = calloc(1, sizeof(" File(.")
1038+
text_path = calloc(1, sizeof("File(.")
10391039
+ strlen(a)
10401040
+ strlen(")"));
10411041
if (!text_path) {
@@ -1045,7 +1045,7 @@ show_var_path(efi_load_option *load_option, size_t boot_data_size)
10451045
}
10461046
char *b;
10471047

1048-
b = stpcpy(text_path, " File(.");
1048+
b = stpcpy(text_path, "File(.");
10491049
b = stpcpy(b, a);
10501050
stpcpy(b, ")");
10511051
free(a);
@@ -1083,6 +1083,8 @@ show_var_path(efi_load_option *load_option, size_t boot_data_size)
10831083
return;
10841084
}
10851085
}
1086+
if (strlen(text_path) > 0)
1087+
printf(" ");
10861088
printf("%s", text_path);
10871089
free(text_path);
10881090
printf("\n");

0 commit comments

Comments
 (0)