diff --git a/WHATSNEW b/WHATSNEW index 5707fd896..f34b98cd1 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -4,6 +4,13 @@ Changes from Ant 1.8.4 TO Ant 1.9.0 Changes that could break older environments: ------------------------------------------- + * FixCRLF used to treat the EOL value ASIS to convert to the system property + line.separator. Specified was that ASIS would leave the EOL characters alone, + the task now really leaves the EOL characters alone. This also implies that + EOL ASIS will not insert a newline even if fixlast is set to true. + Bugzilla report 53036 + + Fixed bugs: ----------- diff --git a/manual/Tasks/fixcrlf.html b/manual/Tasks/fixcrlf.html index 462e7fc4e..2637401b7 100644 --- a/manual/Tasks/fixcrlf.html +++ b/manual/Tasks/fixcrlf.html @@ -280,7 +280,7 @@ fixlast Whether to add a missing EOL to the last line - of a processed file. Since Ant 1.6.1 + of a processed file.
Ignored if EOL is asis.
Since Ant 1.6.1 No; default is true diff --git a/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java b/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java index e1920d1d1..11583d7d2 100644 --- a/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java +++ b/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java @@ -239,9 +239,6 @@ public final class FixCrLfFilter extends BaseParamFilterReader implements Chaina private static String calculateEolString(CrLf eol) { // Calculate the EOL string per the current config - if (eol == CrLf.ASIS) { - return System.getProperty("line.separator"); - } if (eol == CrLf.CR || eol == CrLf.MAC) { return "\r"; } @@ -265,7 +262,10 @@ public final class FixCrLfFilter extends BaseParamFilterReader implements Chaina // Change all EOL characters to match the calculated EOL string. If // configured to do so, append a trailing EOL so that the file ends on // a EOL. - in = new NormalizeEolFilter(in, calculateEolString(eol), getFixlast()); + if (eol != CrLf.ASIS) + { + in = new NormalizeEolFilter(in, calculateEolString(eol), getFixlast()); + } if (tabs != AddAsisRemove.ASIS) { // If filtering Java source, prevent changes to whitespace in