]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Made RGREP clean up properly at the end. Also fixed RGREP help to not say GREP.
authorsplidge <redacted>
Thu, 27 Mar 2008 11:19:45 +0000 (11:19 +0000)
committersplidge <redacted>
Thu, 27 Mar 2008 11:19:45 +0000 (11:19 +0000)
chanserv/chanserv_grep.c

index 33755084dccd990244b918516076cc7cf681a04f..8e4512d6a93a981216bf569ddadb936b6be0df44 100644 (file)
@@ -37,7 +37,7 @@ extern ssize_t pread(int fd, void *buf, size_t count, off_t offset);
 
 void _init() {
   chanservaddcommand("grep",   QCMD_OPER, 1, csg_dogrep,   "Searches the logs.","Usage: GREP <regex>\nSearches the logs.  The current logfile will be specified first, followed by\nall older logfiles found.  This will shuffle the order of results slightly.  Where:\nregex  - regular expression to search for.\nNote: For a case insensitive search, prepend (?i) to the regex.");
-  chanservaddcommand("rgrep",  QCMD_OPER, 2, csg_dorgrep,  "Searches the logs in reverse order.","Usage: GREP <days> <regex>\nSearches the logs.  The oldest specified log will be specified first meaning\nthat all events returned will be in strict chronological order. Where:\ndays  - number of days of history to search\nregex - regex to search for\nNote: For a case insensitive search, prepend (?i) to the regex.");
+  chanservaddcommand("rgrep",  QCMD_OPER, 2, csg_dorgrep,  "Searches the logs in reverse order.","Usage: RGREP <days> <regex>\nSearches the logs.  The oldest specified log will be specified first meaning\nthat all events returned will be in strict chronological order. Where:\ndays  - number of days of history to search\nregex - regex to search for\nNote: For a case insensitive search, prepend (?i) to the regex.");
 }
 
 void _fini() {
@@ -159,6 +159,8 @@ retry:
       csg_curfile--;
       if (csg_curfile<0) {
         chanservstdmessage(np, QM_ENDOFLIST);
+        free(csg_curpat);
+        csg_maxmatches=0;
         return;
       } else if (csg_curfile==0) {
         sprintf(filename,"chanservlog");