Changeset 14211


Ignore:
Timestamp:
10/21/12 18:18:20 (8 years ago)
Author:
ehuelsmann
Message:

Re #253: Prevent unreading eofValue if eofValue happens to be a LispCharacter?.

File:
1 edited

Legend:

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

    r13461 r14211  
    3939public final class peek_char extends Primitive
    4040{
     41    private static LispObject internalEOF = new LispObject();
     42   
    4143    private peek_char()
    4244    {
     
    6971            else
    7072                in = stream;
    71             final LispObject result = in.readChar(eofError, eofValue);
     73            final LispObject result = in.readChar(eofError, internalEOF);
     74            if (result == internalEOF)
     75                return eofValue;
    7276            if (result instanceof LispCharacter)
    7377                in.unreadChar((LispCharacter)result);
     
    8084            Readtable rt = currentReadtable();
    8185            while (true) {
    82                 LispObject result = stream.readChar(eofError, eofValue);
     86                LispObject result = stream.readChar(eofError, internalEOF);
     87                if (result == internalEOF)
     88                    return eofValue;
     89               
    8390                if (result instanceof LispCharacter) {
    8491                    char c = ((LispCharacter)result).value;
     
    97104            char c = ((LispCharacter)peekType).value;
    98105            while (true) {
    99                 LispObject result = stream.readChar(eofError, eofValue);
     106                LispObject result = stream.readChar(eofError, internalEOF);
     107                if (result == internalEOF)
     108                    return eofValue;
     109               
    100110                if (result instanceof LispCharacter) {
    101111                    if (((LispCharacter)result).value == c) {
Note: See TracChangeset for help on using the changeset viewer.