The full path needs to resolved any time it ends with "." or "..", not
just when those are the entire path.  This allows strange-but-valid
paths such as: "/home/." to be queried.

Signed-off-by: Andrew Gregory <[email protected]>
---
 src/pacman/query.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pacman/query.c b/src/pacman/query.c
index 1b6e14c..819a571 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -102,7 +102,7 @@ static char *lrealpath(const char *path, char 
*resolved_path)
        char *rpath = NULL, *dname = NULL;
        int success = 0;
 
-       if(strcmp(path, ".") == 0 || strcmp(path, "..") == 0) {
+       if(strcmp(bname, ".") == 0 || strcmp(bname, "..") == 0) {
                /* the entire path needs to be resolved */
                return realpath(path, resolved_path);
        }
-- 
1.8.3.1


Reply via email to