X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Frecgrs.c;h=7e755a1eb9819891cd988bd181ec7f998949892f;hb=e4e44d1916c6e80e01aad163b487ee41c22272ba;hp=d7f80e798783cccf500fb441be9f838ca2ecea71;hpb=793cada3ccf8a89a1362e70aabdd1e2c588319f4;p=idzebra-moved-to-github.git diff --git a/index/recgrs.c b/index/recgrs.c index d7f80e7..7e755a1 100644 --- a/index/recgrs.c +++ b/index/recgrs.c @@ -1,8 +1,5 @@ -/* $Id: recgrs.c,v 1.22 2008-01-09 22:17:34 adam Exp $ - Copyright (C) 1995-2007 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + 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 @@ -20,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -107,12 +107,18 @@ static int sp_range(struct source_parser *sp, data1_node *n, RecWord *wrd) return 0; sp_lex(sp); - if (wrd->term_buf && wrd->term_len) + if (wrd->term_buf) { - wrd->term_buf += start; - wrd->term_len -= start; - if (wrd->term_len > len) - wrd->term_len = len; + if (start >= wrd->term_len) + wrd->term_len = 0; + else + { + wrd->term_len -= start; + wrd->term_buf += start; + + if (wrd->term_len > len) + wrd->term_len = len; + } } return 1; } @@ -566,7 +572,7 @@ static void index_xpath(struct source_parser *sp, data1_node *n, memcpy(&wrd_tl, wrd, sizeof(*wrd)); if (tl->source) sp_parse(sp, n, &wrd_tl, tl->source); - + /* this is just the old fashioned attribute based index */ wrd_tl.index_name = tl->index_name; if (p->flagShowRecords) @@ -1167,7 +1173,6 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p, yaz_log(YLOG_DEBUG, "grs_retrieve: schema mapping"); for (map = node->u.root.absyn->maptabs; map; map = map->next) { - // if (map->target_absyn_ref == requested_schema) if (!oid_oidcmp(map->oid, requested_schema)) { onode = node; @@ -1361,6 +1366,7 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab