ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: [PATCH] ReplaceRegExp should not append additional newline
Date Fri, 20 Sep 2002 05:47:46 GMT
On Thu, 19 Sep 2002, Stefan Moebius <> wrote:

> Ok, I read some documentation on sed and perl. Pretty confusing and
> somewhat platform dependent.

Oh, it gets even more confusing as soon as you add Java and the
different regexp implementations to the mix 8-).  See the notes in the
manual page for the task we are talking about here.

> 1. We never want to inadvertently change existing linebreaks.

I think I agree (bad wording, I know), but the current implementation
does, it changes lineends to the current platforms style, potentially
changing them as it goes.

> 2. In line-mode it is impossible to change linbreaks.

See above.  If you run the task in line-mode on a file with \r\n
linebreaks on Unix, you will effectively strip the cariage returns.
so we don't change where the linebreak occurs, but we may change the
style of it.  On second thought, this sounds like a bug.

> Consequences:
> 2.1 In line-mode one cannot change the number of lines in a file.

Good goal +1

> 3. A line is always finally terminated by '\n', i.e. "\r\n\n" are
> two lines.

Nope.  No line-feeds at all on a Mac (at least on MacOS 9).


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message