X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzrpn.c;h=ade12f27fe47470644bcfbb5edc119882b63fafa;hb=746f36f2b12f2a342dc0213cb03458359a493c8f;hp=9cf39d43ffeec5853358bb7c600a6d10bf68d4ea;hpb=34552d7bc714468512b1873f1d6b75608d6b4655;p=idzebra-moved-to-github.git diff --git a/index/zrpn.c b/index/zrpn.c index 9cf39d4..ade12f2 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $Id: zrpn.c,v 1.207 2005-11-09 11:51:30 adam Exp $ +/* $Id: zrpn.c,v 1.210 2006-03-30 09:52:16 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -181,8 +181,12 @@ void zebra_term_untrans(ZebraHandle zh, int reg_type, { const char *cp = zebra_maps_output(zh->reg->zebra_maps, reg_type, &src); - if (!cp && len < IT_MAX_WORD-1) - dst[len++] = *src++; + if (!cp) + { + if (len < IT_MAX_WORD-1) + dst[len++] = *src; + src++; + } else while (*cp && len < IT_MAX_WORD-1) dst[len++] = *cp++; @@ -241,7 +245,7 @@ static void add_isam_p(const char *name, const char *info, zebra_term_untrans (p->zh, p->reg_type, term_tmp, name+len+1); yaz_log(log_level_rpn, "grep: %d %c %s", ord, name[len], term_tmp); zebraExplain_lookup_ord (p->zh->reg->zei, - ord, 0 /* index_type */, &db, &set, &use); + ord, 0 /* index_type */, &db, &set, &use, 0); yaz_log(log_level_rpn, "grep: set=%d use=%d db=%s", set, use, db); resultSetAddTerm(p->zh, p->termset, name[len], db, @@ -1005,7 +1009,7 @@ static ZEBRA_RES term_limits_APT(ZebraHandle zh, attr_init(&term_ref_id_attr, zapt, 10); term_ref_id_int = attr_find_ex(&term_ref_id_attr, NULL, term_ref_id_str); - if (term_ref_id_int != -1) + if (term_ref_id_int >= 0) { char *res = nmem_malloc(nmem, 20); sprintf(res, "%d", term_ref_id_int);