about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2023-02-03 16:21:26 -0500
committerJune McEnroe <june@causal.agency>2023-02-03 16:21:26 -0500
commit4961fdf75ead42902d13e847356bf8c554d0a9c9 (patch)
treeb858648f0d38ffcf7e077f651159e5e2f5974850 /command.c
parentHandle missing LIST reply topic parameter (diff)
downloadcatgirl-4961fdf75ead42902d13e847356bf8c554d0a9c9.tar.gz
catgirl-4961fdf75ead42902d13e847356bf8c554d0a9c9.zip
Flatten cache structs
Diffstat (limited to '')
-rw-r--r--command.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/command.c b/command.c
index 4fb58da..23b5e89 100644
--- a/command.c
+++ b/command.c
@@ -419,11 +419,10 @@ static void commandWindow(uint id, char *params) {
 			windowShow(windowFor(id));
 			return;
 		}
-		struct Cursor curs = {0};
-		for (const char *match; (match = cacheSearch(&curs, None, params));) {
-			id = idFind(match);
+		for (struct Cursor curs = {0}; cacheSearch(&curs, None, params);) {
+			id = idFind(curs.entry->key);
 			if (!id) continue;
-			cacheAccept(&curs);
+			cacheTouch(&curs);
 			windowShow(windowFor(id));
 			break;
 		}