Subject: | Problem with strings ending in ':' and ' ' |
YAML:Syck doesn't seem to correctly encode strings that end with either
a ':' or a ' '
e.g Dump('a:') will give
--- a:
which is wrong as it should be
--- 'a:'
Similarly there is a problem with strings ending in space.
As a fix, either use the syck_scan_scalar from emitter.c in the Syck CVS
or apply the following patch:
--- emitter.c (revision 7113)
+++ emitter.c (revision 7249)
@@ -575,6 +575,14 @@
flags |= SCAN_MANYNL_E;
}
+ /* ending colons */
+ /* These are the wrong flag codes, but have the correct affect */
+ if ( cursor[len-1] == ':' ) {
+ flags |= SCAN_INDIC_S;
+ } else if ( cursor[len-1] == ' ' ) {
+ flags |= SCAN_INDIC_S;
+ }
+
/* opening doc sep */
if ( len >= 3 && strncmp( cursor, "---", 3 ) == 0 )
flags |= SCAN_DOCSEP;
This is on Debain, running v5.8.4 and YAML:Syck 0.30