From 4b4a288f5f88077d647d47e9bdd911edf6cdca72 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 5 Feb 2019 10:45:38 +0100 Subject: Recognize UNC paths as absolute (i.e. not relative) IoUtils::isRelativePath() didn't attempt to consider UNC paths, due to a belief that qmake fails on them so badly that it wasn't worth the extra code. However, it turns out Qt Creator's copy of this code does need to take this into account, so start the change off in qmake's version so as to keep in sync. Task-number: QTCREATORBUG-21881 Change-Id: I3084b87c1d3ca6508255e94e04ac8db3ceaebb7e Reviewed-by: Joerg Bornemann --- qmake/library/ioutils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index 2b2c6d0078..3e49a99cd5 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -77,7 +77,12 @@ bool IoUtils::isRelativePath(const QString &path) && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) { return false; } - // (... unless, of course, they're UNC, which qmake fails on anyway) + // ... unless, of course, they're UNC: + if (path.length() >= 2 + && (path.at(0).unicode() == '\\' || path.at(0).unicode() == '/') + && path.at(1) == path.at(0)) { + return false; + } #else if (path.startsWith(QLatin1Char('/'))) return false; -- cgit v1.2.3