]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-host.c
fix makefile of jupe module
[irc/quakenet/newserv.git] / newsearch / ns-host.c
index 2dd5bf3e42708a266aacb4e84ec4d9521dfcf6a9..9b0f13295a2f27b088d714bd25bf80e257c01eef 100644 (file)
@@ -15,8 +15,9 @@ void *host_exe_real(searchCtx *ctx, struct searchNode *thenode, void *theinput);
 void host_free(searchCtx *ctx, struct searchNode *thenode);
 
 struct searchNode *host_parse(searchCtx *ctx, int argc, char **argv) {
-  struct searchNode *thenode;
-
+  struct searchNode *thenode, *argsn;
+  char *p;
+  
   if (!(thenode=(struct searchNode *)malloc(sizeof (struct searchNode)))) {
     parseError = "malloc: could not allocate memory for this search.";
     return NULL;
@@ -32,11 +33,16 @@ 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;
+  }
+  
   /* Allow "host real" to match realhost */
-
-  if (argc>0 && !ircd_strcmp(argv[0],"real")) {
+  if (argc>0 && !ircd_strcmp(p,"real"))
     thenode->exe = host_exe_real;
-  }
+    
+  argsn->free(ctx, argsn);
 
   return thenode;
 }