Browse Source

space is not the only whitespace that could show up. bottom/head are free-form HTML with line breaks, tabs and all that.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@703493 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
8bf76a6d54
1 changed files with 13 additions and 3 deletions
  1. +13
    -3
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java

+ 13
- 3
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -2220,8 +2220,8 @@ public class Javadoc extends Task {
* @return the quoted string, if there is no need to quote the string,
* return the original string.
*/
private String quoteString(String str) {
if (str.indexOf(' ') == -1
private String quoteString(final String str) {
if (!containsWhitespace(str)
&& str.indexOf('\'') == -1
&& str.indexOf('"') == -1) {
return str;
@@ -2233,7 +2233,17 @@ public class Javadoc extends Task {
}
}

private String quoteString(String str, char delim) {
private boolean containsWhitespace(final String s) {
final int len = s.length();
for (int i = 0; i < len; i++) {
if (Character.isWhitespace(s.charAt(i))) {
return true;
}
}
return false;
}

private String quoteString(String str, final char delim) {
StringBuffer buf = new StringBuffer(str.length() * 2);
buf.append(delim);
if (str.indexOf('\\') != -1) {


Loading…
Cancel
Save