changeset 68750:475285e9bca9

(mh-folder-list): Don't replace "/*$" with "/" since that causes an infinite loop on XEmacs.
author Bill Wohler <wohler@newt.com>
date Thu, 09 Feb 2006 19:53:44 +0000
parents c0b14a7a6a49
children 5f1e7977531e
files lisp/mh-e/ChangeLog lisp/mh-e/mh-utils.el
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mh-e/ChangeLog	Thu Feb 09 19:34:08 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Thu Feb 09 19:53:44 2006 +0000
@@ -1,5 +1,8 @@
 2006-02-09  Bill Wohler  <wohler@newt.com>
 
+	* mh-utils.el (mh-folder-list): Don't replace "/*$" with "/" since
+	that causes an infinite loop on XEmacs.
+
 	* mh-compat.el(mh-replace-regexp-in-string): Add missing regexp
 	argument.
 
--- a/lisp/mh-e/mh-utils.el	Thu Feb 09 19:34:08 2006 +0000
+++ b/lisp/mh-e/mh-utils.el	Thu Feb 09 19:53:44 2006 +0000
@@ -516,13 +516,15 @@
 the sub-folders have not been explicitly viewed, then they will
 not be returned."
   (let ((folder-list))
-    ;; Normalize folder. Strip leading +. Add trailing slash. If no
-    ;; folder is specified, ensure it is nil to ensure we get the
-    ;; top-level folders; otherwise mh-sub-folders returns all the
-    ;; files in / if given an empty string or +.
+    ;; Normalize folder. Strip leading +. Add trailing slash (done in
+    ;; two steps to avoid infinite loops when replacing "/*$" with "/"
+    ;; in XEmacs). If no folder is specified, ensure it is nil to
+    ;; ensure we get the top-level folders; otherwise mh-sub-folders
+    ;; returns all the files in / if given an empty string or +.
     (when folder
       (setq folder (mh-replace-regexp-in-string "^\+" "" folder))
-      (setq folder (mh-replace-regexp-in-string "/*$" "/" folder))
+      (setq folder (mh-replace-regexp-in-string "/+$" "" folder))
+      (setq folder (concat folder "/"))
       (if (equal folder "")
         (setq folder nil)))
     (loop for f in (mh-sub-folders folder) do