From ad2d401e02fe77626e79d96269cecb827996729a Mon Sep 17 00:00:00 2001 From: why Date: Thu, 5 Jun 2003 04:43:05 +0000 Subject: * 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 --- ext/syck/handler.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'ext/syck/handler.c') 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; + } } // -- cgit