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

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


Author: ehuelsmann
Date: Sat Dec  6 18:45:06 2008
New Revision: 11427

Log:
Fix STRING-INPUT-STREAM GET-OFFSET with non-zero :start offset.

Modified:
   branches/open-external-format/src/org/armedbear/lisp/StringInputStream.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 18:45:06 2008
@@ -38,6 +38,7 @@
 public final class StringInputStream extends Stream
 {
     private final StringReader stringReader;
+    private final int start;
     
     public StringInputStream(String s)
     {
@@ -56,6 +57,8 @@
         //###FIXME: we actually want RAW here
         eolStyle = EolStyle.LF;
 
+        this.start = start;
+        
         stringReader = new StringReader(s.substring(start, end));
         initAsCharacterInputStream(stringReader);
     }
@@ -92,6 +95,11 @@
         return unreadableString("STRING-INPUT-STREAM");
     }
 
+    @Override
+    public int getOffset() {
+        return start + super.getOffset();
+    }
+    
     // ### make-string-input-stream
     // make-string-input-stream string &optional start end => string-stream
     private static final Primitive MAKE_STRING_INPUT_STREAM =




More information about the armedbear-cvs mailing list