X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=ext%2Frepo_repomdxml.c;h=46d83615b64023fd29e47eb630cea677dca3f7a2;hb=d4334b3ee7ce4f5c736d3bda979388a87ba7aef3;hp=760d481f9fe08bb325483a2f51023007e97d42ac;hpb=2491213c77850ed26991b572809a5ca4a61fa89b;p=platform%2Fupstream%2Flibsolv.git diff --git a/ext/repo_repomdxml.c b/ext/repo_repomdxml.c index 760d481..46d8361 100644 --- a/ext/repo_repomdxml.c +++ b/ext/repo_repomdxml.c @@ -181,7 +181,7 @@ startElement(struct solv_xmlparser *xmlp, int state, const char *name, const cha while (value) { char *p = strchr(value, ','); - if (*p) + if (p) *p++ = 0; if (*value) repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_UPDATES, value); @@ -329,13 +329,6 @@ endElement(struct solv_xmlparser *xmlp, int state, char *content) } } -static void -errorCallback(struct solv_xmlparser *xmlp, const char *errstr, unsigned int line, unsigned int column) -{ - struct parsedata *pd = xmlp->userdata; - pd->ret = pool_error(pd->pool, -1, "repo_repomdxml: %s at line %u:%u", errstr, line, column); -} - int repo_add_repomdxml(Repo *repo, FILE *fp, int flags) { @@ -350,9 +343,9 @@ repo_add_repomdxml(Repo *repo, FILE *fp, int flags) pd.pool = pool; pd.repo = repo; pd.data = data; - solv_xmlparser_init(&pd.xmlp, stateswitches, &pd, startElement, endElement, errorCallback); - - solv_xmlparser_parse(&pd.xmlp, fp); + solv_xmlparser_init(&pd.xmlp, stateswitches, &pd, startElement, endElement); + if (solv_xmlparser_parse(&pd.xmlp, fp) != SOLV_XMLPARSER_OK) + pd.ret = pool_error(pd.pool, -1, "repo_repomdxml: %s at line %u:%u", pd.xmlp.errstr, pd.xmlp.line, pd.xmlp.column); solv_xmlparser_free(&pd.xmlp); if (!(flags & REPO_NO_INTERNALIZE))