Ticket #43: 0001-xmlpushparser-return-error-messages-instead-of-code.patch

File 0001-xmlpushparser-return-error-messages-instead-of-code.patch, 1.1 kB (added by tmm1, 5 months ago)
  • a/vendor/eventmachine_xmlpushparser/ext/rubymain.cpp

    old new  
    281281 
    282282void RubyXmlPushParser_t::SaxError() 
    283283{ 
    284         rb_funcall (Myself, rb_intern ("error"), 1, INT2FIX (xmlCtxtGetLastError (Context)->code)); 
     284        int length = 0; 
     285        char *err = xmlCtxtGetLastError (Context)->message; 
     286 
     287        if (!err) { 
     288                err = (const char *)""; 
     289        } else { 
     290                length = strlen(err)-1; 
     291        } 
     292 
     293        rb_funcall (Myself, rb_intern ("error"), 1, rb_str_new((const char*)err, length)); 
    285294        rb_funcall (Myself, rb_intern ("close_connection"), 0); 
    286295} 
    287296