boot/efi-string: use QUOTES macro, shorten the code a bit
Follow-up for a8f2f5d717
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user