Commits

Anonymous committed 9f77469

Modified Files:
LibXML.xs
[fix] parse_*() will not croak empty errors if the document is valid
and validation is activated. (reported by Petr Pajas)
it was a misreading/misunderstanding of SvCUR() and SvLEN()

btw. forgot to mention that the report of the string_value() bug
was made by Merijn Broeren.

Comments (0)

Files changed (1)

             croak(SvPV(LibXML_error, len));
         }
         else if (xmlDoValidityCheckingDefaultValue
-                 && SvLEN(LibXML_error) > 0
+                 && SvCUR(LibXML_error) > 0
                  && (real_dom->intSubset || real_dom->extSubset) ) {
             croak(SvPV(LibXML_error, len));
         }
             croak(SvPV(LibXML_error, len));
         }
         else if (xmlDoValidityCheckingDefaultValue
-                 && SvLEN(LibXML_error) > 0
+                 && SvCUR(LibXML_error) > 0
                  && (real_dom->intSubset || real_dom->extSubset)  ) {
             croak(SvPV(LibXML_error, len));
         }
         
         sv_2mortal(LibXML_error);
         
-        if (!well_formed || (xmlDoValidityCheckingDefaultValue && (!valid|| SvLEN(LibXML_error) > 0 ) && (real_dom->intSubset || real_dom->extSubset) )) {
+        if (!well_formed || (xmlDoValidityCheckingDefaultValue && (!valid|| SvCUR(LibXML_error) > 0 ) && (real_dom->intSubset || real_dom->extSubset) )) {
             xmlFreeDoc(real_dom);
             RETVAL = &PL_sv_undef ;  
-            croak(SvPV(LibXML_error, len));
+            croak("'%s'",SvPV(LibXML_error, len));
         }
         else {
             RETVAL = PmmNodeToSv((xmlNodePtr)real_dom, NULL);