diff options
author | Richard Hughes <richard@hughsie.com> | 2016-08-21 09:02:43 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-08-21 09:14:22 +0100 |
commit | 6717d2bc5a3e05d1d6ee53aacb622cfbea9e2b24 (patch) | |
tree | fe02df05af779189430e0d275a9b92558ef4ad8b | |
parent | ded832b12e663a238bdaddcd84b08efb096c3b1b (diff) | |
download | appstream-glib-6717d2bc5a3e05d1d6ee53aacb622cfbea9e2b24.tar.gz |
Don't use the prefix check when parsing YAML
We don't do this for the from_file() version, and we can reliably depend on
libyaml for error checking now.
-rw-r--r-- | libappstream-glib/as-yaml.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/libappstream-glib/as-yaml.c b/libappstream-glib/as-yaml.c index ea1c2a8..2bebbec 100644 --- a/libappstream-glib/as-yaml.c +++ b/libappstream-glib/as-yaml.c @@ -398,21 +398,6 @@ as_yaml_from_data (const gchar *data, gssize data_len, GError **error) #if AS_BUILD_DEP11 yaml_parser_t parser; g_auto(AsYamlParser) parser_cleanup = NULL; - g_autofree gchar *prefix = NULL; - - /* sanity check */ - prefix = g_strndup (data, 64); - g_strdelimit (prefix, "\n", '\0'); - if (!g_str_has_prefix (prefix, "---") && - !g_str_has_prefix (prefix, "#") && - !g_str_has_prefix (prefix, "File: ")) { - g_set_error (error, - AS_NODE_ERROR, - AS_NODE_ERROR_INVALID_MARKUP, - "YAML prefix invalid: %s expected '---' or '#'", - prefix); - return NULL; - } /* parse */ if (!yaml_parser_initialize (&parser)) { |