--- /tmp/gnus-spec.el Thu Sep 13 18:23:30 2001 +++ /tmp/gnus-spec.el.new Thu Sep 13 18:23:30 2001 @@ -273,20 +273,21 @@ (defun gnus-correct-substring (string start &optional end) (let ((wstart 0) (wend 0) + (wseek 0) (seek 0) - (length (length string))) + (length (length string)) + (string (concat string "\0"))) ;; Find the start position. (while (and (< seek length) - (< wstart start)) - (incf wstart (gnus-char-width (aref string seek))) + (< wseek start)) + (incf wseek (gnus-char-width (aref string seek))) (incf seek)) - (setq wend wstart - wstart seek) + (setq wstart seek) ;; Find the end position. - (while (and (< seek length) + (while (and (<= seek length) (or (not end) - (<= wend end))) - (incf wend (gnus-char-width (aref string seek))) + (<= wseek end))) + (incf wseek (gnus-char-width (aref string seek))) (incf seek)) (setq wend seek) (substring string wstart (1- wend))))