3
0
Fork 0
forked from mirrors/nixpkgs

JDEE: Fix infinite recursion in `jde-directory-files-recurs'.

svn path=/nixpkgs/trunk/; revision=16318
This commit is contained in:
Ludovic Courtès 2009-07-10 14:13:52 +00:00
parent d877e7b40f
commit 5c7cc2ffdb
2 changed files with 26 additions and 1 deletions

View file

@ -17,7 +17,7 @@ in
patches = [
./installation-layout.patch ./cedet-paths.patch ./elib-avltree.patch
./java-directory.patch
./java-directory.patch ./jde-directory-files-recurs.patch
];
configurePhase = ''

View file

@ -0,0 +1,25 @@
This patch fixes a possible infinite recursion in `jde-directory-files-recurs'.
It could occur, e.g., when DIR contains multiple slashes: we end up recursing
on "DIR/." forever.
--- jde/lisp/jde.el (revision 90)
+++ jde/lisp/jde.el (working copy)
@@ -1500,14 +1500,14 @@ SYMBOL is unnecessary."
"Get all the files in DIR, and any subdirectories of DIR, whose
names match INCLUDE-REGEXP."
(let (files)
- (loop for file in (directory-files dir t) do
- (if (not (or (string= (concat dir "/.") file)
- (string= (concat dir "/..") file)))
+ (loop for file in (directory-files dir) do
+ (if (not (member file '("." "..")))
+ (let ((file (concat dir "/" file)))
(if (file-directory-p file)
(setq files (append files (jde-directory-files-recurs file include-regexp)))
(if (or (not include-regexp)
(string-match include-regexp file))
- (setq files (append files (list file)))))))
+ (setq files (append files (list file))))))))
files))
(defun jde-expand-directory (dir include-regexp exclude-regexps symbol)