From 5b82d45851247d11aa4c1e7a75095949206d1490 Mon Sep 17 00:00:00 2001 From: Garrett Holmstrom Date: Sun, 3 Jun 2012 01:22:43 -0700 Subject: [PATCH] mlocktweaker: consider all mode characters --- mlocktweaker.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/mlocktweaker.c b/mlocktweaker.c index 3e94f11..b3fbf61 100644 --- a/mlocktweaker.c +++ b/mlocktweaker.c @@ -47,17 +47,21 @@ static void handle_channel_register(hook_channel_req_t *hdata) target = &mc->mlock_on; it = str; - switch(*it++ != '\0') + while (*it != '\0') { - case '+': - target = &mc->mlock_on; - break; - case '-': - target = &mc->mlock_off; - break; - default: - *target |= mode_to_flag(*it); - break; + switch (*it) + { + case '+': + target = &mc->mlock_on; + break; + case '-': + target = &mc->mlock_off; + break; + default: + *target |= mode_to_flag(*it); + break; + } + ++it; } mc->mlock_off &= ~mc->mlock_on;