summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-27 02:48:24 -0500
committerJune McEnroe <june@causal.agency>2020-02-27 02:48:24 -0500
commit6f9c7cc607ce42ce1c6e893b34dc14cd4eaa396e (patch)
tree3d71a3080b70f21abdad89b2ceaf04f2747c05c0 /client.c
parentSupport CAP LS 302 from clients (diff)
downloadpounce-6f9c7cc607ce42ce1c6e893b34dc14cd4eaa396e.tar.gz
pounce-6f9c7cc607ce42ce1c6e893b34dc14cd4eaa396e.zip
Properly treat CAP LS version as a number
Diffstat (limited to '')
-rw-r--r--client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.c b/client.c
index f66ea0e..92ca632 100644
--- a/client.c
+++ b/client.c
@@ -176,7 +176,9 @@ static void handleCap(struct Client *client, struct Message *msg) {
 
 	} else if (!strcmp(msg->params[0], "LS")) {
 		if (client->need) client->need |= NeedCapEnd;
-		if (msg->params[1] && !strcmp(msg->params[1], "302")) {
+		int version = 0;
+		if (msg->params[1]) version = strtol(msg->params[1], NULL, 10);
+		if (version >= 302) {
 			if (avail & CapCapNotify) client->caps |= CapCapNotify;
 			clientFormat(
 				client, ":%s CAP * LS :%s\r\n",
s='nohover-highlight'> Since ctags only ever produces regular expressions of the form /^re$/ or /^re/ with no other special characters, instead unescape the pattern and simply use strncmp. Running on a sqlite3.c amalgamation, the regex version takes ~37s while the strncmp version takes ~1s, producing identical output. Big win! 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe This fixes badly indented comments. 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe