Skip Menu |
 

This queue is for tickets about the YAML-Syck CPAN distribution.

Report information
The Basics
Id: 19318
Status: resolved
Priority: 0/
Queue: YAML-Syck

People
Owner: Nobody in particular
Requestors: kevinj [...] ca.sophos.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.44
Fixed in: (no value)



Subject: Incorrect parsing of newlines
Download (untitled) / with headers
text/plain 388b
This is the same as bug 19313 which I reported in JSON::Syck perl -MYAML::Syck -le 'print YAML::Syck::Dump({a => "hello\nworld\n"})' should produce: --- a: "hello\nworld\n" but instead produces --- a: "hello\n\ world\n" \n characters are being translated into a \n followed by a literal newline and two spaces.
Download (untitled) / with headers
text/plain 118b
Here's my patch which fixes this bug... It doesn't break any unit tests in this package, JSON::Syck, nor why's libsyck
Download yaml-emitter.patch
text/x-diff 851b
p4 edit //depot/users/kevinj/YAML-Syck-0.44/emitter.c Index: emitter.c --- emitter.c.~1~ Fri May 26 13:38:31 2006 +++ emitter.c Fri May 26 13:38:31 2006 @@ -885,7 +885,7 @@ case '\n': end = mark + 1; syck_emitter_write( e, "\\n", 2 ); - do_indent = 2; + //do_indent = 2; start = mark + 1; if ( start < str + len && ( *start == ' ' || *start == '\n' ) ) { do_indent = 0; p4 edit //depot/users/kevinj/YAML-Syck-0.44/t/json-basic.t Index: t/json-basic.t --- t/json-basic.t.~1~ Fri May 26 13:38:31 2006 +++ t/json-basic.t Fri May 26 13:38:31 2006 @@ -41,6 +41,7 @@ '{"foo":""}', '["\"://\""]', '"~foo"', + '{"hw":"Hello\nWorld\n"}', ); plan tests => scalar @tests * (1 + $HAS_JSON) * 2; End of Patch.
Marking as resolved (as of YAML 1.01).


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.