From b77bd2711727692478a0d7d1e0703d4194831cef Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 31 Aug 2011 19:40:01 +0200 Subject: [PATCH] Fix bug #4592: dict_scan misses --- dict/scan.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/dict/scan.c b/dict/scan.c index bbf1374..76032f3 100644 --- a/dict/scan.c +++ b/dict/scan.c @@ -199,10 +199,27 @@ void dict_scan_r(Dict dict, Dict_ptr ptr, int pos, Dict_char *str, scan_direction(dict, subptr, pos+1, str, -1, after, client, userfunc, 1); } - else if (subptr) + else { - dict_scan_r(dict, subptr, pos+1, str, before, after, - client, userfunc); + if (subptr) + dict_scan_r(dict, subptr, pos+1, str, before, after, + client, userfunc); + if (info[sizeof(Dict_ptr)+sizeof(Dict_char)]) + { + if (*before) + { + str[pos+1] = DICT_EOS; + if ((*userfunc)((char*) str, + info+sizeof(Dict_ptr)+ + sizeof(Dict_char), + - *before, client)) + { + *before = 0; + } + else + --(*before); + } + } } break; } -- 1.7.10.4