Changeset 11985


Ignore:
Timestamp:
06/01/09 20:55:31 (8 years ago)
Author:
ehuelsmann
Message:

We can't move beyond position() in bbuf if it's not readable,
set the seek() limits accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/util/RandomAccessCharacterFile.java

    r11984 r11985  
    404404    public final void position(long newPosition) throws IOException {
    405405        flushBbuf();
    406         long bbufend = bbufpos + bbuf.limit();
     406        long bbufend = bbufpos + // in case bbuf is readable, its contents is valid
     407            bbufIsReadable ? bbuf.limit() : bbuf.position(); // beyond position()
    407408        if (newPosition >= bbufpos && newPosition < bbufend) {
    408409            // near seek. within existing data of bbuf.
Note: See TracChangeset for help on using the changeset viewer.