mirror of https://github.com/winsw/winsw
parent
a5da052192
commit
088cfd232a
|
@ -157,7 +157,7 @@ namespace winsw
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Combines the contents of all the elements of the given name,
|
/// 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>
|
/// </summary>
|
||||||
private string AppendTags(string tagName)
|
private string AppendTags(string tagName)
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,22 @@ namespace winsw
|
||||||
|
|
||||||
foreach (XmlNode argument in dom.SelectNodes("//" + 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);
|
return Environment.ExpandEnvironmentVariables(arguments);
|
||||||
|
|
Loading…
Reference in New Issue