summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-04 23:47:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-04 23:47:25 +0000
commit49329f48b7ba021204af09a9d60f727ba368b72f (patch)
treecc3283c696f25c9fae60da74666b31d108bf4d5e
parent748d500bc44ac5b5077ace08606d6dfcbc88c425 (diff)
Fix for bug first noticed by zephyrus where you could send -j+ntr to a channel which has +ntrj, and see the mode change "-j+" - now strips off any trailing + or - chars
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3458 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/mode.cpp9
-rwxr-xr-xsrc/svn-rev.sh2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 2ff9e003d..02da655d1 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -1127,12 +1127,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
}
}
- /* This means the mode line is something like: "+o-", we have to take the last char off.
- if ((*--modechar == '-') || (*modechar == '+'))
+ /* This means the mode line is something like: "+o-", we have to take the last char off. */
+ char* x = outlist + strlen(outlist) - 1;
+ while (((*x == '-') || (*x == '+')) && (x != outlist))
{
log(DEBUG,"Cut off trailing modifier");
- *modechar = 0;
- }*/
+ *x-- = 0;
+ }
/* The mode change must be at least two characters long (+ or - and at least one mode) */
if (((*outlist == '+') || (*outlist == '-')) && *(outlist+1))
{
diff --git a/src/svn-rev.sh b/src/svn-rev.sh
index fbf278077..86cc01a73 100755
--- a/src/svn-rev.sh
+++ b/src/svn-rev.sh
@@ -1 +1 @@
-echo 3455
+echo 3457