Skip to content

Commit dda7ab5

Browse files
committed
One more workaround for R on MacOS throwing uncaught xml errors. See #471
1 parent 98cade3 commit dda7ab5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/xml2_init.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ void handleStructuredError(void* userData, xmlError* error) {
2828
#ifdef __APPLE__
2929
xmlParserCtxt *ctxt = error->ctxt;
3030
static unsigned char icns[5] = { 'i', 'c', 'n', 's', '\0' };
31-
if(error->code == XML_ERR_DOCUMENT_EMPTY && ctxt->input && ctxt->input->base && xmlStrcmp(ctxt->input->base, icns) == 0){
32-
return;
31+
static unsigned char mm[3] = { 'M', 'M', '\0' };
32+
if(error->code == XML_ERR_DOCUMENT_EMPTY && ctxt->input && ctxt->input->base){
33+
if(!xmlStrcmp(ctxt->input->base, icns) || !xmlStrcmp(ctxt->input->base, mm)){
34+
return;
35+
}
3336
}
3437
#endif
3538

0 commit comments

Comments
 (0)