changeset 6294:6044f2615082

(find-buffer-visiting): Don't compare NUMBER if it is nil.
author Richard M. Stallman <rms@gnu.org>
date Thu, 10 Mar 1994 17:23:56 +0000
parents 649c8a929063
children 59a6684e8057
files lisp/files.el
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Mar 10 17:22:59 1994 +0000
+++ b/lisp/files.el	Thu Mar 10 17:23:56 1994 +0000
@@ -592,17 +592,18 @@
 	  found)
 	(let ((number (nthcdr 10 (file-attributes truename)))
 	      (list (buffer-list)) found)
-	  (while (and (not found) list)
-	    (save-excursion
-	      (set-buffer (car list))
-	      (if (and (equal buffer-file-number number)
-		       ;; Verify this buffer's file number
-		       ;; still belongs to its file.
-		       (file-exists-p buffer-file-name)
-		       (equal (nthcdr 10 (file-attributes buffer-file-name))
-			      number))
-		  (setq found (car list))))
-	    (setq list (cdr list)))
+	  (and number
+	       (while (and (not found) list)
+		 (save-excursion
+		   (set-buffer (car list))
+		   (if (and (equal buffer-file-number number)
+			    ;; Verify this buffer's file number
+			    ;; still belongs to its file.
+			    (file-exists-p buffer-file-name)
+			    (equal (nthcdr 10 (file-attributes buffer-file-name))
+				   number))
+		       (setq found (car list))))
+		 (setq list (cdr list))))
 	  found))))
 
 (defun find-file-noselect (filename &optional nowarn)