]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Fix bug in resynchronizing after a JSON parse error
authorAustin Clements <amdragon@MIT.EDU>
Fri, 14 Dec 2012 15:07:35 +0000 (10:07 -0500)
committerDavid Bremner <bremner@debian.org>
Sat, 15 Dec 2012 17:47:49 +0000 (13:47 -0400)
Previously, if the input stream consisted only of an error message,
notmuch-json-begin-compound would signal a (wrong-type-argument
number-or-marker-p nil) error when reaching the end of the error
message.  This happened because notmuch-json-scan-to-value would think
that it reached a value and put the parser into the 'value state.
Even after notmuch-json-begin-compound signaled the syntax error, the
parser would remain in this state and when the resynchronization logic
reached the end of the buffer, the parser would fail because the
'value state indicates that characters are available.

This fixes this problem by restoring the parser's previous state if it
encounters a syntax error.


No differences found