Subject: Re: bug#2801: 23.0.90; ls-lisp-insert-directory: Variable binding depth exceeds max-specpdl-size

From: Eli Zaretskii <[email-masked]>
Date: Fri, 27 Mar 2009 21:34:41 +0300

> From: "Drew Adams" <[email-masked]>
> Date: Fri, 27 Mar 2009 08:13:28 -0700
> Cc: 
> 
> emacs -Q
>  
> C-x 4 d, then enter -alFR and the name of a directory that has a few
> subdirectory levels. The error message appears after a few seconds.
>  
> However, using -alR works fine.

Thanks.  Fixed with the following change:

2009-03-27  Eli Zaretskii  <[email-masked]>

	* ls-lisp.el (ls-lisp-insert-directory): Allow for a trailing '/'
	when looking for "." and "..".  (Bug#2801)

Index: lisp/ls-lisp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ls-lisp.el,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- lisp/ls-lisp.el	28 Jan 2009 19:01:42 -0000	1.81
+++ lisp/ls-lisp.el	27 Mar 2009 18:34:03 -0000	1.82
@@ -390,7 +390,10 @@
 	      (setq elt (car file-alist)
 		    file-alist (cdr file-alist))
 	      (when (and (eq (cadr elt) t) ; directory
-			 (not (string-match "\\`\\.\\.?\\'" (car elt))))
+			 ;; Under -F, we have already decorated all
+			 ;; directories, including "." and "..", with
+			 ;; a /, so allow for that as well.
+			 (not (string-match "\\`\\.\\.?/?\\'" (car elt))))
 		(setq elt (expand-file-name (car elt) dir))
 		(insert "\n" elt ":\n")
 		(ls-lisp-insert-directory