X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzrpn.c;h=5bee0e77969d93df1ae7699ff6d65934e67fc6ca;hb=ac300df2169e3dcbdf9ab726349925cc3a122028;hp=db339e5569884a884b86ffc6293a1f98c4216a27;hpb=ff83da9583191588c5816189b55966a6bb057d71;p=idzebra-moved-to-github.git diff --git a/index/zrpn.c b/index/zrpn.c index db339e5..5bee0e7 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $Id: zrpn.c,v 1.206 2005-11-02 11:43:26 adam Exp $ +/* $Id: zrpn.c,v 1.209 2006-02-20 12:38:42 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++; @@ -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); @@ -1241,11 +1245,6 @@ static ZEBRA_RES string_term(ZebraHandle zh, Z_AttributesPlusTerm *zapt, attr_ok = 1; term_dict[prefix_len++] = ')'; -#if REG_TYPE_PREFIX - term_dict[prefix_len++] = 1; - term_dict[prefix_len++] = reg_type; - yaz_log(log_level_rpn, "reg_type = %d", term_dict[prefix_len-1]); -#endif term_dict[prefix_len] = '\0'; j = prefix_len; switch (truncation_value) @@ -1893,11 +1892,6 @@ static ZEBRA_RES numeric_term(ZebraHandle zh, Z_AttributesPlusTerm *zapt, } bases_ok++; term_dict[prefix_len++] = ')'; -#if REG_TYPE_PREFIX - term_dict[prefix_len++] = 1; - term_dict[prefix_len++] = reg_type; - yaz_log(YLOG_DEBUG, "reg_type = %d", term_dict[prefix_len-1]); -#endif term_dict[prefix_len] = '\0'; if (!numeric_relation(zh, zapt, &termp, term_dict, attributeSet, grep_info, &max_pos, reg_type, @@ -2158,10 +2152,6 @@ static RSET xpath_trunc(ZebraHandle zh, NMEM stream, term_dict[prefix_len++] = ord_buf[i]; } term_dict[prefix_len++] = ')'; -#if REG_TYPE_PREFIX - term_dict[prefix_len++] = 1; - term_dict[prefix_len++] = reg_type; -#endif strcpy(term_dict+prefix_len, term); grep_info.isam_p_indx = 0; @@ -2926,9 +2916,6 @@ ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, scan_info->list[j].term = NULL; prefix_len += key_SU_encode (ords[i], termz + prefix_len); -#if REG_TYPE_PREFIX - termz[prefix_len++] = reg_id; -#endif termz[prefix_len] = 0; strcpy(scan_info->prefix, termz);