NOTE: This patch has been committed. The version below is
informational only (whitespace differences have been removed).

                Dear Big Brothers,

The following patch fixes an infinite loop that was due to a misplaced
iteration in bbdb-collect-all-aliases (you could see the effect when
defining mail aliases for a record without a net field).
        


ChangeLog addition:

2008-01-29  Didier Verna  <[EMAIL PROTECTED]>

        * lisp/bbdb-com.el (bbdb-collect-all-aliases): Fix infite loop due
        to misplaced iteration. This occurred when triggering the warning.


BBDB source patch:
Diff command:   cvs -q diff -u -t -b -B -w
Files affected: lisp/bbdb-com.el
===================================================================
RCS

Index: lisp/bbdb-com.el
===================================================================
RCS file: /cvsroot/bbdb/bbdb/lisp/bbdb-com.el,v
retrieving revision 1.198
diff -u -u -t -b -B -w -r1.198 bbdb-com.el
--- lisp/bbdb-com.el    4 Dec 2007 23:25:11 -0000       1.198
+++ lisp/bbdb-com.el    29 Jan 2008 10:50:02 -0000
@@ -2680,13 +2680,13 @@
   (let* ((aliases-field bbdb-define-all-aliases-field)
          (target (cons bbdb-define-all-aliases-field "."))
          (records (bbdb-search (bbdb-records) nil nil nil target))
-         r nets aliases result)
-    (while records
-      (setq r (car records)
-            nets (bbdb-record-net r))
+         nets aliases result)
+    (dolist (r records)
+      (setq nets (bbdb-record-net r))
       (if (null nets)
           (if (not bbdb-silent-running)
-              (bbdb-warn "record %S has no network address, but the aliases: 
%s"
+              (bbdb-warn
+               "record %S has no network address, but the aliases: %s"
                          (bbdb-record-name r)
                          (bbdb-record-getprop r aliases-field)))
         (setq aliases (bbdb-split (bbdb-record-getprop r aliases-field) ","))
@@ -2702,7 +2702,8 @@
                    ;; the NTH net of the record
                    (setq item (string-to-number (match-string 2 alias))
                          item (list (or (nth item nets)
-                                        (error "net[%d] for alias %S does not 
exist!"
+                                        (error
+                                         "net[%d] for alias %S does not exist!"
                                                item alias)))
                          alias (match-string 1 alias)))
                   ((string-match "^\\(.+\\)/\\(.+\\)$" alias)
@@ -2721,8 +2722,7 @@
               (if (setq match (assoc alias result))
                   (nconc match (cons item nil))
                 (setq result (cons (list alias item) result))))
-            (setq aliases (cdr aliases))))
-        (setq records (cdr records))))
+            (setq aliases (cdr aliases))))))
     result))
 
 (defun bbdb-expand-alias (alias-items aliases &optional seen-aliases)

-- 
Resistance is futile. You will be jazzimilated.

Didier Verna, [EMAIL PROTECTED], http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire   Tel.+33 (0)1 44 08 01 85
94276 Le Kremlin-BicĂȘtre, France   Fax.+33 (0)1 53 14 59 22  [EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to