ropensci/readODS

`list_fods_sheets` can't guard non-fods XML disguised as `fods`

chainsawriot opened this issue · 1 comments

rubbish_file <- tempfile(fileext = ".fods")
writeLines("<ul><li>hello</li></ul>", rubbish_file)
list_fods_sheets(rubbish_file) ##infinite loop

I will run it over GDB to see why is_flat_ods isn't triggered.

readODS/src/is_ods.cpp

Lines 83 to 85 in f8fc657

while(rootNode != 0 && strcmp(rootNode->name(), "office:document") != 0){
rootNode->next_sibling();
}

GDB points to these lines for the infinite loop.