From 66539071dea7bb0e463d8bf378d59398245d9f70 Mon Sep 17 00:00:00 2001 From: Max Regan Date: Sun, 22 Jul 2018 16:17:50 -0700 Subject: [PATCH] tri: exact matches are never ambiguous Even when the exact match is a prefix of a longer match. --- src/common/tri.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/tri.c b/src/common/tri.c index 1f8682b..7778d16 100644 --- a/src/common/tri.c +++ b/src/common/tri.c @@ -113,6 +113,10 @@ void *tri_get_string_autocomplete(struct tri *tri, const char *string, bool *amb node = node->nodes[idx]; } + if (node->value) { + return node->value; + } + while(1) { struct tri_node *next_node = NULL; int num_paths = 0;