# HG changeset patch # User Kenichi Handa # Date 1045462712 0 # Node ID 6455c268ddb1820d9e18b13979de4d969310c6cc # Parent bc226af8acd536d227bb225271ecc9f7c20e292d (insert-directory): Add workaround for the case that we can't trust ls's output as to byte positions of filenames. diff -r bc226af8acd5 -r 6455c268ddb1 lisp/files.el --- a/lisp/files.el Mon Feb 17 00:33:01 2003 +0000 +++ b/lisp/files.el Mon Feb 17 06:18:32 2003 +0000 @@ -4110,7 +4110,12 @@ (while (< (point) end) (let ((start (+ beg (read (current-buffer)))) (end (+ beg (read (current-buffer))))) - (put-text-property start end 'dired-filename t))) + (if (= (char-after end) ?\n) + (put-text-property start end 'dired-filename t) + ;; It seems that we can't trust ls's output as to + ;; byte positions of filenames. + (put-text-property beg (point) 'dired-filename nil) + (end-of-line)))) (goto-char end) (beginning-of-line) (delete-region (point) (progn (forward-line 2) (point)))))