From f3deacb9edf20625f3c62574addea4132b14de60 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 17 Apr 2013 15:52:21 +0200 Subject: [PATCH] rules/selection: use strrchr in EVR checks as well --- src/rules.c | 2 +- src/selection.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.3