Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

WinSW should handle whitespace in the argument correctly

Cherry picked 83380bd
  • Loading branch information...
commit 088cfd232a518d5612b2df713ea953d6e098d553 1 parent a5da052
@kohsuke authored
Showing with 17 additions and 2 deletions.
  1. +17 −2 ServiceDescriptor.cs
View
19 ServiceDescriptor.cs
@@ -157,7 +157,7 @@ public string Stoparguments
/// <summary>
/// Combines the contents of all the elements of the given name,
- /// or return null if no element exists.
+ /// or return null if no element exists. Handles whitespace quotatoin.
/// </summary>
private string AppendTags(string tagName)
{
@@ -173,7 +173,22 @@ private string AppendTags(string tagName)
foreach (XmlNode argument in dom.SelectNodes("//" + tagName))
{
- arguments += " " + argument.InnerText;
+ string token = argument.InnerText;
+
+ if (token.StartsWith("\"") && token.EndsWith("\""))
+ {
+ // for backward compatibility, if the argument is already quoted, leave it as is.
+ // in earlier versions we didn't handle quotation, so the user might have worked
+ // around it by themselves
+ }
+ else
+ {
+ if (token.Contains(" "))
+ {
+ token = '"' + token + '"';
+ }
+ }
+ arguments += " " + token;
}
return Environment.ExpandEnvironmentVariables(arguments);
Please sign in to comment.
Something went wrong with that request. Please try again.