]> git.notmuchmail.org Git - notmuch/commitdiff
Avoid bogus internal error reporting duplicate In-Reply-To IDs.
authorCarl Worth <cworth@cworth.org>
Sat, 28 Nov 2009 18:01:22 +0000 (10:01 -0800)
committerCarl Worth <cworth@cworth.org>
Sat, 28 Nov 2009 18:01:22 +0000 (10:01 -0800)
This error was tirggered with a debugging build via:

make CXXFLAGS="-DDEBUG"

and reported by David Bremner. The actual error is that I'm an
idiot that doesn't know how to use strcmp's return value. Of
course, the strcmp interface scores a negative 7 on Rusty Russell
ranking of bad interfaces:

http://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html

lib/message.cc

index 03b8c812eeef3238a7b5e7affde23f7b53bf85d6..49519f1e63e40830ac123373c6e24bf813afbcf1 100644 (file)
@@ -318,7 +318,7 @@ _notmuch_message_get_in_reply_to (notmuch_message_t *message)
     in_reply_to = *i;
 
     if (i != message->doc.termlist_end () &&
-       strncmp ((*i).c_str (), prefix, prefix_len))
+       strncmp ((*i).c_str (), prefix, prefix_len) == 0)
     {
        INTERNAL_ERROR ("Message %s has duplicate In-Reply-To IDs: %s and %s\n",
                        notmuch_message_get_message_id (message),