ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs FixCRLF.java
Date Sat, 12 Feb 2000 22:19:19 GMT
rubys       00/02/12 14:19:18

  Modified:    src/main/org/apache/tools/ant/taskdefs FixCRLF.java
  Log:
  Error assigning char data to a byte (Blackdown JDK 1.2.2).  Fixed by
  casting the char to a byte.
  Submitted by: Daniel Rall <dlr@finemaltcoding.com>
  
  Revision  Changes    Path
  1.2       +7 -7      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
  
  Index: FixCRLF.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FixCRLF.java	2000/02/12 16:59:26	1.1
  +++ FixCRLF.java	2000/02/12 22:19:18	1.2
  @@ -284,14 +284,14 @@
                   switch (indata[k]) {
                       case ' ':
                           // advance column
  -                        if (addtab == 0) outdata[o++]=indata[k];
  +                        if (addtab == 0) outdata[o++]=(byte)' ';
                           col++;
                           break;
   
                       case '\t':
                           if (addtab == 0) {
                               // treat like any other character
  -                            outdata[o++]=indata[k];
  +                            outdata[o++]=(byte)'\t';
                               col++;
                           } else {
                               // advance column to next tab stop
  @@ -302,15 +302,15 @@
                       case '\r':
                           if (addcr == 0) {
                               // treat like any other character
  -                            outdata[o++]=indata[k];
  +                            outdata[o++]=(byte)'\r';
                               col++;
                           }
                           break;
   
                       case '\n':
                           // start a new line (optional CR followed by LF)
  -                        if (addcr == +1) outdata[o++]='\r';
  -                        outdata[o++]='\n';
  +                        if (addcr == +1) outdata[o++]=(byte)'\r';
  +                        outdata[o++]=(byte)'\n';
                           line=o;
                           col=0;
                           break;
  @@ -324,14 +324,14 @@
                               // add tabs until this column would be passed
                               // note: the start of line is adjusted to match
                               while ((diff|7)<col) {
  -                                outdata[o++]='\t';
  +                                outdata[o++]=(byte)'\t';
                                   line-=7-(diff&7);
                                   diff=o-line;
                               };
                           };
   
                           // space out to desired column
  -                        while (o<line+col) outdata[o++]=' ';
  +                        while (o<line+col) outdata[o++]=(byte)' ';
   
                           // append desired character
                           outdata[o++]=indata[k];
  
  
  

Mime
View raw message