Skip to content

Commit b05105f

Browse files
committed
bootctl: always show slashes not backslashes
1 parent 4d34c49 commit b05105f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/boot/boot-efi.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@
3737
#include "efivars.h"
3838
#include "conf-files.h"
3939

40+
static char *tilt_slashes(char *s) {
41+
char *p;
42+
43+
if (!s)
44+
return NULL;
45+
46+
for (p = s; *p; p++)
47+
if (*p == '\\')
48+
*p = '/';
49+
return s;
50+
}
51+
4052
static int get_boot_entries(struct boot_info *info) {
4153
uint16_t *list;
4254
int i, n;
@@ -63,7 +75,7 @@ static int get_boot_entries(struct boot_info *info) {
6375
err = efi_get_boot_option(list[i], &e->title, &e->part_uuid, &e->path);
6476
if (err < 0)
6577
continue;
66-
78+
tilt_slashes(e->path);
6779
e->id = list[i];
6880
info->fw_entries_count++;
6981
}
@@ -152,6 +164,7 @@ int boot_info_query(struct boot_info *info) {
152164
efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderFirmwareType", &info->fw_type);
153165
efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderFirmwareInfo", &info->fw_info);
154166
efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderImageIdentifier", &info->loader_image_path);
167+
tilt_slashes(info->loader_image_path);
155168
efi_get_loader_device_part_uuid(&info->loader_part_uuid);
156169

157170
boot_loader_read_entries(info);

0 commit comments

Comments
 (0)