Browse Source

fix binary append; BZ 41399

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@497528 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
bddca28a0f
3 changed files with 27 additions and 1 deletions
  1. +2
    -0
      WHATSNEW
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Concat.java
  3. +24
    -0
      src/tests/antunit/taskdefs/concat-test.xml

+ 2
- 0
WHATSNEW View File

@@ -40,6 +40,8 @@ Fixed bugs:

* Synchonization issues in PropertyHelper. Bugzilla 41353.

* <concat binary="true" append="true"> did not append. Bugzilla 41399.

Other changes:
--------------



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Concat.java View File

@@ -479,7 +479,7 @@ public class Concat extends Task {
InputStream in = null;
try {
try {
out = new FileOutputStream(destinationFile);
out = new FileOutputStream(destinationFile, append);
} catch (Exception t) {
throw new BuildException("Unable to open "
+ destinationFile + " for writing", t);


+ 24
- 0
src/tests/antunit/taskdefs/concat-test.xml View File

@@ -0,0 +1,24 @@
<project xmlns:au="antlib:org.apache.ant.antunit">
<target name="tearDown">
<delete file="binaryAppendDest" />
</target>

<target name="testBinaryAppend">
<au:assertTrue message="prerequisite conditions unmet">
<length length="0">
<!-- allow for nonexistent OR zero-length: -->
<fileset file="binaryAppendDest" />
</length>
</au:assertTrue>
<echo file="binaryAppendDest">x</echo>
<au:assertTrue message="destfile setup failed">
<length length="1" file="binaryAppendDest" />
</au:assertTrue>
<concat append="true" destfile="binaryAppendDest" binary="true">
<string value="x" />
</concat>
<au:assertTrue message="expected length 2">
<length file="binaryAppendDest" length="2" />
</au:assertTrue>
</target>
</project>

Loading…
Cancel
Save