We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02db084 commit 1dc321fCopy full SHA for 1dc321f
zson.c
@@ -200,8 +200,14 @@ dict_find_match(const Dict* pdict,
200
size_t nbytes = pdict->words[current].nbytes;
201
202
if(nbytes > buff_size)
203
- res = 1; // current is greater
204
- else
+ {
+ /* current can be less or greater depending on the prefix */
205
+ res = memcmp(pdict->words[current].word, buff, buff_size);
206
+
207
+ /* if prefixes match, current is greater */
208
+ if(res == 0)
209
+ res = 1;
210
+ } else
211
res = memcmp(pdict->words[current].word, buff, nbytes);
212
213
if(res == 0) // match
0 commit comments