Changeset 11411


Ignore:
Timestamp:
12/03/08 21:35:51 (13 years ago)
Author:
ehuelsmann
Message:

Fix eol-style initialization and double-output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/open-external-format/src/org/armedbear/lisp/Stream.java

    r11410 r11411  
    102102   
    103103  protected EolStyle eolStyle = platformEolStyle;
    104   protected char eolChar = 0;
     104  protected char eolChar = (eolStyle == EolStyle.CR) ? '\r' : '\n';
    105105  protected LispObject externalFormat = LispObject.NIL;
    106106  protected String encoding = null;
     
    18841884      {
    18851885        if (eolStyle != EolStyle.RAW) {
    1886           for (int i = start; i++ < end;)
     1886          for (int i = start; i < end; i++)
    18871887            //###FIXME: the number of writes can be greatly reduced by
    18881888            // writing the space between newlines as chunks.
    18891889            _writeChar(chars[i]);
    1890         }
     1890         
     1891        } else
     1892          writer.write(chars, start, end - start);
    18911893       
    1892         writer.write(chars, start, end - start);
    18931894        int index = -1;
    18941895        for (int i = end; i-- > start;)
Note: See TracChangeset for help on using the changeset viewer.