diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-09-14 17:29:13 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-18 00:59:08 +0200 |
commit | 53ab67cdfe66693b27789282afc099d4dcffd4fa (patch) | |
tree | 2c4bac9a942b9f50fff896cf5f447090ea71bba3 /qmake | |
parent | d113faefb8a778a5af4f91d32c5fc41b6521453d (diff) |
properly C-quote the manifest file name in the rc file
Change-Id: I8c8eb85d412becc8c4029c2aa393abf6f8e949b6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index bd5ead6617..ba490a9dfb 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -355,6 +355,16 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) } +static QString cQuoted(const QString &str) +{ + QString ret = str; + ret.replace(QLatin1Char('"'), QStringLiteral("\\\"")); + ret.replace(QLatin1Char('\\'), QStringLiteral("\\\\")); + ret.prepend(QLatin1Char('"')); + ret.append(QLatin1Char('"')); + return ret; +} + void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) { const ProString templateName = project->first("TEMPLATE"); @@ -396,7 +406,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) project->values("QMAKE_CLEAN") << manifest_rc << manifest_res; t << "\n\techo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ " - << '"' << QFileInfo(unescapeFilePath(manifest)).fileName() << "\">" << manifest_rc; + << cQuoted(QFileInfo(unescapeFilePath(manifest)).fileName()) << ">" << manifest_rc; if (generateManifest) { t << "\n\tif not exist $(DESTDIR_TARGET) del " << manifest << ">NUL 2>&1"; |