--- elmo/elmo-imap4.el.orig	Mon Jun 28 17:14:44 1999
+++ elmo/elmo-imap4.el	Fri Sep 10 21:08:55 1999
@@ -469,7 +469,7 @@
 	   (buffer  (nth 0 connection))
 	   (process (nth 1 connection))
 	   (cwf     (nth 2 connection))
-	   response ret-val beg end)
+	   response ret-val end)
       (and (not (null folder))
 	   (if (not (string= cwf folder))
 	       (if (null (setq response 
@@ -486,15 +486,15 @@
 						"search all"))
       (setq response (elmo-imap4-read-response buffer process))
       (if (and response 
-	       (string-match "^\\* SEARCH" response))
+	       (string-match "\\* SEARCH" response))
 	  (progn
-	    (setq beg (match-end 0))
+	    (setq response (substring response (match-end 0)))
 	    (if (string-match "\n" response)
 		(progn
 		  (setq end (match-end 0))
 		  (setq ret-val (read (concat "(" (substring 
 						   response 
-						   beg end) ")"))))
+						   0 end) ")"))))
 	      (error "SEARCH failed."))))
       ret-val)))
 
