From 33b7ca9e5b3e1e58bd5a736b3e3c9d65575bff33 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Thu, 18 May 2006 14:35:52 +0000 Subject: [PATCH] used \r (Mac) line endings on OS X, whose proper line separator is \n (Unix). Bugzilla report 39585. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@407562 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 5 ++++- src/main/org/apache/tools/ant/filters/FixCrLfFilter.java | 8 ++++---- src/main/org/apache/tools/ant/taskdefs/FixCRLF.java | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 62c9e0a75..ea03c4685 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -85,7 +85,10 @@ Changes that could break older environments: * Metamata (maudit, mmetrics, and mparse tasks) removed. -* Sitraka (jpcoverage, jpcovmerge, jpcovreport) tasks suppressed. +* Sitraka (jpcoverage, jpcovmerge, jpcovreport) tasks suppressed. + +* used \r (Mac) line endings on OS X, whose proper line separator + is \n (Unix). Bugzilla report 39585. Fixed bugs: ----------- diff --git a/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java b/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java index 6c403de25..720100d18 100755 --- a/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java +++ b/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java @@ -38,15 +38,15 @@ import org.apache.tools.ant.types.EnumeratedAttribute; * None of which are required. *

* This version generalises the handling of EOL characters, and allows for - * CR-only line endings (which I suspect is the standard on Macs.) Tab handling - * has also been generalised to accommodate any tabwidth from 2 to 80, + * CR-only line endings (the standard on Mac systems prior to OS X). Tab + * handling has also been generalised to accommodate any tabwidth from 2 to 80, * inclusive. Importantly, it can leave untouched any literal TAB characters * embedded within Java string or character constants. *

* Caution: run with care on carefully formatted files. This may * sound obvious, but if you don't specify asis, presume that your files are * going to be modified. If "tabs" is "add" or "remove", whitespace characters - * may be added or removed as necessary. Similarly, for EOL's - eol="asis" + * may be added or removed as necessary. Similarly, for EOLs, eol="asis" * actually means convert to your native O/S EOL convention while eol="crlf" or * cr="add" can result in CR characters being removed in one special case * accommodated, i.e., CRCRLF is regarded as a single EOL to handle cases where @@ -109,7 +109,7 @@ public final class FixCrLfFilter extends BaseParamFilterReader implements Chaina // class's constructor. { tabs = AddAsisRemove.ASIS; - if (Os.isFamily("mac")) { + if (Os.isFamily("mac") && !Os.isFamily("unix")) { ctrlz = AddAsisRemove.REMOVE; setEol(CrLf.MAC); } else if (Os.isFamily("dos")) { diff --git a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java index 506dd3af9..9bf37f189 100644 --- a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java +++ b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java @@ -59,7 +59,7 @@ import org.apache.tools.ant.util.FileUtils; * and exclude properties. *

* This version generalises the handling of EOL characters, and allows - * for CR-only line endings (which I suspect is the standard on Macs.) + * for CR-only line endings (the standard on Mac systems prior to OS X). * Tab handling has also been generalised to accommodate any tabwidth * from 2 to 80, inclusive. Importantly, it will leave untouched any * literal TAB characters embedded within string or character constants.