diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-20 06:50:20 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-20 06:50:20 +0000 |
commit | d578f9d32e4c13df9ebf51873ae335c5e5a795ce (patch) | |
tree | defcbbf25c171d2ef655ea1e0e2df426491ab91e /ext/syck/yaml2byte.c | |
parent | 34b3f481dc2e92aaf477f4ec49a0b3bf0274bbf1 (diff) | |
download | ruby-d578f9d32e4c13df9ebf51873ae335c5e5a795ce.tar.gz |
* ext/syck/emitter.c (syck_scan_scalar): prevent indicators from
appearing alone or at the end of plain scalars. [ruby-core:5826]
* ext/syck/emitter.c (syck_emit_scalar): treat typed scalar nodes
as complex keys.
* lib/syck.h: version 0.60.
* lib/yaml/basenode.rb (YAML::BaseNode#at): transform keys during
key searches.
* ext/syck/rubyext.c: loading of binary-typed nodes. prevent
emission of plain strings that look like symbols, but which aren't.
* ext/syck/emitter.c (syck_emit): passing an int* value to the
long* parameter causes unaligned access on LP64 systems.
[ruby-dev:27161]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/yaml2byte.c')
-rw-r--r-- | ext/syck/yaml2byte.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ext/syck/yaml2byte.c b/ext/syck/yaml2byte.c index 46173e861e..61cd8c8eac 100644 --- a/ext/syck/yaml2byte.c +++ b/ext/syck/yaml2byte.c @@ -226,12 +226,17 @@ syck_yaml2byte(char *yamlstr) syck_parser_implicit_typing( parser, 1 ); syck_parser_taguri_expansion( parser, 1 ); oid = syck_parse( parser ); - syck_lookup_sym( parser, oid, (char **)&sav ); - ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 ); - ret[0] = '\0'; - strcat( ret, "D\n" ); - strcat( ret, sav->buffer ); + if ( syck_lookup_sym( parser, oid, (char **)&sav ) == 1 ) { + ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 ); + ret[0] = '\0'; + strcat( ret, "D\n" ); + strcat( ret, sav->buffer ); + } + else + { + ret = NULL; + } syck_free_parser( parser ); return ret; |