diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-11-03 22:56:52 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-11-03 22:56:52 (GMT) |
commit | 459b345d69532825f21bdcd3e4f92009b0a046dc (patch) | |
tree | e0bc3d9089f0b5452e77be0f5d37fc0522f78c4a /plugins/yaml/line.c | |
parent | 33b5dc9af0404eabeb0e60245ab1ca1dc3713a17 (diff) |
Handled sequences with the Yaml reader in an improved way.
Diffstat (limited to 'plugins/yaml/line.c')
-rw-r--r-- | plugins/yaml/line.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/plugins/yaml/line.c b/plugins/yaml/line.c index cd993ee..26a1012 100644 --- a/plugins/yaml/line.c +++ b/plugins/yaml/line.c @@ -203,19 +203,20 @@ GYamlLine *g_yaml_line_new(const char *raw, size_t number) for (iter = result->raw; *iter != '\0'; iter++) { - if (*iter != ' ' && *iter != '-') + if (*iter != ' ') break; result->indent++; - if (*iter == '-') - { - if (result->is_list_item) - goto format_error; + } - result->is_list_item = true; + if (*iter == '-') + { + result->is_list_item = true; - } + for (iter++; *iter != '\0'; iter++) + if (*iter != ' ') + break; } @@ -280,14 +281,6 @@ GYamlLine *g_yaml_line_new(const char *raw, size_t number) return result; - format_error: - - log_variadic_message(LMT_ERROR, "Yaml format error at line %zu", number); - - g_object_unref(G_OBJECT(result)); - - return NULL; - } |