]> git.notmuchmail.org Git - notmuch/commit
emacs: Fix exception when fetching empty or unconfigured settings
authorAustin Clements <amdragon@MIT.EDU>
Thu, 20 Feb 2014 19:16:35 +0000 (14:16 -0500)
committerDavid Bremner <david@tethera.net>
Sat, 22 Feb 2014 23:51:03 +0000 (19:51 -0400)
commit4b734374fb2e26ef54414c8f0b933271fdf58c3b
treecee6f3a0a795e3aa94eada286c1a86a6e50b4bd8
parent1326ec09ee369b152a6c9bed5fe42c2d80180d01
emacs: Fix exception when fetching empty or unconfigured settings

When "notmuch config" is called with the name of an empty or
unconfigured setting, it prints nothing (not even a new line).
Previously, `notmuch-config-get' assumed it would always print a
newline.  As a result, when `notmuch-config-get' was called with the
name of an empty of unconfigured setting, it would attempt to
(substring "" 0 -1) to strip the newline, which would fail with a
(args-out-of-range "" 0 -1) exception.

Fix this by only stripping the newline if there actually is one.
emacs/notmuch-lib.el