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 6b1113f..69403e8 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 0da7c2a..d2e50e8 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 1a92ad7..8ee11f4 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 e4707fc..6af74f2 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)
     {