boot/efi-string: use QUOTES macro, shorten the code a bit

Follow-up for a8f2f5d717
This commit is contained in:
Mike Yuan
2026-02-05 14:14:38 +01:00
parent d2f55e7079
commit de0da85d41
+2 -2
View File
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "efi-string.h"
#include "string-util-fundamental.h"
#if SD_BOOT
# include "proto/simple-text-io.h"
@@ -497,8 +498,7 @@ char* line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key,
value++;
/* unquote */
if ((value[0] == '"' && line[linelen - 1] == '"') ||
(value[0] == '\'' && line[linelen - 1] == '\'')) {
if (strchr8(QUOTES, value[0]) && line[linelen - 1] == value[0]) {
value++;
line[linelen - 1] = '\0';
}