Changeset 8537


Ignore:
Timestamp:
Feb 21, 2008, 9:33:41 AM (12 years ago)
Author:
gb
Message:

STREAM-SURROUNDING-CHARACTERS on STRING-INPUT-STREAM: only if
stream is open.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-streams.lisp

    r8486 r8537  
    44954495
    44964496(defmethod stream-surrounding-characters ((s string-input-stream))
    4497   (let* ((ioblock (basic-stream-ioblock s))
    4498          (start (string-input-stream-ioblock-start ioblock))
    4499          (idx (string-input-stream-ioblock-index ioblock))
    4500          (end (string-input-stream-ioblock-end ioblock))
    4501          (string (string-stream-ioblock-string ioblock)))
    4502     (subseq string (max (- idx 5) start) (min (+ idx 5) end))))
     4497  (let* ((ioblock (basic-stream.state s)))
     4498    (when ioblock
     4499      (let* ((start (string-input-stream-ioblock-start ioblock))
     4500             (idx (string-input-stream-ioblock-index ioblock))
     4501             (end (string-input-stream-ioblock-end ioblock))
     4502             (string (string-stream-ioblock-string ioblock)))
     4503        (subseq string (max (- idx 5) start) (min (+ idx 5) end))))))
    45034504   
    45044505
Note: See TracChangeset for help on using the changeset viewer.