X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Fsafari.c;h=045bf70731eff66aa8bba07788dd214d35633e0f;hb=ebcf2ad410ec9196eee698f021a1bfd6057bdc25;hp=f22ef345305690692f2509a5ef89f591f4d6e477;hpb=9eebf93dc2525854867cbc43920ea8ba4a199ab5;p=idzebra-moved-to-github.git diff --git a/recctrl/safari.c b/recctrl/safari.c index f22ef34..045bf70 100644 --- a/recctrl/safari.c +++ b/recctrl/safari.c @@ -1,4 +1,4 @@ -/* $Id: safari.c,v 1.8 2005-06-23 06:45:47 adam Exp $ +/* $Id: safari.c,v 1.10 2006-03-21 14:36:22 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -86,13 +86,16 @@ static int fi_getchar(struct fi_info *fi, char *dst) static int fi_gets(struct fi_info *fi, char *dst, int max) { - int l; - for (l = 0; l < max; l++) + int l = 0; + while(1) { - if (!fi_getchar(fi, dst+l)) + char dstbyte; + if (!fi_getchar(fi, &dstbyte)) return 0; - if (dst[l] == '\n') + if (dstbyte == '\n') break; + if (l < max) + dst[l++] = dstbyte; } dst[l] = '\0'; return 1; @@ -123,7 +126,7 @@ static int filter_extract(void *clientData, struct recExtractCtrl *p) return RECCTRL_EXTRACT_ERROR_GENERIC; sscanf(line, "%255s", p->match_criteria); - recWord.index_type = 'w'; + recWord.index_type = '0'; while (fi_gets(fi, line, sizeof(line)-1)) { int nor = 0;