X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=dict%2Fscan.c;h=76032f31d8ea6f2083f82d2bd6266ead1242722e;hp=0485d94272da447ccbdf5191bb9a396cdeff031c;hb=c97718edd01f7d1813edbf94c58b93a747143311;hpb=a89d8384ad975fdddb2aa56e8c27b689a5e23f96 diff --git a/dict/scan.c b/dict/scan.c index 0485d94..76032f3 100644 --- a/dict/scan.c +++ b/dict/scan.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -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; }