[Mono-dev] monowrap.cs patch
Miguel de Icaza
miguel at novell.com
Mon Dec 28 19:21:12 EST 2009
Hello Lucas,
This patch looks good, can you commit?
On Dec 27, 2009, at 7:50 AM, Lucas Meijer wrote:
> Hey,
>
> The attached patch makes monowrap work on windows machines whose user has a space in its name. It turns out MSBuild places its responsefile in the users' temp folder, which almost always will have a space in its name (C:\Users\Lucas Meijer\Temp).
>
> The patch assumes that when it finds a "@" in the compiler arguments, everything that follows after that is going to be the responsefile, and inserts quotes so that the real mcs.exe won't trip up over them.
>
> Bye, Lucas
>
> PS Not sure if you need it for simple patches like this, but fwiw, it's released under MIT-X11 license.
> Index: monowrap.cs
> ===================================================================
> --- monowrap.cs (revision 148912)
> +++ monowrap.cs (working copy)
> @@ -115,12 +115,19 @@
> }
> Environment.SetEnvironmentVariable ("MONO_PATH", sb.ToString ());
>
> + string compilerargs = compiler + " " + String.Join (" ", args);
> + int responseFileStart = compilerargs.IndexOf("@");
> + if (responseFileStart!=-1)
> + compilerargs = compilerargs.Insert(responseFileStart+1,"\"") + '\"';
> +
> Console.WriteLine ("Compiler: {0}", compiler);
> Console.WriteLine ("MONO_PATH: {0}", sb.ToString ());
> + Console.WriteLine ("Arguments: {0}", compilerargs);
> +
> var pi = new ProcessStartInfo() {
> FileName = mono_cmd,
> WindowStyle = ProcessWindowStyle.Hidden,
> - Arguments = compiler + " " + String.Join (" ", args),
> + Arguments = compilerargs,
> UseShellExecute = false
> };
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list