Index: libgimpconfig/gimpconfig-deserialize.c =================================================================== --- libgimpconfig/gimpconfig-deserialize.c (revision 22697) +++ libgimpconfig/gimpconfig-deserialize.c (working copy) @@ -81,6 +81,7 @@ static GTokenType gimp_config_deseriali static GTokenType gimp_config_deserialize_any (GValue *value, GParamSpec *prop_spec, GScanner *scanner); +static GTokenType gimp_config_skip_unknown_property (GScanner *scanner); static inline gboolean scanner_string_utf8_valid (GScanner *scanner, const gchar *token_name); @@ -122,15 +123,15 @@ gimp_config_deserialize_properties (Gimp guint i; guint scope_id; guint old_scope_id; - GTokenType token; - GTokenType next; + GTokenType token; + GTokenType next; g_return_val_if_fail (GIMP_IS_CONFIG (config), FALSE); klass = G_OBJECT_GET_CLASS (config); property_specs = g_object_class_list_properties (klass, &n_property_specs); - if (!property_specs) + if (! property_specs) return TRUE; scope_id = g_type_qname (G_TYPE_FROM_INSTANCE (config)); @@ -157,8 +158,12 @@ gimp_config_deserialize_properties (Gimp { next = g_scanner_peek_next_token (scanner); - if (next != token) - break; + if (G_UNLIKELY (next != token && + ! (token == G_TOKEN_SYMBOL && + next == G_TOKEN_IDENTIFIER))) + { + break; + } token = g_scanner_get_next_token (scanner); @@ -168,6 +173,10 @@ gimp_config_deserialize_properties (Gimp token = G_TOKEN_SYMBOL; break; + case G_TOKEN_IDENTIFIER: + token = gimp_config_skip_unknown_property (scanner); + break; + case G_TOKEN_SYMBOL: token = gimp_config_deserialize_property (config, scanner, nest_level); @@ -750,3 +759,37 @@ gimp_config_deserialize_any (GValue return G_TOKEN_RIGHT_PAREN; } + +static GTokenType +gimp_config_skip_unknown_property (GScanner *scanner) +{ + gint open_paren = 0; + + while (TRUE) + { + GTokenType token = g_scanner_peek_next_token (scanner); + + switch (token) + { + case G_TOKEN_LEFT_PAREN: + open_paren++; + g_scanner_get_next_token (scanner); + break; + + case G_TOKEN_RIGHT_PAREN: + if (open_paren == 0) + return token; + + open_paren--; + g_scanner_get_next_token (scanner); + break; + + case G_TOKEN_EOF: + return token; + + default: + g_scanner_get_next_token (scanner); + break; + } + } +}