From: Michael Schroeder Date: Wed, 17 Apr 2013 13:52:21 +0000 (+0200) Subject: rules/selection: use strrchr in EVR checks as well X-Git-Tag: BASE-SuSE-Code-12_3-Branch~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3deacb9edf20625f3c62574addea4132b14de60;p=thirdparty%2Flibsolv.git rules/selection: use strrchr in EVR checks as well --- diff --git a/src/rules.c b/src/rules.c index 9307394d..b191268b 100644 --- a/src/rules.c +++ b/src/rules.c @@ -1608,7 +1608,7 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q) { if (pool->disttype != DISTTYPE_DEB) { - const char *rel = strchr(pool_id2str(pool, rd->evr), '-'); + const char *rel = strrchr(pool_id2str(pool, rd->evr), '-'); if (rel && pool->disttype == DISTTYPE_HAIKU && (rel[1] < '0' || rel[1] > '9')) rel = 0; set |= rel ? SOLVER_SETEVR : SOLVER_SETEV; diff --git a/src/selection.c b/src/selection.c index 2b9d4344..df09b5f1 100644 --- a/src/selection.c +++ b/src/selection.c @@ -218,7 +218,7 @@ selection_filter_rel(Pool *pool, Queue *selection, Id relflags, Id relevr) selection->elements[i] |= SOLVER_SETEVR; /* debian can't match version only like rpm */ else { - const char *rel = strchr(pool_id2str(pool, relevr), '-'); + const char *rel = strrchr(pool_id2str(pool, relevr), '-'); if (rel && pool->disttype == DISTTYPE_HAIKU && (rel[1] < '0' || rel[1] > '9')) rel = 0; selection->elements[i] |= rel ? SOLVER_SETEVR : SOLVER_SETEV;