]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Fix nicksearch (match (nick) '') bug.
authorChris Porter <redacted>
Tue, 28 Oct 2008 00:33:02 +0000 (00:33 +0000)
committerChris Porter <redacted>
Tue, 28 Oct 2008 00:33:02 +0000 (00:33 +0000)
newsearch/newsearch.y

index 734ec23906b2992afcc12ed0d135e9fcef3d5075..bcf26cb731627d047c1c46111503985dc182ffb2 100644 (file)
@@ -149,16 +149,23 @@ argument:
        {
     sstring *str = $1;
     parserlist *l = malloc(sizeof(parserlist));
-    stringlist *sl = malloc(sizeof(stringlist));
-    
-    l->expr = NSASTLiteral(str->content);
+
+    if(str) {
+      stringlist *sl;
+      l->expr = NSASTLiteral(str->content);
+
+      sl = malloc(sizeof(stringlist));
+      sl->data = str;
+      sl->next = (*presult)->strlist;
+      (*presult)->strlist = sl;
+    } else {
+      l->expr = NSASTLiteral("");
+    }
+
     l->next = stack[stackpos - 1];
     stack[stackpos - 1] = l;
     stackcount[stackpos - 1]++;
 
-    sl->data = str;
-    sl->next = (*presult)->strlist;
-    (*presult)->strlist = sl;
        }
        ;