From 08e877842da88409f32917993f310c834ae652b6 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 9 Feb 2010 19:10:16 +0000 Subject: [PATCH 1/5] this is a single element git-svn-id: https://svn.kenai.com/svn/winsw~subversion/trunk@42 c8b2a3fe-9b5b-6a51-a37e-dc31b0e308fa --- Main.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.cs b/Main.cs index 4b6f25b..9959842 100644 --- a/Main.cs +++ b/Main.cs @@ -117,7 +117,7 @@ namespace winsw { get { - return AppendTags("stopexecutable"); + return SingleElement("stopexecutable"); } } From 83380bdd9b801d82022ca58d9637300494f1ee8b Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 9 Feb 2010 19:15:19 +0000 Subject: [PATCH 2/5] WinSW should handle whitespace in the argument correctly git-svn-id: https://svn.kenai.com/svn/winsw~subversion/trunk@43 c8b2a3fe-9b5b-6a51-a37e-dc31b0e308fa --- Main.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Main.cs b/Main.cs index 9959842..40e073e 100644 --- a/Main.cs +++ b/Main.cs @@ -180,7 +180,7 @@ namespace winsw /// /// 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 quotation. /// private string AppendTags(string tagName) { @@ -196,7 +196,21 @@ namespace winsw 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); From dea77d9804adbeda3a44d5e4b21b94f0e2aae184 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 9 Feb 2010 19:17:18 +0000 Subject: [PATCH 3/5] prepared to deploy 1.9 git-svn-id: https://svn.kenai.com/svn/winsw~subversion/trunk@44 c8b2a3fe-9b5b-6a51-a37e-dc31b0e308fa --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7412adf..6cb58b8 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.sun.winsw winsw pom - 1.8 + 1.9 Windows service wrapper From c542409b1703870923c782556cb19280af76ff46 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 9 Feb 2010 19:24:13 +0000 Subject: [PATCH 4/5] env variable expansion needs to happen first if we want to really detect whitespace in arguments correctly git-svn-id: https://svn.kenai.com/svn/winsw~subversion/trunk@46 c8b2a3fe-9b5b-6a51-a37e-dc31b0e308fa --- Main.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.cs b/Main.cs index 40e073e..a4c46a4 100644 --- a/Main.cs +++ b/Main.cs @@ -196,7 +196,7 @@ namespace winsw foreach (XmlNode argument in dom.SelectNodes("//" + tagName)) { - string token = argument.InnerText; + string token = Environment.ExpandEnvironmentVariables(argument.InnerText); if (token.StartsWith("\"") && token.EndsWith("\"")) { // for backward compatibility, if the argument is already quoted, leave it as is. @@ -213,7 +213,7 @@ namespace winsw arguments += " " + token; } - return Environment.ExpandEnvironmentVariables(arguments); + return arguments; } } From 64c156deca36f3e67731f91ea69fbd86be433082 Mon Sep 17 00:00:00 2001 From: kohsukekawaguchi Date: Tue, 11 May 2010 04:31:44 +0000 Subject: [PATCH 5/5] designated MIT license git-svn-id: https://svn.kenai.com/svn/winsw~subversion/trunk@49 c8b2a3fe-9b5b-6a51-a37e-dc31b0e308fa --- LICENSE.txt | 22 ++++++++++++++++++++++ pom.xml | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..646c7a4 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,22 @@ + Copyright (c) 2010 Kohsuke Kawaguchi + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. diff --git a/pom.xml b/pom.xml index 6cb58b8..00250bb 100755 --- a/pom.xml +++ b/pom.xml @@ -45,6 +45,14 @@ + + + The MIT license + http://www.opensource.org/licenses/mit-license.php + repo + + + maven2-repository.dev.java.net