summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2010-06-03 14:54:31 (GMT)
committerZeno Albisser <zeno.albisser@nokia.com>2010-06-04 11:25:36 (GMT)
commitdbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180 (patch)
treedb88608b8efcbeccf650fb40cebf81d061fb2b17 /src/corelib
parentbe627ce374da1e192c740a6b59f4bab6b12798c3 (diff)
downloadQt-dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180.zip
Qt-dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180.tar.gz
Qt-dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180.tar.bz2
fix for using .lnk files when running app from UNC
Since "" is an invalid target for a .lnk file, we can return false for doStat() in case of resolving the .lnk to "". Notice that .lnk files only allow absolute paths for the target. "" is returned by readLink in case the .lnk file does not exist. Reviewed-by: Joao Task-Number: QTBUG-10863
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index ec49f1a..21930e1 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -1162,7 +1162,15 @@ bool QFSFileEnginePrivate::doStat() const
if (filePath.isEmpty())
return could_stat;
- QString fname = filePath.endsWith(QLatin1String(".lnk")) ? readLink(filePath) : filePath;
+ QString fname;
+ if(filePath.endsWith(QLatin1String(".lnk"))) {
+ fname = readLink(filePath);
+ if(fname.isEmpty())
+ return could_stat;
+ }
+ else
+ fname = filePath;
+
fname = fixIfRelativeUncPath(fname);
UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);