From 4d4690f8cfff826af19c881578c435f7d19f6a28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Thu, 20 Oct 2022 19:04:11 +0200 Subject: [PATCH] Handle keywords in image specs * src/image.c (parse_image_spec): Don't assume that keywords have a ':' in their symbol name. --- src/image.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/image.c b/src/image.c index f6209149313..4f548da76c3 100644 --- a/src/image.c +++ b/src/image.c @@ -1226,7 +1226,7 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords, /* First element of a pair must be a symbol. */ key = XCAR (plist); plist = XCDR (plist); - if (!SYMBOLP (key)) + if (!SYMBOLP (key) || !SYMBOL_KEYWORD_P (key)) return false; /* There must follow a value. */ @@ -1234,9 +1234,11 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords, return false; value = XCAR (plist); - /* Find key in KEYWORDS. Error if not found. */ + /* Find key in KEYWORDS. Error if not found. The keywords in + keywords have a ':' in their name, which we ignore, because + the keyword names have no ':'. */ for (i = 0; i < nkeywords; ++i) - if (strcmp (keywords[i].name, SSDATA (SYMBOL_NAME (key))) == 0) + if (strcmp (keywords[i].name + 1, SSDATA (SYMBOL_NAME (key))) == 0) break; if (i == nkeywords) -- 2.39.2