From 5dcb108a1b8f267888ba36ee3c6e3a2dfcbd75c3 Mon Sep 17 00:00:00 2001 From: ankit Date: Mon, 27 Apr 2009 11:41:53 +0000 Subject: [PATCH] * Vbc.cs (AddResponseFileCommands): Escape DefineConstants as it can contain double quotes itself. Fix /doc switch. (EscapeDoubleQuotes): New. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@132722 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- .../Microsoft.Build.Tasks/ChangeLog | 6 ++++++ class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog b/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog index c700c87436..954a955320 100644 --- a/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog +++ b/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog @@ -1,3 +1,9 @@ +2009-04-27 Ankit Jain + + * Vbc.cs (AddResponseFileCommands): Escape DefineConstants as it can + contain double quotes itself. Fix /doc switch. + (EscapeDoubleQuotes): New. + 2009-03-22 Daniel Nauck * GenerateResource.cs: Set BasePath property of diff --git a/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs b/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs index 07a081e160..60f6790b3d 100644 --- a/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs +++ b/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs @@ -30,6 +30,8 @@ using System; using System.IO; +using System.Text; + using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -51,11 +53,13 @@ namespace Microsoft.Build.Tasks { commandLine.AppendSwitchIfNotNull ("/baseaddress:", BaseAddress); - commandLine.AppendSwitchIfNotNull ("/define:", DefineConstants); + if (DefineConstants != null) + commandLine.AppendSwitchUnquotedIfNotNull ("/define:", + String.Format ("\"{0}\"", EscapeDoubleQuotes (DefineConstants))); // DisabledWarnings - commandLine.AppendSwitchIfNotNull ("/doc", DocumentationFile); + commandLine.AppendSwitchIfNotNull ("/doc:", DocumentationFile); // ErrorReport @@ -117,6 +121,14 @@ namespace Microsoft.Build.Tasks { // WarningsNotAsErrors } + + string EscapeDoubleQuotes (string text) + { + if (text == null) + return null; + + return text.Replace ("\"", "\\\""); + } [MonoTODO] protected override bool CallHostObjectToExecute () -- 2.11.4.GIT