/[cmucl]/src/code/fd-stream.lisp
ViewVC logotype

Diff of /src/code/fd-stream.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.119 by rtoy, Wed Sep 8 03:04:54 2010 UTC revision 1.120 by rtoy, Wed Sep 15 11:32:49 2010 UTC
# Line 1691  Line 1691 
1691                     (incf posn (- (the index (caddr later))                     (incf posn (- (the index (caddr later))
1692                                   (the index (cadr later)))))                                   (the index (cadr later)))))
1693                   (incf posn (fd-stream-obuf-tail stream))                   (incf posn (fd-stream-obuf-tail stream))
1694    
1695                   ;; Adjust for unread input:                   ;; Adjust for unread input:
1696                   ;;  If there is any input read from UNIX but not supplied to                   ;;  If there is any input read from UNIX but not supplied to
1697                   ;; the user of the stream, the *real* file position will                   ;; the user of the stream, the *real* file position will
1698                   ;; smaller than reported, because we want to look like the                   ;; smaller than reported, because we want to look like the
1699                   ;; unread stuff is still available.                   ;; unread stuff is still available.
                  #-unicode  
1700                   (decf posn (- (fd-stream-ibuf-tail stream)                   (decf posn (- (fd-stream-ibuf-tail stream)
1701                                 (fd-stream-ibuf-head stream)))                                 (fd-stream-ibuf-head stream)))
1702    
1703                   #+unicode                   #+unicode
1704                   (if (fd-stream-string-buffer stream)                   (if (fd-stream-string-buffer stream)
1705                       ;; The string buffer contains Lisp characters,                       ;; The string buffer contains Lisp characters,
# Line 1717  Line 1718 
1718                           (loop for k of-type fixnum from (1- (fd-stream-string-index stream))                           (loop for k of-type fixnum from (1- (fd-stream-string-index stream))
1719                              below (1- (fd-stream-string-buffer-len stream))                              below (1- (fd-stream-string-buffer-len stream))
1720                              do (decf posn (aref ocount k)))))                              do (decf posn (aref ocount k)))))
1721                       (decf posn (- (fd-stream-ibuf-tail stream)                       (when (fd-stream-in-buffer stream)
1722                                     (fd-stream-ibuf-head stream))))                         ;; When we have an in-buffer (but no
1723                           ;; string-buffer!), we need to adjust for the
1724                           ;; octets that have not yet been supplied.
1725                           ;; This situation (should!) only happens for an
1726                           ;; external-format of ISO-8859-1.  If there's
1727                           ;; no string-buffer and no in-buffer, then the
1728                           ;; ibuf tail and head pointers contain all the
1729                           ;; information needed.
1730                           (decf posn (- in-buffer-length
1731                                         (fd-stream-in-index stream)))))
1732    
1733                   (when (fd-stream-unread stream) ;;@@                   (when (fd-stream-unread stream) ;;@@
1734                     (decf posn))                     (decf posn))
1735                   ;; Divide bytes by element size.                   ;; Divide bytes by element size.

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.120

  ViewVC Help
Powered by ViewVC 1.1.5