mirror of
https://github.com/holub/mame
synced 2025-05-22 21:58:57 +03:00
Better error handling for softlists (no whatsnew)
This commit is contained in:
parent
ae7b304f9b
commit
24ee0f0d2f
@ -911,6 +911,19 @@ static void data_handler(void *data, const XML_Char *s, int len)
|
|||||||
memcpy(&text[text_len], s, len);
|
memcpy(&text[text_len], s, len);
|
||||||
text[text_len + len] = '\0';
|
text[text_len + len] = '\0';
|
||||||
*swlist->state.text_dest = text;
|
*swlist->state.text_dest = text;
|
||||||
|
} else {
|
||||||
|
if (swlist->state.error_proc)
|
||||||
|
{
|
||||||
|
int errcnt = 0;
|
||||||
|
for (int i=0;i<len;i++) {
|
||||||
|
if (!(s[i]=='\t' || s[i]=='\n' || s[i]=='\r' || s[i]==' ')) errcnt++;
|
||||||
|
}
|
||||||
|
if (errcnt>0) {
|
||||||
|
parse_error(&swlist->state, "%s: Unknown content (line %lu)\n",
|
||||||
|
swlist->file->filename(),
|
||||||
|
XML_GetCurrentLineNumber(swlist->state.parser));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user