forked from qt-creator/qt-creator
Proparser: Don't crash on accidental remote files
Change-Id: I62ca1b17436fce21d582816388db497d82df6582 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -48,6 +48,18 @@ using namespace QMakeInternal;
|
|||||||
|
|
||||||
IoUtils::FileType IoUtils::fileType(const QString &fileName)
|
IoUtils::FileType IoUtils::fileType(const QString &fileName)
|
||||||
{
|
{
|
||||||
|
// FIXME:
|
||||||
|
if (fileName.startsWith("docker:/")) {
|
||||||
|
if (!fileName.startsWith("docker://"))
|
||||||
|
qWarning("File name not canonical");
|
||||||
|
int pos = fileName.indexOf('/', 10);
|
||||||
|
if (pos == 0) {
|
||||||
|
qWarning("File name not canonical");
|
||||||
|
return FileNotFound;
|
||||||
|
}
|
||||||
|
return fileType(fileName.mid(pos));
|
||||||
|
}
|
||||||
|
|
||||||
Q_ASSERT(fileName.isEmpty() || isAbsolutePath(fileName));
|
Q_ASSERT(fileName.isEmpty() || isAbsolutePath(fileName));
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
DWORD attr = GetFileAttributesW((WCHAR*)fileName.utf16());
|
DWORD attr = GetFileAttributesW((WCHAR*)fileName.utf16());
|
||||||
|
Reference in New Issue
Block a user