X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=dict%2Fscan.c;h=76032f31d8ea6f2083f82d2bd6266ead1242722e;hp=3591a553fd5cf5a4911daf45100a3a695b1d1168;hb=c97718edd01f7d1813edbf94c58b93a747143311;hpb=a030c87bc444608639905eca95e29f84a4f1d991 diff --git a/dict/scan.c b/dict/scan.c index 3591a55..76032f3 100644 --- a/dict/scan.c +++ b/dict/scan.c @@ -18,6 +18,9 @@ */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -196,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; }