From: Michael Schroeder Date: Thu, 4 Jul 2013 15:49:47 +0000 (+0200) Subject: be more tolerant about bad xml: an empty epoch attribute means no epoch X-Git-Tag: BASE-SuSE-Code-13_1-Branch~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8446c7a4d461fe6db107b7f75d43845cf55ddde7;p=thirdparty%2Flibsolv.git be more tolerant about bad xml: an empty epoch attribute means no epoch --- diff --git a/ext/repo_deltainfoxml.c b/ext/repo_deltainfoxml.c index 6b1113f6..69403e82 100644 --- a/ext/repo_deltainfoxml.c +++ b/ext/repo_deltainfoxml.c @@ -157,7 +157,7 @@ makeevr_atts(Pool *pool, struct parsedata *pd, const char **atts) else if (!strcmp(*atts, "oldrelease")) r = atts[1]; } - if (e && !strcmp(e, "0")) + if (e && (!*e || !strcmp(e, "0"))) e = 0; if (v && !e) { diff --git a/ext/repo_helix.c b/ext/repo_helix.c index 0da7c2a1..d2e50e81 100644 --- a/ext/repo_helix.c +++ b/ext/repo_helix.c @@ -187,8 +187,8 @@ evr2id(Pool *pool, Parsedata *pd, const char *e, const char *v, const char *r) int l; /* treat explitcit 0 as NULL */ - if (e && !strcmp(e, "0")) - e = NULL; + if (e && (!*e || !strcmp(e, "0"))) + e = 0; if (v && !e) { diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c index 1a92ad72..8ee11f4d 100644 --- a/ext/repo_rpmmd.c +++ b/ext/repo_rpmmd.c @@ -378,7 +378,7 @@ makeevr_atts(Pool *pool, struct parsedata *pd, const char **atts) else if (!strcmp(*atts, "rel")) r = atts[1]; } - if (e && !strcmp(e, "0")) + if (e && (!*e || !strcmp(e, "0"))) e = 0; if (v && !e) { diff --git a/ext/repo_updateinfoxml.c b/ext/repo_updateinfoxml.c index e4707fca..6af74f22 100644 --- a/ext/repo_updateinfoxml.c +++ b/ext/repo_updateinfoxml.c @@ -174,7 +174,7 @@ makeevr_atts(Pool *pool, struct parsedata *pd, const char **atts) else if (!strcmp(*atts, "release")) r = atts[1]; } - if (e && !strcmp(e, "0")) + if (e && (!*e || !strcmp(e, "0"))) e = 0; if (v && !e) {