Skip to content

Commit 4a19149

Browse files
committed
common: Do not dereference symlink when checking existence
1 parent 2b29c7e commit 4a19149

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/filesystembase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,13 @@ bool FileSystem::fileExists(const QString &filename, const QFileInfo &fileInfo)
312312
return fileExistsWin(filename);
313313
}
314314
#endif
315-
bool re = fileInfo.exists();
315+
bool re = fileInfo.exists() || fileInfo.isSymLink();
316316
// if the filename is different from the filename in fileInfo, the fileInfo is
317317
// not valid. There needs to be one initialised here. Otherwise the incoming
318318
// fileInfo is re-used.
319319
if (fileInfo.filePath() != filename) {
320320
QFileInfo myFI(filename);
321-
re = myFI.exists();
321+
re = myFI.exists() || myFI.isSymLink();
322322
}
323323
return re;
324324
}

0 commit comments

Comments
 (0)