X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcondition.lisp;h=7f664314602ca4437433384aabd7417c2c7c6949;hb=ec066d84dd46611428943d152749b3891a3f4b7c;hp=01421bbb164ad656d010b97646bd2f9216f481db;hpb=38f18f2eb2a1d66d2c138a2f5e10e6be93aacb1b;p=sbcl.git diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 01421bb..7f66431 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -682,6 +682,17 @@ (let (lineno colno) (when (and pos (< pos sb!xc:array-dimension-limit) + ;; KLUDGE: lseek() (which is what FILE-POSITION + ;; reduces to on file-streams) is undefined on + ;; "some devices", which in practice means that it + ;; can claim to succeed on /dev/stdin on Darwin + ;; and Solaris. This is obviously bad news, + ;; because the READ-SEQUENCE below will then + ;; block, not complete, and the report will never + ;; be printed. As a workaround, we exclude + ;; interactive streams from this attempt to report + ;; positions. -- CSR, 2003-08-21 + (not (interactive-stream-p error-stream)) (file-position error-stream :start)) (let ((string (make-string pos @@ -689,7 +700,7 @@ (when (= pos (read-sequence string error-stream)) (setq lineno (1+ (count #\Newline string)) colno (- pos - (or (position #\Newline string :from-end t) 0) + (or (position #\Newline string :from-end t) -1) 1)))) (file-position error-stream pos)) (format stream @@ -770,6 +781,7 @@ (define-condition nil-array-accessed-error (type-error) () (:report (lambda (condition stream) + (declare (ignore condition)) (format stream "An attempt to access an array of element-type ~ NIL was made. Congratulations!"))))