Re: [PATCH 2/4] lib: catch error from closed db in n_m_get_message_id

2020-07-08 Thread Floris Bruynooghe
On Sun 05 Jul 2020 at 08:17 -0300, David Bremner wrote: > David Bremner writes: > >> Floris Bruynooghe writes: >> >>> notmuch_database_get_version currently returns and unsigned int and >>> segfaults on use with a closed db. >> >> Yes, the ones without a proper status value are going to be a bit

Re: [PATCH 2/4] lib: catch error from closed db in n_m_get_message_id

2020-07-08 Thread Floris Bruynooghe
On Sat 04 Jul 2020 at 14:17 -0300, David Bremner wrote: > Floris Bruynooghe writes: > > >>> - * This function will not return NULL since Notmuch ensures that every >>> - * message has a unique message ID, (Notmuch will generate an ID for a >>> - * message if the original file does not contain one

Re: [PATCH 2/4] lib: catch error from closed db in n_m_get_message_id

2020-07-05 Thread David Bremner
David Bremner writes: > Floris Bruynooghe writes: > >> notmuch_database_get_version currently returns and unsigned int and >> segfaults on use with a closed db. > > Yes, the ones without a proper status value are going to be a bit work. > > In the next series I just posted [1], I started providi

Re: [PATCH 2/4] lib: catch error from closed db in n_m_get_message_id

2020-07-04 Thread David Bremner
Floris Bruynooghe writes: >> - * This function will not return NULL since Notmuch ensures that every >> - * message has a unique message ID, (Notmuch will generate an ID for a >> - * message if the original file does not contain one). >> + * This function will return NULL if triggers an unhandle

Re: [PATCH 2/4] lib: catch error from closed db in n_m_get_message_id

2020-07-04 Thread Floris Bruynooghe
Nice. On Mon 29 Jun 2020 at 22:14 -0300, David Bremner wrote: > diff --git a/lib/notmuch.h b/lib/notmuch.h > index ceb5a018..0dc89547 100644 > --- a/lib/notmuch.h > +++ b/lib/notmuch.h > @@ -1363,9 +1363,8 @@ notmuch_message_get_database (const notmuch_message_t > *message); > * message is vali

[PATCH 2/4] lib: catch error from closed db in n_m_get_message_id

2020-06-30 Thread David Bremner
By catching it at the library top level, we can return an error value. --- lib/message.cc | 23 +++ lib/notmuch.h | 5 ++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/message.cc b/lib/message.cc index 0fa0eb3a..b7a64b1c 100644 --- a/lib/message.cc ++