Skip Menu |
 

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

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

People
Owner: TODDR [...] cpan.org
Requestors: kevinj [...] activestate.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.60

Attachments


Subject: Incorrect parsing of newlines
Download (untitled) / with headers
text/plain 279b
perl -MJSON::Syck -le 'print JSON::Syck::Dump({a => "hello\nworld\n"})' This should produce: {"a":"hello\nworld\n"} but instead produces: {"a":"hello\n\ world\n"}
Download (untitled) / with headers
text/plain 268b
Show quoted text
> {"a":"hello\n\ > > world\n"}
Ah, you can't see it very well in this font, but the newline is replaced by \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, YAML::Syck, nor why's libsyck
Download json_emitter.patch
text/x-diff 1.6k
==== //depot/main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/emitter.c#1 - /usr/home/kevinj/depot/main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/emitter.c ==== Index: main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/emitter.c --- main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/emitter.c.~1~ Fri May 26 13:32:08 2006 +++ main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/emitter.c Fri May 26 13:32:08 2006 @@ -871,7 +871,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; ==== //depot/main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/t/01_json.t#1 - /usr/home/kevinj/depot/main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/t/01_json.t ==== Index: main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/t/01_json.t --- main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/t/01_json.t.~1~ Fri May 26 13:32:08 2006 +++ main/Appliance/apps/projects/goodfellow/cpan-packages/cpan-packages/JSON-Syck/t/01_json.t Fri May 26 13:32:08 2006 @@ -31,6 +31,7 @@ '["",null]', '{"foo":""}', '["\"://\""]', + '{"hw":"Hello\nWorld\n"}', ); plan tests => scalar @tests * (1 + $HAS_JSON) * 2; End of Patch.
Based on a bisect, this appears to have been resolved in 0.60


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.