summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/bs_badwords.c28
-rw-r--r--src/core/cs_akick.c2
-rw-r--r--version.log6
3 files changed, 33 insertions, 3 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)) {
diff --git a/version.log b/version.log
index 7fc2d0638..c07a1c525 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="19"
VERSION_EXTRA="-svn"
-VERSION_BUILD="1267"
+VERSION_BUILD="1268"
# $Log$
#
+# BUILD : 1.7.19 (1268)
+# BUGS : 662
+# NOTES : badword counting fixed, and now the list is sorted also. fixed remaining bug in akick sorting.
+#
# BUILD : 1.7.19 (1267)
# BUGS : 662
# NOTES : akick counts are now properly decressed. os_info now really uses status var. some module clean ups.