summaryrefslogtreecommitdiffstats
path: root/cmd-switch-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-switch-client.c')
-rw-r--r--cmd-switch-client.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/cmd-switch-client.c b/cmd-switch-client.c
index dbdc5b63..4c847584 100644
--- a/cmd-switch-client.c
+++ b/cmd-switch-client.c
@@ -52,12 +52,8 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL)
return (CMD_RETURN_ERROR);
- if (args_has(args, 'r')) {
- if (c->flags & CLIENT_READONLY)
- c->flags &= ~CLIENT_READONLY;
- else
- c->flags |= CLIENT_READONLY;
- }
+ if (args_has(args, 'r'))
+ c->flags ^= CLIENT_READONLY;
tablename = args_get(args, 'T');
if (tablename != NULL) {