[armedbear-cvs] r11426 - branches/open-external-format/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Dec 6 14:18:06 UTC 2008


Author: ehuelsmann
Date: Sat Dec  6 14:18:06 2008
New Revision: 11426

Log:
Make sure we don't write more characters to the string than requested:
no eol translation for strings.

Modified:
   branches/open-external-format/src/org/armedbear/lisp/StringInputStream.java
   branches/open-external-format/src/org/armedbear/lisp/StringOutputStream.java

Modified: branches/open-external-format/src/org/armedbear/lisp/StringInputStream.java
==============================================================================
--- branches/open-external-format/src/org/armedbear/lisp/StringInputStream.java	(original)
+++ branches/open-external-format/src/org/armedbear/lisp/StringInputStream.java	Sat Dec  6 14:18:06 2008
@@ -53,7 +53,9 @@
     {
         elementType = Symbol.CHARACTER;
         setExternalFormat(keywordDefault);
-        
+        //###FIXME: we actually want RAW here
+        eolStyle = EolStyle.LF;
+
         stringReader = new StringReader(s.substring(start, end));
         initAsCharacterInputStream(stringReader);
     }

Modified: branches/open-external-format/src/org/armedbear/lisp/StringOutputStream.java
==============================================================================
--- branches/open-external-format/src/org/armedbear/lisp/StringOutputStream.java	(original)
+++ branches/open-external-format/src/org/armedbear/lisp/StringOutputStream.java	Sat Dec  6 14:18:06 2008
@@ -47,6 +47,8 @@
     private StringOutputStream(LispObject elementType)
     {
         this.elementType = elementType;
+        //###FIXME we actually want RAW here
+        this.eolStyle = EolStyle.LF;
         initAsCharacterOutputStream(stringWriter = new StringWriter());
     }
 
@@ -81,7 +83,7 @@
     {
         if (elementType == NIL)
             return 0;
-        return stringWriter.toString().length();
+        return stringWriter.getBuffer().length();
     }
 
     public LispObject getString() throws ConditionThrowable




More information about the armedbear-cvs mailing list