diff --git a/pkgs/applications/editors/emacs-modes/jdee/default.nix b/pkgs/applications/editors/emacs-modes/jdee/default.nix index 78c17d30843f..8983b6d210e2 100644 --- a/pkgs/applications/editors/emacs-modes/jdee/default.nix +++ b/pkgs/applications/editors/emacs-modes/jdee/default.nix @@ -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 = '' diff --git a/pkgs/applications/editors/emacs-modes/jdee/jde-directory-files-recurs.patch b/pkgs/applications/editors/emacs-modes/jdee/jde-directory-files-recurs.patch new file mode 100644 index 000000000000..06a2ce4ea9d2 --- /dev/null +++ b/pkgs/applications/editors/emacs-modes/jdee/jde-directory-files-recurs.patch @@ -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)