
12 Sep
2013
12 Sep
'13
6:31 p.m.
2013/9/12 Martin Owens <doctormo@...400...>:
The only regression from that to this is that it now fails to open files with both system entities and ns record entity replacement. replacing system with spaces allowed libxml2 to parse the entity as if it were a literal. But I'm not touching that regex, it's perfect enough for me.
Ah, I missed that part. Here is a small tweak which fixes that:
GRegex *entity_regex = g_regex_new("(<!ENTITY\\s+[^>\s]+\s+)SYSTEM\s+("[^>"]+"\s*>)", G_REGEX_CASELESS, 0, NULL); gchar *fixed_buffer = g_regex_replace(entity_regex, buffer, len, 0, "\1\2", 0, NULL); g_regex_unref(entity_regex);
Regards, Krzysztof