From: ewt Date: Mon, 15 Apr 1996 21:06:26 +0000 (+0000) Subject: queries relative paths correctly (thanks to Johnie Stafford) X-Git-Tag: rpm-4.4-release~5200 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29414279b610f56c8e1e491c6ebb0bdad6352a0c;p=platform%2Fupstream%2Frpm.git queries relative paths correctly (thanks to Johnie Stafford) CVS patchset: 535 CVS date: 1996/04/15 21:06:26 --- diff --git a/query.c b/query.c index c6759cc..d96982c 100644 --- a/query.c +++ b/query.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "lib/messages.h" @@ -478,6 +479,11 @@ int doQuery(char * prefix, enum querysources source, int queryFlags, case QUERY_SPATH: case QUERY_PATH: + if (*arg != '/') { + char path[255]; + if (realpath(arg, path) != NULL) + arg = path; + } if (rpmdbFindByFile(db, arg, &matches)) { fprintf(stderr, "file %s is not owned by any package\n", arg); retcode = 1;