summaryrefslogtreecommitdiff
path: root/src/repodata.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-10-08 15:25:31 +0200
committerMichael Schroeder <mls@suse.de>2012-10-08 15:25:31 +0200
commitee4fa1bef4127b860cf1c8d142da7e70e08f2a1f (patch)
tree0b20dcbb6a4d49dbc38b8d82a816cbb585b5c0b2 /src/repodata.c
parent6af0f8f8cc46636f39552d5a0e9a3f708a04ddb2 (diff)
downloadlibsolv-ee4fa1bef4127b860cf1c8d142da7e70e08f2a1f.tar.gz
libsolv-ee4fa1bef4127b860cf1c8d142da7e70e08f2a1f.tar.bz2
libsolv-ee4fa1bef4127b860cf1c8d142da7e70e08f2a1f.zip
use evrid2vrstr inline function
Diffstat (limited to 'src/repodata.c')
-rw-r--r--src/repodata.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/repodata.c b/src/repodata.c
index 1574eb5..d2e56f2 100644
--- a/src/repodata.c
+++ b/src/repodata.c
@@ -2221,7 +2221,7 @@ evrid2vrstr(Pool *pool, Id evrid)
return evr;
for (p = evr; *p >= '0' && *p <= '9'; p++)
;
- return p != evr && *p == ':' ? p + 1 : evr;
+ return p != evr && *p == ':' && p[1] ? p + 1 : evr;
}
void
@@ -2331,16 +2331,7 @@ repodata_set_sourcepkg(Repodata *data, Id solvid, const char *sourcepkg)
else
repodata_set_id(data, solvid, SOLVABLE_SOURCENAME, pool_strn2id(pool, sourcepkg, sevr - sourcepkg - 1, 1));
- evr = pool_id2str(pool, s->evr);
- if (evr)
- {
- /* strip epoch */
- const char *pp;
- for (pp = evr; *pp >= '0' && *pp <= '9'; pp++)
- ;
- if (*pp == ':' && pp[1])
- evr = pp + 1;
- }
+ evr = evrid2vrstr(pool, s->evr);
if (evr && !strncmp(sevr, evr, sarch - sevr - 1) && evr[sarch - sevr - 1] == 0)
repodata_set_void(data, solvid, SOLVABLE_SOURCEEVR);
else