From a26e439b57a16e31a8fb67a079cbad659c21fd39 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 19 Dec 2006 07:57:34 -0800 Subject: [PATCH] dict: Fix bug in for_each iterations with no max_length limit We've been using an idiom of min_length == 0, max_length == 0 to indicate no length limit, but this has apparently been broken since the rework of the for_each interfaces that introduced this. --- dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dict.c b/dict.c index 11ddaf1..b2ad495 100644 --- a/dict.c +++ b/dict.c @@ -231,7 +231,7 @@ trie_for_each_of_length_if (trie_t *trie, action (closure, string->s, &trie->flags); } - if (length == max_length) + if (max_length > 0 && length == max_length) return count; /* Loop over each element, appending the character and recursing. */ -- 2.43.0