]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-reason.c
newsearch: reason function should return "" instead of NULL.
[irc/quakenet/newserv.git] / newsearch / ns-reason.c
index 6a52882505fa682d78f1e7f96695d782386dadc9..c0d6317b076687f0d218114a61d4408d2ea7a688 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * quit functionality
+ * reason functionality
  */
 
 #include "newsearch.h"
@@ -18,7 +18,7 @@ struct searchNode *reason_parse(searchCtx *ctx, int argc, char **argv) {
     return NULL;
   }
 
-  thenode->returntype = RETURNTYPE_BOOL;
+  thenode->returntype = RETURNTYPE_STRING;
   thenode->localdata = NULL;
   thenode->exe = reason_exe;
   thenode->free = reason_free;
@@ -30,9 +30,9 @@ void *reason_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   nick *np = (nick *)theinput;
   whowas *ww = (whowas *)np->next;
 
-  if (ww->type != WHOWAS_RENAME)
-    return (void *)0;
-  
+  if (!ww->reason)
+    return (void *)"";
+
   return (void *)ww->reason->content;
 }