# HG changeset patch # User Andreas Schwab # Date 917609493 0 # Node ID 37a08636670b99165f695525ab255655bd4800b9 # Parent 45e1b3418311160228cf7f6ef60da8b665f6169f (file-expand-wildcards): Never consider `.' and `..' a wildcard match. Fix regexp that tests if dirpart contains wildcard characters. diff -r 45e1b3418311 -r 37a08636670b lisp/files.el --- a/lisp/files.el Thu Jan 28 19:45:13 1999 +0000 +++ b/lisp/files.el Fri Jan 29 11:31:33 1999 +0000 @@ -3112,7 +3112,7 @@ ;; A list of all dirs that DIRPART specifies. ;; This can be more than one dir ;; if DIRPART contains wildcards. - (dirs (if (and dirpart (string-match "[[.*+\\^$?]" dirpart)) + (dirs (if (and dirpart (string-match "[[*?]" dirpart)) (mapcar 'file-name-as-directory (file-expand-wildcards (directory-file-name dirpart))) (list dirpart))) @@ -3121,8 +3121,14 @@ (when (or (null (car dirs)) ; Possible if DIRPART is not wild. (file-directory-p (directory-file-name (car dirs)))) (let ((this-dir-contents - (directory-files (or (car dirs) ".") full - (wildcard-to-regexp nondir)))) + ;; Filter out "." and ".." + (delq nil + (mapcar #'(lambda (name) + (unless (string-match "\\`\\.\\.?\\'" + (file-name-nondirectory name)) + name)) + (directory-files (or (car dirs) ".") full + (wildcard-to-regexp nondir)))))) (setq contents (nconc (if (and (car dirs) (not full))