From 0f647796788494947632c0874931e4d84bccad46 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 28 Aug 2017 11:14:42 +0300 Subject: resolveSymlinks: Fix relative symbolic links on Windows Works around QTBUG-62802. When a (real, not lnk) symbolic link on Windows references a relative path, the absolute path is not resolved. Using a QFileInfo with this relative path will reference the path relative to the PWD instead of relative to the link. Change-Id: I2edacb6d368e28fa240e7a866692391cf67f0ca2 Reviewed-by: Joerg Bornemann --- src/lib/corelib/tools/fileinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/corelib/tools/fileinfo.cpp b/src/lib/corelib/tools/fileinfo.cpp index f8c7115fc..3e2f0d36c 100644 --- a/src/lib/corelib/tools/fileinfo.cpp +++ b/src/lib/corelib/tools/fileinfo.cpp @@ -328,7 +328,7 @@ static QString resolveSymlinks(const QString &fileName) { QFileInfo fi(fileName); while (fi.isSymLink()) - fi.setFile(fi.symLinkTarget()); + fi.setFile(fi.dir(), fi.symLinkTarget()); return fi.absoluteFilePath(); } -- cgit v1.2.3