diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2017-08-28 11:14:42 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2017-08-28 11:20:23 +0000 |
commit | 0f647796788494947632c0874931e4d84bccad46 (patch) | |
tree | 027616efdeb69bbb93af36166278c00fc3acb947 | |
parent | 8f637095c4247aaf1cc9d1998b749f21dfd46a7c (diff) |
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 <joerg.bornemann@qt.io>
-rw-r--r-- | src/lib/corelib/tools/fileinfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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(); } |