};
struct parsedata {
+ const char *filename;
int depth;
enum state state;
int statedepth;
l = fread(buf, 1, sizeof(buf), fp);
if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR)
{
- fprintf(stderr, "repo_products: %s at line %u:%u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
- exit(1);
+ fprintf(stderr, "%s: %s at line %u:%u\n", pd->filename, XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
+ fprintf(stderr, "Skipping this product\n");
+ return;
}
if (l == 0)
break;
perror(fullpath);
break;
}
+ pd->filename = fullpath;
repo_add_product(pd, fp, code11);
fclose(fp);
}