Browse Source

Bug 53036 - FixCRLF does not respect the eol="asis" setting

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1342959 13f79535-47bb-0310-9956-ffa450edef68
master
Jacobus Martinus Kruithof 13 years ago
parent
commit
3d3f26df41
3 changed files with 12 additions and 5 deletions
  1. +7
    -0
      WHATSNEW
  2. +1
    -1
      manual/Tasks/fixcrlf.html
  3. +4
    -4
      src/main/org/apache/tools/ant/filters/FixCrLfFilter.java

+ 7
- 0
WHATSNEW View File

@@ -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:
-----------



+ 1
- 1
manual/Tasks/fixcrlf.html View File

@@ -280,7 +280,7 @@
<tr>
<td valign="top">fixlast</td>
<td valign="top">Whether to add a missing EOL to the last line
of a processed file. <b>Since Ant 1.6.1</b></td>
of a processed file.<br/>Ignored if EOL is asis.<br/><b>Since Ant 1.6.1</b></td>
<td align="center" colspan="2">No; default is <i>true</i></td>
</tr>
</table>


+ 4
- 4
src/main/org/apache/tools/ant/filters/FixCrLfFilter.java View File

@@ -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


Loading…
Cancel
Save