X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fextract.c;h=593c9e8deda4c7ffe7e68bc7351801c1f5900d37;hb=d9b85731ab7b965b1ae9bc1c283e39faf10a644a;hp=9dd5f7618acad28ba93987e22553d0b2247ad9f1;hpb=6c7e7bbe11beb9394c5e65510dee80ffe69ec637;p=idzebra-moved-to-github.git diff --git a/index/extract.c b/index/extract.c index 9dd5f76..593c9e8 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.154 2004-06-03 11:38:34 adam Exp $ +/* $Id: extract.c,v 1.157 2004-07-28 09:47:41 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -776,16 +776,12 @@ int fileExtract (ZebraHandle zh, SYSNO *sysno, const char *fname, break; } /* determine file type - depending on extension */ - yaz_log(LOG_LOG, "recordType 1=%s", zh->m_record_type ? - zh->m_record_type : ""); original_record_type = zh->m_record_type; if (!zh->m_record_type) { sprintf (ext_res, "%srecordType.%s", gprefix, ext); zh->m_record_type = res_get (zh->res, ext_res); } - yaz_log(LOG_LOG, "recordType 2=%s", zh->m_record_type ? - zh->m_record_type : ""); if (!zh->m_record_type) { if (zh->records_processed < zh->m_file_verbose_limit) @@ -1036,7 +1032,7 @@ int buffer_extract_record (ZebraHandle zh, extract_flushSortKeys (zh, *sysno, -1, &zh->reg->sortKeys); rec_rm (&rec); logRecord(zh); - return 0; + return -1; } } @@ -1659,6 +1655,7 @@ static void extract_add_complete_field (RecWord *p) while (map && *map && **map == *CHR_SPACE) { remain = p->length - (b - p->string); + if (remain > 0) map = zebra_maps_input(p->zebra_maps, p->reg_type, &b, remain); else @@ -1673,10 +1670,17 @@ static void extract_add_complete_field (RecWord *p) { const char *cp = *map; - if (i >= IT_MAX_WORD) - break; - while (i < IT_MAX_WORD && *cp) - buf[i++] = *(cp++); + if (**map == *CHR_CUT) + { + i = 0; + } + else + { + if (i >= IT_MAX_WORD) + break; + while (i < IT_MAX_WORD && *cp) + buf[i++] = *(cp++); + } remain = p->length - (b - p->string); if (remain > 0) map = zebra_maps_input (p->zebra_maps, p->reg_type, &b,