about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/client.c b/client.c
index 3e6c2f9..18aef87 100644
--- a/client.c
+++ b/client.c
@@ -130,8 +130,10 @@ static void handleCap(struct Client *client, struct Message msg) {
 	if (!msg.params[0]) msg.params[0] = "";
 
 	if (!strcmp(msg.params[0], "END")) {
-		client->need &= ~NeedCapEnd;
-		if (!client->need) stateSync(client);
+		if (client->need & NeedCapEnd) {
+			client->need &= ~NeedCapEnd;
+			if (!client->need) stateSync(client);
+		}
 
 	} else if (!strcmp(msg.params[0], "LS")) {
 		client->need |= NeedCapEnd;