Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • toy's avatar
    5b428a0a
    READ-SEQUENCE was returning too soon: · 5b428a0a
    toy authored
    (defvar *s* (open "target:code/scavhook.lisp"))
    (defvar *buf* (make-array 5000 :element-type 'character))
    (read-sequence *buf* *s* :end 3000) => 3000
    (read-sequence *buf* *s* :end 3000) => 1096
    
    or 4096 bytes read, when we should have read 4139 (length of
    scavhook.lisp).
    
    Make READ-INTO-SIMPLE-STRING keep trying to READ-N-BYTES until we have
    enough bytes or until READ-N-BYTES returns 0 bytes read (in which
    case we return a short read because there's nothing left to read).
    5b428a0a
    History
    READ-SEQUENCE was returning too soon:
    toy authored
    (defvar *s* (open "target:code/scavhook.lisp"))
    (defvar *buf* (make-array 5000 :element-type 'character))
    (read-sequence *buf* *s* :end 3000) => 3000
    (read-sequence *buf* *s* :end 3000) => 1096
    
    or 4096 bytes read, when we should have read 4139 (length of
    scavhook.lisp).
    
    Make READ-INTO-SIMPLE-STRING keep trying to READ-N-BYTES until we have
    enough bytes or until READ-N-BYTES returns 0 bytes read (in which
    case we return a short read because there's nothing left to read).