From 2e58938404c7c54c741d976816d304cc8447cc56 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Mon, 4 Feb 2019 09:35:32 +0100 Subject: [PATCH] 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. This is a cherry pick from qtbase commit 4b4a288f5f88077d647d47e9bdd911edf6cdca72 Fixes: QTCREATORBUG-21881 Written-by: Edward Welbourne Change-Id: I3084b87c1d3ca6508255e94e04ac8db3ceaebb7e Reviewed-by: Nikolai Kosjar --- src/shared/proparser/ioutils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/proparser/ioutils.cpp b/src/shared/proparser/ioutils.cpp index 0552bd10972..f678ea9fb03 100644 --- a/src/shared/proparser/ioutils.cpp +++ b/src/shared/proparser/ioutils.cpp @@ -75,7 +75,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;