branch: externals/ebdb
commit b7a28f34e3ca0d20fe87789b8f253b190da15406
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>

    Be more forgiving about contents of BBDB file when migrating
    
    * ebdb-migrate.el (ebdb-migrate-parse-records): Make fewer
      assumptions. Just search forward for something that looks like the
      beginning of a record.
---
 ebdb-migrate.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ebdb-migrate.el b/ebdb-migrate.el
index 471a0c6..39a48de 100644
--- a/ebdb-migrate.el
+++ b/ebdb-migrate.el
@@ -627,10 +627,9 @@ holding valid contacts in a previous BBDB format."
             (error "EBDB version %s understands file format %s but not %s."
                    ebdb-version ebdb-file-format file-format)
           (setq migrate (< file-format ebdb-file-format)))
-       (forward-char)
-        (or (eobp) (looking-at "\\[")
-            (error "BBDB corrupted: no following bracket"))
-
+       (unless (re-search-forward "^\\[" nil t)
+         (error "Unreadabe BBDB file: no contacts found"))
+       (goto-char (point-at-bol))
         ;; narrow the buffer to skip over the rubbish before the first record.
         (narrow-to-region (point) (point-max))
         (let ((modp (buffer-modified-p))

Reply via email to