diff options
| author | Andreas Schwab | 1999-01-29 11:31:33 +0000 |
|---|---|---|
| committer | Andreas Schwab | 1999-01-29 11:31:33 +0000 |
| commit | 18b0f8cf6eddb9ae3414d00bf82e5b948b68c625 (patch) | |
| tree | 591efb7368b3bc77e4f29a548db828a4b8d33d73 /lisp | |
| parent | 13911e1d18d16831492ebe2c69d805c7fdd0aa8b (diff) | |
| download | emacs-18b0f8cf6eddb9ae3414d00bf82e5b948b68c625.tar.gz emacs-18b0f8cf6eddb9ae3414d00bf82e5b948b68c625.zip | |
(file-expand-wildcards): Never consider `.' and `..' a
wildcard match. Fix regexp that tests if dirpart contains
wildcard characters.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/files.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index fac089fc977..ace250533d8 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3112,7 +3112,7 @@ default directory. However, if FULL is non-nil, they are absolute." | |||
| 3112 | ;; A list of all dirs that DIRPART specifies. | 3112 | ;; A list of all dirs that DIRPART specifies. |
| 3113 | ;; This can be more than one dir | 3113 | ;; This can be more than one dir |
| 3114 | ;; if DIRPART contains wildcards. | 3114 | ;; if DIRPART contains wildcards. |
| 3115 | (dirs (if (and dirpart (string-match "[[.*+\\^$?]" dirpart)) | 3115 | (dirs (if (and dirpart (string-match "[[*?]" dirpart)) |
| 3116 | (mapcar 'file-name-as-directory | 3116 | (mapcar 'file-name-as-directory |
| 3117 | (file-expand-wildcards (directory-file-name dirpart))) | 3117 | (file-expand-wildcards (directory-file-name dirpart))) |
| 3118 | (list dirpart))) | 3118 | (list dirpart))) |
| @@ -3121,8 +3121,14 @@ default directory. However, if FULL is non-nil, they are absolute." | |||
| 3121 | (when (or (null (car dirs)) ; Possible if DIRPART is not wild. | 3121 | (when (or (null (car dirs)) ; Possible if DIRPART is not wild. |
| 3122 | (file-directory-p (directory-file-name (car dirs)))) | 3122 | (file-directory-p (directory-file-name (car dirs)))) |
| 3123 | (let ((this-dir-contents | 3123 | (let ((this-dir-contents |
| 3124 | (directory-files (or (car dirs) ".") full | 3124 | ;; Filter out "." and ".." |
| 3125 | (wildcard-to-regexp nondir)))) | 3125 | (delq nil |
| 3126 | (mapcar #'(lambda (name) | ||
| 3127 | (unless (string-match "\\`\\.\\.?\\'" | ||
| 3128 | (file-name-nondirectory name)) | ||
| 3129 | name)) | ||
| 3130 | (directory-files (or (car dirs) ".") full | ||
| 3131 | (wildcard-to-regexp nondir)))))) | ||
| 3126 | (setq contents | 3132 | (setq contents |
| 3127 | (nconc | 3133 | (nconc |
| 3128 | (if (and (car dirs) (not full)) | 3134 | (if (and (car dirs) (not full)) |