summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emitter.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/emitter.c b/src/emitter.c
index f26c53b..21ef1b2 100644
--- a/src/emitter.c
+++ b/src/emitter.c
@@ -594,6 +594,7 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
{
if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
return 0;
+ emitter->open_ended = 0;
if (!yaml_emitter_write_indent(emitter))
return 0;
}
@@ -644,6 +645,7 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
emitter->state = YAML_EMIT_DOCUMENT_CONTENT_STATE;
+ emitter->open_ended = 0;
return 1;
}
@@ -691,6 +693,7 @@ yaml_emitter_emit_document_end(yaml_emitter_t *emitter,
if (!event->data.document_end.implicit) {
if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
return 0;
+ emitter->open_ended = 0;
if (!yaml_emitter_write_indent(emitter))
return 0;
}
@@ -1796,7 +1799,6 @@ yaml_emitter_write_indicator(yaml_emitter_t *emitter,
emitter->whitespace = is_whitespace;
emitter->indention = (emitter->indention && is_indention);
- emitter->open_ended = 0;
return 1;
}
@@ -1939,10 +1941,6 @@ yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
emitter->whitespace = 0;
emitter->indention = 0;
- if (emitter->root_context)
- {
- emitter->open_ended = 1;
- }
return 1;
}