From 6717d2bc5a3e05d1d6ee53aacb622cfbea9e2b24 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Sun, 21 Aug 2016 09:02:43 +0100 Subject: 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. --- libappstream-glib/as-yaml.c | 15 --------------- 1 file changed, 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)) { -- cgit v1.2.1