antoine     2003/07/27 17:22:00

  Modified:    src/main/org/apache/tools/ant/taskdefs Replace.java
               .        WHATSNEW
  Log:
  Prevent \r\n from being changed to \r\r\n under Windows
  
  Revision  Changes    Path
  1.46      +6 -2      ant/src/main/org/apache/tools/ant/taskdefs/Replace.java
  
  Index: Replace.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Replace.java      25 Jul 2003 08:59:39 -0000      1.45
  +++ Replace.java      28 Jul 2003 00:22:00 -0000      1.46
  @@ -423,9 +423,13 @@
                   // line separators in values and tokens are "\n"
                   // in order to compare with the file contents, replace them
                   // as needed
  -                String val = stringReplace(value.getText(), "\n",
  +                String val = stringReplace(value.getText(), "\r\n",
  +                                           "\n", false);
  +                val = stringReplace(val, "\n",
                                              StringUtils.LINE_SEP, false);
  -                String tok = stringReplace(token.getText(), "\n",
  +                String tok = stringReplace(token.getText(), "\r\n",
  +                                            "\n", false);
  +                tok = stringReplace(tok, "\n",
                                              StringUtils.LINE_SEP, false);
   
                   // for each found token, replace with value
  
  
  
  1.470     +2 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.469
  retrieving revision 1.470
  diff -u -r1.469 -r1.470
  --- WHATSNEW  26 Jul 2003 16:03:09 -0000      1.469
  +++ WHATSNEW  28 Jul 2003 00:22:00 -0000      1.470
  @@ -216,6 +216,8 @@
   * ftp chmod failed when the remote system was UNIX and local system Windows
     Bugzilla Report 21865.
   
  +* replace would change \r\n into \r\r\n under Windows.
  +
   Other changes:
   --------------
   * Six new Clearcase tasks added.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to