From 85a686b8c53318fd9953682bc9aa67d453708a45 Mon Sep 17 00:00:00 2001 From: Jehan Date: Fri, 20 Sep 2024 17:32:41 +0200 Subject: [PATCH] libgimpconfig: do not add NULL to a GStrv. gimp_scanner_parse_string() transforms the empty string into NULL, which might be what we want elsewhere, but definitely not for GStrv since NULL is the end flag for the string array. --- libgimpconfig/gimpconfig-array.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libgimpconfig/gimpconfig-array.c b/libgimpconfig/gimpconfig-array.c index 24fe712d70..012cb96993 100644 --- a/libgimpconfig/gimpconfig-array.c +++ b/libgimpconfig/gimpconfig-array.c @@ -123,13 +123,7 @@ gimp_config_deserialize_strv (GValue *value, break; } - /* Not an error for scanned string to be empty.*/ - - /* Adding string to builder DOES not transfer ownership, - * the builder will copy the string. - */ - g_strv_builder_add (builder, scanned_string); - + g_strv_builder_add (builder, scanned_string ? scanned_string : ""); g_free (scanned_string); } @@ -152,4 +146,4 @@ gimp_config_deserialize_strv (GValue *value, g_strv_builder_unref (builder); return result_token; -} \ No newline at end of file +}