X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=buff-input.lisp;h=4868ba1690e293a9ab036b85159c5c11228239fd;hp=dcae08c8e823836a34cc0c4e1173daca2e95a990;hb=90225d9ba12f7a9116bcc923afdaf6e76a8c6728;hpb=cc63bfc3010b2a1997cbd8d123b4deaca3cfdb26 diff --git a/buff-input.lisp b/buff-input.lisp index dcae08c..4868ba1 100644 --- a/buff-input.lisp +++ b/buff-input.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: buff-input.lisp,v 1.9 2003/05/06 01:50:46 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -167,13 +167,16 @@ (if (eql c +eof-char+) eof linebuffer))) (declare (character c)) (cond - ((char= c #\Newline) - (unless (zerop pos) - (setf (fill-pointer linebuffer) (1- pos))) - (setf done t)) - ((char= +eof-char+) - (setf done t)) - (t - (setf (char linebuffer pos) c) - (incf pos))))))) + ((>= pos +max-line+) + (warn "Line overflow") + (setf done t)) + ((char= c #\Newline) + (when (plusp pos) + (setf (fill-pointer linebuffer) (1- pos))) + (setf done t)) + ((char= +eof-char+) + (setf done t)) + (t + (setf (char linebuffer pos) c) + (incf pos)))))))