]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
be more tolerant about bad xml: an empty epoch attribute means no epoch
authorMichael Schroeder <mls@suse.de>
Thu, 4 Jul 2013 15:49:47 +0000 (17:49 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 4 Jul 2013 15:49:47 +0000 (17:49 +0200)
ext/repo_deltainfoxml.c
ext/repo_helix.c
ext/repo_rpmmd.c
ext/repo_updateinfoxml.c

index 6b1113f6f47582e524425b1aa224470419be6556..69403e825daa5a66732fc0e237e6aa3469be7d0c 100644 (file)
@@ -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)
     {
index 0da7c2a12b9d88112d3f2267eca67d0838e02c35..d2e50e813e9809064869cf0bd4076073c86e9fa9 100644 (file)
@@ -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)
     {
index 1a92ad72cf2121f971e827bee050de631e01c43c..8ee11f4dbbe4638ff6c882ecaeab0acec013c3c5 100644 (file)
@@ -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)
     {
index e4707fca77c29cef62cd52bdb672344b6168fdd3..6af74f220ff26b8ccd5aa82cd8e0458d80beb611 100644 (file)
@@ -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)
     {