git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@781357 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -371,6 +371,10 @@ Fixed bugs: | |||||
| errors. | errors. | ||||
| Bugzilla Report 46829. | Bugzilla Report 46829. | ||||
| * The <replacetokens> filter threw an exception if the stream to | |||||
| filter ended with a begin token. | |||||
| Bugzilla Report 47306. | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| * A HostInfo task was added performing information on hosts, including info on | * A HostInfo task was added performing information on hosts, including info on | ||||
| @@ -153,7 +153,11 @@ public final class ReplaceTokens | |||||
| queuedData | queuedData | ||||
| = key.toString() + queuedData.substring(queueIndex); | = key.toString() + queuedData.substring(queueIndex); | ||||
| } | } | ||||
| queueIndex = 0; | |||||
| if (queuedData.length() > 0) { | |||||
| queueIndex = 0; | |||||
| } else { | |||||
| queueIndex = -1; | |||||
| } | |||||
| return beginToken; | return beginToken; | ||||
| } else { | } else { | ||||
| key.setLength(key.length() - 1); | key.setLength(key.length() - 1); | ||||
| @@ -47,4 +47,22 @@ world=Ant | |||||
| resource="${output}/text.txt" value="Hello, Ant!"/> | resource="${output}/text.txt" value="Hello, Ant!"/> | ||||
| </target> | </target> | ||||
| <target name="testFileEndsWithToken" | |||||
| description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47306" | |||||
| depends="setUp"> | |||||
| <mkdir dir="${output}"/> | |||||
| <echo file="${input}/test47306.txt">Hello@</echo> | |||||
| <copy todir="${output}"> | |||||
| <fileset dir="${input}"/> | |||||
| <filterchain> | |||||
| <replacetokens> | |||||
| <token key="foo" value="bar"/> | |||||
| </replacetokens> | |||||
| </filterchain> | |||||
| </copy> | |||||
| <au:assertFilesMatch | |||||
| expected="${input}/test47306.txt" | |||||
| actual="${output}/test47306.txt"/> | |||||
| </target> | |||||
| </project> | </project> | ||||