This is an automated email from the ASF dual-hosted git repository. jaikiran pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ant.git
The following commit(s) were added to refs/heads/master by this push: new f3796ab1a bz-67082 fix unintended trimmed string output by pathconvert f3796ab1a is described below commit f3796ab1af7c6481553b758962cf7286099aaa67 Author: Sebastian Ratz <sebastian.r...@sap.com> AuthorDate: Wed Aug 30 11:35:20 2023 +0200 bz-67082 fix unintended trimmed string output by pathconvert PropertyOutputStream by default trims output. This is undesired in the <pathconvert> use case. Explicitly set it to false. Fixes regression introduced in 1.10.13 / 90ed3ff6cca8634e38d7c3c82858ce48c9c4be2b. --- CONTRIBUTORS | 1 + WHATSNEW | 7 +++++++ contributors.xml | 4 ++++ src/main/org/apache/tools/ant/taskdefs/PathConvert.java | 2 +- src/tests/antunit/taskdefs/pathconvert-test.xml | 9 +++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e6dd80888..208347017 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -401,6 +401,7 @@ Scott M. Stirling Sean Egan Sean P. Kane Sebastian Kantha +Sebastian Ratz Sebastien Arod Shiraz Kanga Simeon Fitch diff --git a/WHATSNEW b/WHATSNEW index 919a0bca8..185cb6a91 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1,6 +1,13 @@ Changes from Ant 1.10.14 TO Ant 1.10.15 ======================================= +Fixed bugs: +----------- + + * Fixes an regression, introduced in Ant 1.10.13, where pathconvert + would unintentionally trim the string output. + Bugzilla Report 67082 + Changes from Ant 1.10.13 TO Ant 1.10.14 ======================================= diff --git a/contributors.xml b/contributors.xml index 759b45dc7..00eae460c 100644 --- a/contributors.xml +++ b/contributors.xml @@ -1657,6 +1657,10 @@ <first>Sebastian</first> <last>Kantha</last> </name> + <name> + <first>Sebastian</first> + <last>Ratz</last> + </name> <name> <first>Sebastien</first> <last>Arod</last> diff --git a/src/main/org/apache/tools/ant/taskdefs/PathConvert.java b/src/main/org/apache/tools/ant/taskdefs/PathConvert.java index 45b2a6e5b..17f4cc91a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/PathConvert.java +++ b/src/main/org/apache/tools/ant/taskdefs/PathConvert.java @@ -429,7 +429,7 @@ public class PathConvert extends Task { if (property == null) { out = new LogOutputStream(this); } else { - out = new PropertyOutputStream(getProject(), property) { + out = new PropertyOutputStream(getProject(), property, false) { @Override public void close() { if (setonempty || size() > 0) { diff --git a/src/tests/antunit/taskdefs/pathconvert-test.xml b/src/tests/antunit/taskdefs/pathconvert-test.xml index 02ca11013..56340cabc 100644 --- a/src/tests/antunit/taskdefs/pathconvert-test.xml +++ b/src/tests/antunit/taskdefs/pathconvert-test.xml @@ -129,4 +129,13 @@ <pathconvert property="someprop" dest="somefile" refid="testpath" /> </au:expectfailure> </target> + + <target name="testUntrimmedOutput"> + <pathconvert property="result" dirsep="|"> + <file file="foo" /> + <globmapper from="${basedir}/*" to=" * " handledirsep="true" /> + </pathconvert> + <au:assertPropertyEquals name="result" value=" foo " /> + </target> + </project>