diff options
author | Kenichi Handa <handa@m17n.org> | 2003-02-17 06:18:58 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2003-02-17 06:18:58 +0000 |
commit | 7702ccc5293ac5fe21ee9de8aeb4b4688b62690b (patch) | |
tree | 4f24a7a25855e13c82da4564aa93a8ea8796cdc7 /lisp/files.el | |
parent | fb4452cc3205120d4f8d515083474d9bd05daa43 (diff) | |
download | emacs-7702ccc5293ac5fe21ee9de8aeb4b4688b62690b.tar.gz |
(insert-directory): Add workaround for the case that we
can't trust ls's output as to byte positions of filenames.
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index 1d0816ee572..a965cd6c08c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4110,7 +4110,12 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (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))))) |