Commit 0481d536 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Fix raw string literal and add missing include

We need to disambiguate the character sequence that terminates the raw
string literal used for the regular expression.

This fixes the Windows build.

Fixes-commit: 0b7faa91
parent 3b2cd0ae
Pipeline #183733 passed with stage
in 2 minutes and 4 seconds
......@@ -15,6 +15,7 @@
#include <windows.h>
#include <QDir>
#include <QRegularExpression>
/* This is the amount of data GPGME reads at once */
#define PIPEBUF_SIZE 16384
......@@ -291,7 +292,7 @@ static QString qt_create_commandline(const QString &program, const QStringList &
for (int i=0; i<arguments.size(); ++i) {
QString tmp = arguments.at(i);
// Quotes are escaped and their preceding backslashes are doubled.
tmp.replace(QRegularExpression(QLatin1String(R"((\\*)")")), QLatin1String(R"(\1\1\")"));
tmp.replace(QRegularExpression(QLatin1String(R"--((\\*)")--")), QLatin1String(R"--(\1\1\")--"));
if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) {
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment