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.
This commit is contained in:
Jehan 2024-09-20 17:32:41 +02:00
parent 79faa06693
commit 85a686b8c5
1 changed files with 2 additions and 8 deletions

View File

@ -123,13 +123,7 @@ gimp_config_deserialize_strv (GValue *value,
break; break;
} }
/* Not an error for scanned string to be empty.*/ g_strv_builder_add (builder, scanned_string ? scanned_string : "");
/* Adding string to builder DOES not transfer ownership,
* the builder will copy the string.
*/
g_strv_builder_add (builder, scanned_string);
g_free (scanned_string); g_free (scanned_string);
} }
@ -152,4 +146,4 @@ gimp_config_deserialize_strv (GValue *value,
g_strv_builder_unref (builder); g_strv_builder_unref (builder);
return result_token; return result_token;
} }