From 247f1ebfc107315f1c0b2b59bb59fe4774f3b0d4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 17 Feb 1998 10:32:51 +0000 Subject: [PATCH] Fixed bug: binary files weren't opened with flag b on NT. --- CHANGELOG | 2 ++ bfile/bfile.c | 13 ++++++++----- index/extract.c | 10 +++++++--- index/kinput.c | 6 +++++- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b0e76dd..86a3076 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +Bug fix: Lock files weren't removed as they should when using NT. + Implemented Z39.50 Sort. Zebra's sort handler uses use attributes to specify a "sort register". Refer to the gils sample records which refer to index type "s" which is specified as "sort" in the default.idx diff --git a/bfile/bfile.c b/bfile/bfile.c index b38ff42..eb59b4a 100644 --- a/bfile/bfile.c +++ b/bfile/bfile.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: bfile.c,v $ - * Revision 1.25 1997-10-27 14:25:38 adam + * Revision 1.26 1998-02-17 10:32:52 adam + * Fixed bug: binary files weren't opened with flag b on NT. + * + * Revision 1.25 1997/10/27 14:25:38 adam * Fixed memory leaks. * * Revision 1.24 1997/09/18 08:59:16 adam @@ -188,7 +191,7 @@ BFile bf_open (BFiles bfs, const char *name, int block_size, int wflag) { FILE *outf; - outf = open_cache (bfs, "a"); + outf = open_cache (bfs, "ab"); if (!outf) { logf (LOG_FATAL|LOG_ERRNO, "open %scache", @@ -233,7 +236,7 @@ int bf_commitExists (BFiles bfs) { FILE *inf; - inf = open_cache (bfs, "r"); + inf = open_cache (bfs, "rb"); if (inf) { fclose (inf); @@ -252,7 +255,7 @@ void bf_commitExec (BFiles bfs) int first_time; assert (bfs->commit_area); - if (!(inf = open_cache (bfs, "r"))) + if (!(inf = open_cache (bfs, "rb"))) { logf (LOG_LOG, "No commit file"); return ; @@ -286,7 +289,7 @@ void bf_commitClean (BFiles bfs, const char *spec) mustDisable = 1; } - if (!(inf = open_cache (bfs, "r"))) + if (!(inf = open_cache (bfs, "rb"))) return ; while (fscanf (inf, "%s %d", path, &block_size) == 2) { diff --git a/index/extract.c b/index/extract.c index 829bb68..ae8a6c4 100644 --- a/index/extract.c +++ b/index/extract.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: extract.c,v $ - * Revision 1.78 1998-02-10 12:03:05 adam + * Revision 1.79 1998-02-17 10:32:52 adam + * Fixed bug: binary files weren't opened with flag b on NT. + * + * Revision 1.78 1998/02/10 12:03:05 adam * Implemented Sort. * * Revision 1.77 1998/01/12 15:04:08 adam @@ -465,7 +468,7 @@ void key_flush (void) qsort (key_buf + ptr_top-ptr_i, ptr_i, sizeof(char*), key_qsort_compare); getFnameTmp (out_fname, key_file_no); - if (!(outf = fopen (out_fname, "w"))) + if (!(outf = fopen (out_fname, "wb"))) { logf (LOG_FATAL|LOG_ERRNO, "fopen %s", out_fname); exit (1); @@ -491,7 +494,7 @@ void key_flush (void) qsort (key_buf + ptr_top-ptr_i, ptr_i, sizeof(char*), key_x_compare); getFnameTmp (out_fname, key_file_no); - if (!(outf = fopen (out_fname, "w"))) + if (!(outf = fopen (out_fname, "wb"))) { logf (LOG_FATAL|LOG_ERRNO, "fopen %s", out_fname); exit (1); @@ -659,6 +662,7 @@ static void addSortString (RecWord *p, const char *string, int length) static void addString (RecWord *p, const char *string, int length) { + assert (length > 0); if (zebra_maps_is_sort (p->zebra_maps, p->reg_type)) addSortString (p, string, length); else diff --git a/index/kinput.c b/index/kinput.c index 3ba3463..781ec9a 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.26 1998-01-29 13:39:13 adam + * Revision 1.27 1998-02-17 10:32:52 adam + * Fixed bug: binary files weren't opened with flag b on NT. + * + * Revision 1.26 1998/01/29 13:39:13 adam * Compress ISAM is default. * * Revision 1.25 1997/09/17 12:19:14 adam @@ -449,6 +452,7 @@ int heap_inpc (struct heap_info *hi) strcpy (this_name, hci.cur_name); logf (LOG_DEBUG, "inserting %s", 1+hci.cur_name); + assert (hci.cur_name[1]); no_diffs++; if ((dict_info = dict_lookup (hi->dict, hci.cur_name))) { -- 1.7.10.4