mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
[HUDSON-2584] Fixed a regression introduced in 1.260.
Also see http://www.nabble.com/Error-parsing-%22-in-msbuild-task-to20535754.html git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13297 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
c1fcd050da
commit
87e2e44490
2 files changed
+21
No files matched your search
@@ -187,6 +187,8 @@ public class QuotedStringTokenizer
|
||||
if (escape)
|
||||
{
|
||||
escape=false;
|
||||
if(ESCAPABLE_CHARS.indexOf(c)<0)
|
||||
_token.append('\\');
|
||||
_token.append(c);
|
||||
}
|
||||
else if(_delim.indexOf(c)>=0)
|
||||
@@ -221,6 +223,8 @@ public class QuotedStringTokenizer
|
||||
if (escape)
|
||||
{
|
||||
escape=false;
|
||||
if(ESCAPABLE_CHARS.indexOf(c)<0)
|
||||
_token.append('\\');
|
||||
_token.append(c);
|
||||
}
|
||||
else if (c=='\'')
|
||||
@@ -245,6 +249,8 @@ public class QuotedStringTokenizer
|
||||
if (escape)
|
||||
{
|
||||
escape=false;
|
||||
if(ESCAPABLE_CHARS.indexOf(c)<0)
|
||||
_token.append('\\');
|
||||
_token.append(c);
|
||||
}
|
||||
else if (c=='\"')
|
||||
@@ -530,6 +536,15 @@ public class QuotedStringTokenizer
|
||||
if ((b >= 'A') && (b <= 'F')) return (byte)(b - 'A' + 10);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Characters that can be escaped with \.
|
||||
*
|
||||
* Others, like, say, \W will be left alone instead of becoming just W.
|
||||
* This is important to keep Hudson behave on Windows, which uses '\' as
|
||||
* the directory separator.
|
||||
*/
|
||||
private static final String ESCAPABLE_CHARS = "\\\"' ";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,4 +44,10 @@ public class QuotedStringTokenizerTest extends TestCase {
|
||||
check("foo\\\\ bar",
|
||||
"foo\\","bar");
|
||||
}
|
||||
|
||||
// see http://www.nabble.com/Error-parsing-%22-in-msbuild-task-to20535754.html
|
||||
public void test7() {
|
||||
check("foo=\"bar\\zot\"",
|
||||
"foo=bar\\zot");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user