diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-05-31 08:38:09 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-05-31 08:41:18 +0300 |
commit | 31fabc4d035af1b230184e52276cb793ec92721c (patch) | |
tree | 84f4d3ed8edc972844ec687f05ac8a0249abd5a5 | |
parent | da642c3130aa6cc3c7edc92e7273dcfe3100b3eb (diff) | |
download | librpm-tizen-31fabc4d035af1b230184e52276cb793ec92721c.tar.gz librpm-tizen-31fabc4d035af1b230184e52276cb793ec92721c.tar.bz2 librpm-tizen-31fabc4d035af1b230184e52276cb793ec92721c.zip |
Remove bogus condition on provide checking in query
- RPMQV_WHATPROVIDES only falls through to RPMQV_PATH on absolute
paths, so the only place checking for provides_checked value would
never be reached in the case it was set.
- Add a comment about the fallthrough case
-rw-r--r-- | lib/query.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/query.c b/lib/query.c index ce9a6b16d..3d5b7f2ef 100644 --- a/lib/query.c +++ b/lib/query.c @@ -301,7 +301,6 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar { const char * s; int i; - int provides_checked = 0; rpmdbMatchIterator mi = NULL; (void) rpmdbCheckSignals(); @@ -386,13 +385,13 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar case RPMQV_WHATPROVIDES: if (arg[0] != '/') { - provides_checked = 1; mi = rpmtsInitIterator(ts, RPMDBI_PROVIDENAME, arg, 0); if (mi == NULL) { rpmlog(RPMLOG_NOTICE, _("no package provides %s\n"), arg); } break; } + /* fallthrough on absolute paths */ case RPMQV_PATH: { char * fn; @@ -413,7 +412,7 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar (void) rpmCleanPath(fn); mi = rpmtsInitIterator(ts, RPMDBI_BASENAMES, fn, 0); - if (mi == NULL && !provides_checked) + if (mi == NULL) mi = rpmtsInitIterator(ts, RPMDBI_PROVIDENAME, fn, 0); if (mi == NULL) { |