X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=dict%2Fscan.c;h=76032f31d8ea6f2083f82d2bd6266ead1242722e;hp=bbf137428dac49f7836765ff59c99cac0b63c0c6;hb=b77bd2711727692478a0d7d1e0703d4194831cef;hpb=f459d0203a4fdee2d60046f5cd4596e43efc9f90 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; }