X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcondition.lisp;h=a44131081a6d1e6712f67f4dd4bcd5827626b041;hb=f5146484af254ef6812f0417deed9ccd5c2eda27;hp=01421bbb164ad656d010b97646bd2f9216f481db;hpb=38f18f2eb2a1d66d2c138a2f5e10e6be93aacb1b;p=sbcl.git diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 01421bb..a441310 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