From: Carl Worth Date: Tue, 19 Dec 2006 15:57:34 +0000 (-0800) Subject: dict: Fix bug in for_each iterations with no max_length limit X-Git-Url: https://git.cworth.org/git?p=wordgame;a=commitdiff_plain;h=a26e439b57a16e31a8fb67a079cbad659c21fd39 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. --- 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. */