CompilationDatabase: Fix escaped quotes handling

Change-Id: Iaecd38f921bd719899e478a76d8a8b9d4230a7cc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-10-31 12:38:22 +01:00
parent 1442a1186d
commit cb9df98efb

View File

@@ -57,12 +57,14 @@ public:
{} {}
}; };
static QStringList splitCommandLine(const QString &line) static QStringList splitCommandLine(QString commandLine)
{ {
QStringList result; QStringList result;
bool insideQuotes = false; bool insideQuotes = false;
for (const QString &part : line.split(QRegularExpression("\""))) { // Remove escaped quotes.
commandLine.replace("\\\"", "'");
for (const QString &part : commandLine.split(QRegularExpression("\""))) {
if (insideQuotes) { if (insideQuotes) {
const QString quotedPart = "\"" + part + "\""; const QString quotedPart = "\"" + part + "\"";
if (result.last().endsWith("=")) if (result.last().endsWith("="))