Commits

Anonymous committed d106a08

Submitted by:
Reviewed by:
PR:

Log: Modified Files:
perl-libxml-mm.c
[fix] bad variable declaration

t/05text.t
o forgot to ci

Comments (0)

Files changed (2)

        code in LibXML.xs */
     SV* retval = &PL_sv_undef;
     STRLEN len = 0;
+    xmlChar * decoded = NULL;
 
     if ( refnode != NULL ) {
         xmlDocPtr real_doc = refnode->doc;
             xs_warn( " encode node !!" );
             /* The following statement is to handle bad
                values set by XML::LibXSLT */
+
             if ( PmmNodeEncoding(real_doc) == XML_CHAR_ENCODING_NONE ) {
                 PmmNodeEncoding(real_doc) = XML_CHAR_ENCODING_UTF8;
             }
-            xmlChar * decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) ,
-                                                     (const xmlChar *)string,
-                                                     (const xmlChar*)real_doc->encoding);
+
+            decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) ,
+                                           (const xmlChar *)string,
+                                           (const xmlChar*)real_doc->encoding);
+
             xs_warn( "push decoded string into SV" );
             len = xmlStrlen( decoded );
             retval = newSVpvn( (const char *)decoded, len );
     my $foo = "foobar";
     my $textnode = $doc->createTextNode($foo);
     ok( $textnode );
-    ok( $textnode->nodeName(), text );
+    ok( $textnode->nodeName(), 'text' );
     ok( $textnode->nodeValue(), $foo );
 
     print "# 2. substring\n";