- return -1;
- do {
- string.pointer --;
- } while ((*string.pointer & 0xC0) == 0x80);
- if (!IS_BREAK(string))
- return -1;
- if (string.start == string.pointer)
- return 0;
- do {
- string.pointer --;
- } while ((*string.pointer & 0xC0) == 0x80);
- if (!IS_BREAK(string))
- return 0;
- return +1;
-
+ {
+ chomp_hint = "-";
+ }
+ else
+ {
+ do {
+ string.pointer --;
+ } while ((*string.pointer & 0xC0) == 0x80);
+ if (!IS_BREAK(string))
+ {
+ chomp_hint = "-";
+ }
+ else if (string.start == string.pointer)
+ {
+ chomp_hint = "+";
+ emitter->open_ended = 1;
+ }
+ else
+ {
+ do {
+ string.pointer --;
+ } while ((*string.pointer & 0xC0) == 0x80);
+ if (IS_BREAK(string))
+ {
+ chomp_hint = "+";
+ emitter->open_ended = 1;
+ }
+ }
+ }
+
+ if (chomp_hint)
+ {
+ if (!yaml_emitter_write_indicator(emitter, chomp_hint, 0, 0, 0))
+ return 0;
+ }
+
+ return 1;