]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-host.c
CHANSERV: fix issue where chanserv_relay doesn't wait for db to be loaded before...
[irc/quakenet/newserv.git] / newsearch / ns-host.c
index 9b0f13295a2f27b088d714bd25bf80e257c01eef..ab919d840f016c012ab75a57565f5f17394e6dfc 100644 (file)
@@ -33,16 +33,18 @@ struct searchNode *host_parse(searchCtx *ctx, int argc, char **argv) {
   thenode->exe = host_exe;
   thenode->free = host_free;
 
-  if (!(argsn=argtoconststr("host", ctx, argv[0], &p))) {
-    free(thenode);
-    return NULL;
-  }
+  if (argc>0) {
+    if (!(argsn=argtoconststr("host", ctx, argv[0], &p))) {
+      free(thenode);
+      return NULL;
+    }
   
-  /* Allow "host real" to match realhost */
-  if (argc>0 && !ircd_strcmp(p,"real"))
-    thenode->exe = host_exe_real;
-    
-  argsn->free(ctx, argsn);
+    /* Allow "host real" to match realhost */
+    if (!ircd_strcmp(p,"real"))
+      thenode->exe = host_exe_real;
+
+    argsn->free(ctx, argsn);
+  }
 
   return thenode;
 }