From e1cac5702da02e7c856d6d14a043e1b6554ce585 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 12 Jul 2006 15:57:07 +0000 Subject: [PATCH] (locate-file-completion): Avoid duplicates in result. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index 90ca58a7511..af8e3d0e889 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -691,7 +691,7 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." (when (file-directory-p dir) (dolist (file (file-name-all-completions (file-name-nondirectory string) dir)) - (push (if string-dir (concat string-dir file) file) names) + (add-to-list 'names (if string-dir (concat string-dir file) file)) (when (string-match suffix file) (setq file (substring file 0 (match-beginning 0))) (push (if string-dir (concat string-dir file) file) names))))) -- 2.39.2