diff options
author | Michael Schroeder <mls@suse.de> | 2012-10-08 15:25:31 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-10-08 15:25:31 +0200 |
commit | ee4fa1bef4127b860cf1c8d142da7e70e08f2a1f (patch) | |
tree | 0b20dcbb6a4d49dbc38b8d82a816cbb585b5c0b2 /src/repodata.c | |
parent | 6af0f8f8cc46636f39552d5a0e9a3f708a04ddb2 (diff) | |
download | libsolv-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.c | 13 |
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 |