diff options
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el index 175f85b29d0..f8318d8a34d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -749,14 +749,15 @@ If INCLUDE-DIRECTORIES, also include directories that have matching names." (unless (member file '("./" "../")) (if (directory-name-p file) (let* ((leaf (substring file 0 (1- (length file)))) - (path (expand-file-name leaf dir))) + (full-file (expand-file-name leaf dir))) ;; Don't follow symlinks to other directories. - (unless (file-symlink-p path) - (setq result (nconc result (directory-files-recursively - path match include-directories)))) + (unless (file-symlink-p full-file) + (setq result + (nconc result (directory-files-recursively + full-file match include-directories)))) (when (and include-directories (string-match match leaf)) - (setq result (nconc result (list path))))) + (setq result (nconc result (list full-file))))) (when (string-match match file) (push (expand-file-name file dir) files))))) (nconc result (nreverse files)))) |
