From a8608d9c8011242bf970c673ad51dd73377d2df1 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 10 Mar 2013 20:23:59 +0100 Subject: [PATCH] setup: tilt slashes --- src/setup/efivars.c | 4 ++-- src/setup/efivars.h | 2 ++ src/setup/setup.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/setup/efivars.c b/src/setup/efivars.c index 61d729c..783ecc8 100644 --- a/src/setup/efivars.c +++ b/src/setup/efivars.c @@ -268,7 +268,7 @@ static void id128_to_efi_guid(const uint8_t *bytes, void *guid) { memcpy(uuid->u4, bytes+8, sizeof(uuid->u4)); } -static char *tilt_backslashes(char *s) { +char *tilt_backslashes(char *s) { char *p; for (p = s; *p; p++) @@ -278,7 +278,7 @@ static char *tilt_backslashes(char *s) { return s; } -static uint16_t *tilt_slashes(uint16_t *s) { +uint16_t *tilt_slashes(uint16_t *s) { uint16_t *p; for (p = s; *p; p++) diff --git a/src/setup/efivars.h b/src/setup/efivars.h index acf5a57..97cb3d5 100644 --- a/src/setup/efivars.h +++ b/src/setup/efivars.h @@ -50,3 +50,5 @@ int efi_get_boot_order(uint16_t **order); int efi_set_boot_order(uint16_t *order, size_t n); char *utf16_to_utf8(const void *s, size_t length); +char *tilt_backslashes(char *s); +uint16_t *tilt_slashes(uint16_t *s); diff --git a/src/setup/setup.c b/src/setup/setup.c index ceb4a54..865afce 100644 --- a/src/setup/setup.c +++ b/src/setup/setup.c @@ -404,7 +404,7 @@ static int print_efi_option(uint16_t id) { r = efi_get_boot_option(id, &title, partition, &path); if (r < 0) { - fprintf(stderr, "Failed to read EFI boot entry Boot%04X.\n", id); + fprintf(stderr, "Failed to read EFI boot entry Boot%04X: %s.\n", id, strerror(-r)); goto finish; } @@ -416,9 +416,9 @@ static int print_efi_option(uint16_t id) { partition[0], partition[1], partition[2], partition[3], partition[4], partition[5], partition[6], partition[7], partition[8], partition[9], partition[10], partition[11], partition[12], partition[13], partition[14], partition[15]); } - printf("\n"); finish: + printf("\n"); free(title); free(path); return r; @@ -448,6 +448,7 @@ static int status_variables(void) { r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderImageIdentifier", &s); if (r == 0) { + tilt_backslashes(s); printf(" Loader: %s\n", s); free(s); } -- 2.7.4