]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot/efi-string: use QUOTES macro, shorten the code a bit
authorMike Yuan <me@yhndnzj.com>
Wed, 4 Feb 2026 18:32:51 +0000 (19:32 +0100)
committerMike Yuan <me@yhndnzj.com>
Thu, 5 Feb 2026 13:14:38 +0000 (14:14 +0100)
Follow-up for a8f2f5d71786c2cf36e32f856cc329413a76cd93

src/boot/efi-string.c

index ca077a5096f2c0076b94b524862760dc1c0f31dc..ee430c1b36a40bb1190b2dc627ea253b13594dd7 100644 (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';
                 }