forked from qt-creator/qt-creator
CompilationDatabase: Fix escaped quotes handling
Change-Id: Iaecd38f921bd719899e478a76d8a8b9d4230a7cc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -57,12 +57,14 @@ public:
|
||||
{}
|
||||
};
|
||||
|
||||
static QStringList splitCommandLine(const QString &line)
|
||||
static QStringList splitCommandLine(QString commandLine)
|
||||
{
|
||||
QStringList result;
|
||||
bool insideQuotes = false;
|
||||
|
||||
for (const QString &part : line.split(QRegularExpression("\""))) {
|
||||
// Remove escaped quotes.
|
||||
commandLine.replace("\\\"", "'");
|
||||
for (const QString &part : commandLine.split(QRegularExpression("\""))) {
|
||||
if (insideQuotes) {
|
||||
const QString quotedPart = "\"" + part + "\"";
|
||||
if (result.last().endsWith("="))
|
||||
|
Reference in New Issue
Block a user