Change 285491 by gisle@gisle-or on 2008/05/13 11:46:38
Fix the YAML::XS dump of undef values.
Fixes
http://bugs.activestate.com/show_bug.cgi?id=76959
Affected files ...
... //depot/main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c#2 edit
... //depot/main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/t/null.t#2 edit
Differences ...
==== //depot/main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c#2 (text) ====
Index: main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c
--- main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c.~1~ Tue May 13 20:48:42 2008
+++ main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/LibYAML/perl_libyaml.c Tue May 13 20:48:42 2008
@@ -770,7 +770,6 @@
STRLEN string_len;
int plain_implicit, quoted_implicit;
yaml_scalar_style_t style = YAML_PLAIN_SCALAR_STYLE;
- svtype type = SvTYPE(node);
if (tag) {
plain_implicit = quoted_implicit = 0;
@@ -780,7 +779,7 @@
plain_implicit = quoted_implicit = 1;
}
- if (type == SVt_NULL) {
+ if (!SvOK(node)) {
string = "~";
string_len = 1;
style = YAML_PLAIN_SCALAR_STYLE;
@@ -803,7 +802,7 @@
strEQ(string, "true") ||
strEQ(string, "false") ||
strEQ(string, "null") ||
- (type >= SVt_PVGV)
+ (SvTYPE(node) >= SVt_PVGV)
) {
style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
}
==== //depot/main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/t/null.t#2 (text) ====
Index: main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/t/null.t
--- main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/t/null.t.~1~ Tue May 13 20:48:42 2008
+++ main/Camel/src/cpan/Y/YAML/YAML-LibYAML/main/t/null.t Tue May 13 20:48:42 2008
@@ -3,12 +3,13 @@
my $array = [
undef,
'undef',
- undef,
+ 33,
'~',
undef,
undef,
'~/file.txt',
];
+undef $array->[2];
my $yaml = Dump($array);
End of Patch.