Browse Source

References may point to files with spaces in their names, quote them

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277947 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
4c695bbb72
2 changed files with 15 additions and 5 deletions
  1. +3
    -0
      WHATSNEW
  2. +12
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java

+ 3
- 0
WHATSNEW View File

@@ -267,6 +267,9 @@ Other changes:
* <csc>'s extraoptions can now contain multiple arguments.
Bugzilla Report 23599.

* The .NET compilation tasks failed if filenames given as references
contained spaces. Bugzilla Report 27170.

Fixed bugs:
-----------



+ 12
- 5
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java View File

@@ -219,7 +219,7 @@ public abstract class DotnetCompile
protected String getReferencesParameter() {
//bail on no references
if (notEmpty(references)) {
return REFERENCE_OPTION + references;
return REFERENCE_OPTION + '\"' + references + '\"';
} else {
return null;
}
@@ -270,8 +270,8 @@ public abstract class DotnetCompile
}

StringBuffer s = new StringBuffer(REFERENCE_OPTION);
s.append(refpath);
return new String(s);
s.append('\"').append(refpath).append('\"');
return s.toString();
}


@@ -903,6 +903,8 @@ public abstract class DotnetCompile
if (isFileManagedBinary(file)) {
if (!firstEntry) {
referenceList.append(getReferenceDelimiter());
} else {
referenceList.append('\"');
}
referenceList.append(file.toString());
firstEntry = false;
@@ -912,8 +914,13 @@ public abstract class DotnetCompile
}

}
//add it all to an argument
command.addArgument(referenceList.toString());
// hack: This means we've added at least one reference that's
// a managed binary
if (!firstEntry) {
//add it all to an argument
command.addArgument(referenceList.toString() + '\"');
}
return filesOutOfDate;
}



Loading…
Cancel
Save