summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authordrstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-08-26 20:13:33 +0000
committerdrstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-08-26 20:13:33 +0000
commit17946690bf20433876fa4392537940f4c31a4677 (patch)
tree51f234e6c4f0738d5451dbf7407fcdb63b8f5ad7 /src/core
parent1a5e9120c77aa541cd2f91a7f743c7abea880a4b (diff)
BUILD : 1.7.19 (1268) BUGS : 662 NOTES : badword counting fixed, and now the list is sorted also. fixed remaining bug in akick sorting.
git-svn-id: svn://svn.anope.org/anope/trunk@1268 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@986 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
-rw-r--r--src/core/bs_badwords.c28
-rw-r--r--src/core/cs_akick.c2
2 files changed, 28 insertions, 2 deletions
diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c
index 5a6a9abfe..7698d8cfc 100644
--- a/src/core/bs_badwords.c
+++ b/src/core/bs_badwords.c
@@ -147,6 +147,7 @@ int do_badwords(User * u)
notice_lang(s_BotServ, u, BOT_BADWORDS_ADDED, bw->word, ci->name);
} else if (stricmp(cmd, "DEL") == 0) {
+ int deleted = 0, a, b;
if (readonly) {
notice_lang(s_BotServ, u, BOT_BADWORDS_DISABLED);
@@ -155,7 +156,7 @@ int do_badwords(User * u)
/* Special case: is it a number/list? Only do search if it isn't. */
if (isdigit(*word) && strspn(word, "1234567890,-") == strlen(word)) {
- int count, deleted, last = -1;
+ int count, last = -1;
deleted =
process_numlist(word, &count, badwords_del_callback, u, ci,
&last);
@@ -192,6 +193,31 @@ int do_badwords(User * u)
free(bw->word);
bw->word = NULL;
bw->in_use = 0;
+ deleted = 1;
+ }
+
+ if (deleted) {
+ /* Reordering - DrStein */
+ for (b = 0; b < ci->bwcount; b++) {
+ if (ci->badwords[b].in_use) {
+ for (a = 0; a < ci->bwcount; a++) {
+ if (a > b)
+ break;
+ if (!(ci->badwords[a].in_use)) {
+ ci->badwords[a].in_use = ci->badwords[b].in_use;
+ ci->badwords[a].type = ci->badwords[b].type;
+ if (ci->badwords[b].word) {
+ ci->badwords[a].word = sstrdup(ci->badwords[b].word);
+ free(ci->badwords[b].word);
+ }
+ ci->badwords[b].word = NULL;
+ ci->badwords[b].in_use = 0;
+ break;
+ }
+ }
+ }
+ }
+ ci->bwcount--;
}
} else if (stricmp(cmd, "LIST") == 0) {
diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c
index e67c84fa6..50faad99d 100644
--- a/src/core/cs_akick.c
+++ b/src/core/cs_akick.c
@@ -440,7 +440,7 @@ int do_akick(User * u)
/* Reordering - DrStein */
for (b = 0; b < ci->akickcount; b++) {
if (ci->akick[b].flags & AK_USED) {
- for (a = 1; a < ci->akickcount; a++) {
+ for (a = 0; a < ci->akickcount; a++) {
if (a > b)
break;
if (!(ci->akick[a].flags & AK_USED)) {