ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12407] New: - ReplaceRegExp task adds unwanted end of line at end of result
Date Mon, 09 Sep 2002 02:37:43 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12407>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12407

ReplaceRegExp task adds unwanted end of line at end of result

           Summary: ReplaceRegExp task adds unwanted end of line at end of
                    result
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: careye@spamcop.net


I'm using the ReplaceRegExp task to remove extra newlines from our JSPs before
they get deployed, like this:

    <replaceregexp
        match='(["\s])((--)?%>)(([\r\n]*)(&lt;/jsp:useBean&gt;))?([\r\n]+)'
        replace="\1\5\7\2\6" flags="g">
      <fileset dir="${web.destdir}" includes="*.jsp"/>
    </replaceregexp>

However, I get an extra \r\n at the end of the result, when I don't want the
file to end with any newline at all.

The problem seems to be at line 357 of
src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java:

                pw.println(res);

where, for consistency with the br.read(...) above, it should be:

                pw.write(res);

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message