Skip to content

Instantly share code, notes, and snippets.

@alanmcgovern
Created January 3, 2012 14:12
Show Gist options
  • Save alanmcgovern/1555024 to your computer and use it in GitHub Desktop.
Save alanmcgovern/1555024 to your computer and use it in GitHub Desktop.
commit 7c31899ccf3c04e4e477dc0a6be3987ba6dc3452
Author: Alan McGovern <alan.mcgovern@gmail.com>
Date: Thu Dec 22 19:05:13 2011 +0000
WIP: Incomplete - [IPhone] Quote the extra mtouch args
Fix for bug #554.
diff --git a/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneBuildExtension.cs b/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneBuildExtension.cs
index cc465e0..21eafb1 100644
--- a/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneBuildExtension.cs
+++ b/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneBuildExtension.cs
@@ -633,15 +633,21 @@ namespace MonoDevelop.IPhone
static void AddExtraArgs (ProcessArgumentBuilder args, string extraArgs, IPhoneProject proj,
IPhoneProjectConfiguration conf)
{
+ Func<string> quote = s => {
+ if (s.Contains (" "))
+ return ProcessArgumentBuilder.Quote (s);
+ return s;
+ };
+
if (!string.IsNullOrEmpty (extraArgs)) {
var customTags = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase) {
- { "projectdir", proj.BaseDirectory },
- { "solutiondir", proj.ParentSolution.BaseDirectory },
- { "appbundledir", conf.AppDirectory },
- { "targetpath", conf.CompiledOutputName },
- { "targetdir", conf.CompiledOutputName.ParentDirectory },
- { "targetname", conf.CompiledOutputName.FileName },
- { "targetext", conf.CompiledOutputName.Extension },
+ { "projectdir", quote (proj.BaseDirectory) },
+ { "solutiondir", quote (proj.ParentSolution.BaseDirectory) },
+ { "appbundledir", quote (conf.AppDirectory) },
+ { "targetpath", quote (conf.CompiledOutputName) },
+ { "targetdir", quote (conf.CompiledOutputName.ParentDirectory) },
+ { "targetname", quote (conf.CompiledOutputName.FileName) },
+ { "targetext", quote (conf.CompiledOutputName.Extension) },
};
args.Add (StringParserService.Parse (extraArgs, customTags));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment