* lisp/international/mule-util.el (filepos-to-bufferpos): Fix EOL
offset calculation, and make it conditional on the eol-type of the
file's encoding. (Bug#20825)
(while
(progn
(setq pos (byte-to-position (+ pm byte (- eol-offset))))
- (setq lines (1- (line-number-at-pos pos)))
- (not (= lines eol-offset)))
- (setq eol-offset (+ eol-offset lines)))
+ ;; Adjust POS for DOS EOL format.
+ (when (= eol 1)
+ (setq lines (1- (line-number-at-pos pos)))
+ (not (= lines eol-offset))))
+ (setq eol-offset lines))
pos))
;; FIXME: What if it's a 2-byte charset? Are there such beasts?
(`charset (+ pm byte))