fix c-quoting of strings which contain quotes

escape backslashes before the quotes, as otherwise we'd escape the
backslashes we just used to escape the quotes.

Change-Id: I88e12c0c2cfc53e0ab8dce9807b06dfce6aa6e78
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-07-17 16:15:17 +02:00 committed by The Qt Project
parent f57e2f5667
commit ff6265bfc2

View File

@ -899,8 +899,8 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const
QString Win32MakefileGenerator::cQuoted(const QString &str)
{
QString ret = str;
ret.replace(QLatin1Char('"'), QStringLiteral("\\\""));
ret.replace(QLatin1Char('\\'), QStringLiteral("\\\\"));
ret.replace(QLatin1Char('"'), QStringLiteral("\\\""));
ret.prepend(QLatin1Char('"'));
ret.append(QLatin1Char('"'));
return ret;