diff --git a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java index 89a9c0859..6d29c7264 100644 --- a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java +++ b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java @@ -265,6 +265,7 @@ public class LayoutPreservingProperties extends Properties { if (((Pair)line).isNew()) { if (!writtenSep) { osw.write(LS); + writtenSep = true; } } osw.write(line.toString() + LS); diff --git a/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml b/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml new file mode 100644 index 000000000..c5fff7bfe --- /dev/null +++ b/src/tests/antunit/taskdefs/optional/propertyfilelayout-test.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +