diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-05 04:43:05 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-05 04:43:05 +0000 |
commit | ad2d401e02fe77626e79d96269cecb827996729a (patch) | |
tree | c0485110aa5ea341f821cb6bfa210041b71813e3 /ext/syck/handler.c | |
parent | 755671e73d5d19e837a180f6bd17fe3619253bef (diff) | |
download | ruby-ad2d401e02fe77626e79d96269cecb827996729a.tar.gz ruby-ad2d401e02fe77626e79d96269cecb827996729a.tar.xz ruby-ad2d401e02fe77626e79d96269cecb827996729a.zip |
* ext/syck/token.c: directives choked on a period.
* ext/syck/gram.y: anchors work above a collection. [ruby-core:1071]
* ext/syck/handler.c, ext/syck/syck.c: ensure a fresh strtable between
parser iterations.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/handler.c')
-rw-r--r-- | ext/syck/handler.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/syck/handler.c b/ext/syck/handler.c index f2e387a92..d5a4895c5 100644 --- a/ext/syck/handler.c +++ b/ext/syck/handler.c @@ -31,6 +31,10 @@ SyckNode * syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n ) { n->anchor = a; + if ( p->anchors == NULL ) + { + p->anchors = st_init_strtable(); + } st_insert( p->anchors, (st_data_t)a, (st_data_t)n ); return n; } @@ -40,9 +44,12 @@ syck_hdlr_add_alias( SyckParser *p, char *a ) { SyckNode *n; - if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&n ) ) + if ( p->anchors != NULL ) { - return n; + if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&n ) ) + { + return n; + } } // |