From a8f2f5d71786c2cf36e32f856cc329413a76cd93 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Tue, 27 Jan 2026 17:12:34 +0000 Subject: [PATCH] efi-string: Unquote single-quoted strings as well as double This code is used to read data copied from /etc/os-release. According to the spec[1], values can be enclosed in single quotes or double quotes. Not handling single quotes results in the quotes appearing in the systemd-boot menu, e.g. 'Gentoo Linux'. [1] https://www.freedesktop.org/software/systemd/man/latest/os-release.html Signed-off-by: James Le Cuirot --- src/boot/efi-string.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/boot/efi-string.c b/src/boot/efi-string.c index e7bf3a4702f..ca077a5096f 100644 --- a/src/boot/efi-string.c +++ b/src/boot/efi-string.c @@ -497,7 +497,8 @@ char* line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, value++; /* unquote */ - if (value[0] == '"' && line[linelen - 1] == '"') { + if ((value[0] == '"' && line[linelen - 1] == '"') || + (value[0] == '\'' && line[linelen - 1] == '\'')) { value++; line[linelen - 1] = '\0'; } -- 2.47.3