From 07352531395a16b18f564cbe07084d9c26d9e321 Mon Sep 17 00:00:00 2001 From: Anthony Heading Date: Sat, 31 Dec 2016 20:34:38 -0500 Subject: [PATCH] Fix off-by-one error which stops qtchooser finding qmake At startup, qtcreator prints an error: % qtcreator "The command \"/qmake\" could not be started." This appears to be because of an off-by-one error in BuildableHelperLibrary::qtChooserToQmakePath(const QString &path) which parses the output of a call to "qtchooser -print-env" to extract the value of the QTTOOLDIR variable. The code attempts to move past the prefix string to find the end quote, but by moving one too few characters it finds the starting quote instead, resulting in a zero length string result. Change-Id: I74368f10a81eda2286ae735bdc595c0f92e4e665 Reviewed-by: Tobias Hunger Reviewed-by: Eike Ziller --- src/libs/utils/buildablehelperlibrary.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp index 6e56ef97887..c46b4b85020 100644 --- a/src/libs/utils/buildablehelperlibrary.cpp +++ b/src/libs/utils/buildablehelperlibrary.cpp @@ -50,7 +50,7 @@ QString BuildableHelperLibrary::qtChooserToQmakePath(const QString &path) int pos = output.indexOf(toolDir); if (pos == -1) return QString(); - pos += toolDir.count() - 1; + pos += toolDir.count(); int end = output.indexOf('\"', pos); if (end == -1) return QString();