diff options
Diffstat (limited to 'src/libs/utils/qtcprocess.cpp')
| -rw-r--r-- | src/libs/utils/qtcprocess.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index e730fd98cf..6c54a9cb00 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -568,7 +568,10 @@ QString QtcProcess::quoteArg(const QString &arg) // The argument must not end with a \ since this would be interpreted // as escaping the quote -- rather put the \ behind the quote: e.g. // rather use "foo"\ than "foo\" - ret.replace(QRegExp(QLatin1String("(\\\\*)$")), QLatin1String("\"\\1")); + int i = ret.length(); + while (i > 0 && ret.at(i - 1) == QLatin1Char('\\')) + --i; + ret.insert(i, QLatin1Char('"')); ret.prepend(QLatin1Char('"')); } // FIXME: Without this, quoting is not foolproof. But it needs support in the process setup, etc. |
