emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb b7a28f3 227/350: Be more forgiving about contents


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb b7a28f3 227/350: Be more forgiving about contents of BBDB file when migrating
Date: Mon, 14 Aug 2017 11:46:42 -0400 (EDT)

branch: externals/ebdb
commit b7a28f34e3ca0d20fe87789b8f253b190da15406
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    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

[Prev in Thread] Current Thread [Next in Thread]