summaryrefslogtreecommitdiff
path: root/ext/syck
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-25 15:04:16 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-25 15:04:16 +0000
commit439975d8964bf1dd9a89b97a0f3a868c477eb630 (patch)
tree9b3ec443dca118b72e7aae59d722e53ca04685ae /ext/syck
parentadc10cab5181133a9f54f1b273fd3449b1dc2709 (diff)
* ext/syck/syck.c (syck_new_parser): clear parser on init.
thanks, ts. [ruby-core:02931] * ext/syck/token.c (sycklex_yaml_utf8): buffer underflow. thanks, ts. [ruby-core:02929] * lib/yaml/baseemitter.rb (indent_text): simpler flow block code. * lib/yaml.rb: added rdoc to beginning of lib. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck')
-rw-r--r--ext/syck/syck.c1
-rw-r--r--ext/syck/token.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index a4a3bd0c01..5a15ab4947 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -159,6 +159,7 @@ syck_new_parser()
{
SyckParser *p;
p = S_ALLOC( SyckParser );
+ S_MEMZERO( p, SyckParser, 1 );
p->lvl_capa = ALLOC_CT;
p->levels = S_ALLOC_N( SyckLevel, p->lvl_capa );
p->input_type = syck_yaml_utf8;
diff --git a/ext/syck/token.c b/ext/syck/token.c
index ac9986f564..ff192f24e1 100644
--- a/ext/syck/token.c
+++ b/ext/syck/token.c
@@ -2297,7 +2297,7 @@ yy215:
#line 938
{ if ( YYTOKEN == YYLINEPTR )
{
- if ( blockType == BLOCK_FOLD )
+ if ( blockType == BLOCK_FOLD && qidx > 0 )
{
qidx -= 1;
}