]> granicus.if.org Git - neomutt/commitdiff
notify: fix observer retval
authorRichard Russon <rich@flatcap.org>
Tue, 2 Jul 2019 14:27:28 +0000 (15:27 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 5 Jul 2019 11:16:25 +0000 (12:16 +0100)
mutt/notify.c

index 164f5f6166a563d96228a19cd4b8ce568be00cf5..4f369a1e7b7ffe5408a55dc9164ffb60ae527b7d 100644 (file)
@@ -193,6 +193,7 @@ bool notify_observer_remove(struct Notify *notify, observer_t callback)
   if (!notify)
     return false;
 
+  bool result = false;
   struct ObserverNode *np = NULL;
   struct ObserverNode *tmp = NULL;
   STAILQ_FOREACH_SAFE(np, &notify->observers, entries, tmp)
@@ -202,10 +203,11 @@ bool notify_observer_remove(struct Notify *notify, observer_t callback)
       STAILQ_REMOVE(&notify->observers, np, ObserverNode, entries);
       FREE(&np->observer);
       FREE(&np);
+      result = true;
       if (callback)
-        return true;
+        break;
     }
   }
 
-  return false;
+  return result;
 }