From: Rick L Bird Date: Fri, 22 Apr 2011 21:03:08 +0000 (-0400) Subject: match() was broken IssueID #96 X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=1e04ef1fe7842b17bca495855ebd99a3801b3115;p=cobramush.git match() was broken IssueID #96 PennMUSH Enhancement 1.8.4p9 --- diff --git a/src/chunk.c b/src/chunk.c index 1098f29..5000414 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -211,11 +211,11 @@ #include "config.h" #include "conf.h" +#define _XOPEN_SOURCE 600 #include #include #include -#define _XOPEN_SOURCE 600 #include #include #include diff --git a/src/db.c b/src/db.c index b430c23..c0de750 100644 --- a/src/db.c +++ b/src/db.c @@ -21,8 +21,8 @@ #include #endif #include -#include #include +#include #include #include "conf.h" #include "dbio.h" @@ -2445,6 +2445,7 @@ penn_fputs(const char *s, PENNFILE *f) #ifdef HAVE_LIBZ OUTPUT(gzputs(f->handle.g, s)); #endif + break; } return 0; } diff --git a/src/funlist.c b/src/funlist.c index 9bfc132..56c8c3f 100644 --- a/src/funlist.c +++ b/src/funlist.c @@ -1601,16 +1601,16 @@ FUNCTION(fun_match) char *s, *r; char sep; int wcount = 1; - size_t len; - char needle[BUFFER_LEN]; + char needle[BUFFER_LEN], haystack[BUFFER_LEN]; if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; - strncpy(needle, remove_markup(args[1], &len), BUFFER_LEN); + strncpy(haystack, remove_markup(args[0], NULL), BUFFER_LEN); + strncpy(needle, remove_markup(args[1], NULL), BUFFER_LEN); /* Walk the wordstring, until we find the word we want. */ - s = trim_space_sep(remove_markup(args[0], &len), sep); + s = trim_space_sep(haystack, sep); do { r = split_token(&s, sep); if (quick_wild(needle, r)) {