* See the file LICENSE for details.
* Heikki Levanto
*
- * $Id: merge-d.c,v 1.9 1999-08-17 19:46:53 heikki Exp $
+ * $Id: merge-d.c,v 1.10 1999-08-18 09:13:31 heikki Exp $
*
* todo
* - Input filter: Eliminate del-ins pairs, tell if only one entry (or none)
* - Clean up the different ways diffs are handled in writing and reading
*
* bugs
- * - memory leak somewhere.
- * - Some pp_opens do not get closed.
- * - Diffinfo's get left behind.
*
* caveat
* There is a confusion about the block addresses. cat or type is the category,
{ /* prepare to append diffs in head */
diffidx = pp->size;
pp->diffs = diffidx *2 +0;
- i=diffidx; /* clear the rest of the block. ??? */
- if ( i < pp->is->method->filecat[pp->cat].bsize)
- pp->buf[i]='\0';
+ i=diffidx; /* make an end marker */
+ while ( ( i < pp->is->method->filecat[pp->cat].bsize) &&
+ ( i <= diffidx + sizeof(int)))
+ pp->buf[i++]='\0';
if (pp->is->method->debug >1) //!!! 3
logf(LOG_LOG,"isamd_appd: set up diffhead (d=%d) %d=%d:%d ix=%d",
firstpp->diffs,
pp->pos=newblock;
pp->size = pp->offset = ISAMD_BLOCK_OFFSET_N;
pp->next=0;
- if (pp->is->method->debug >1) //!!! 3
+ if (pp->is->method->debug >3)
logf(LOG_LOG,"isamd_build: Alloc2 f=%d (%d:%d) n=%d(%d:%d)",
isamd_addr(firstpp->pos,firstpp->cat),
firstpp->cat, firstpp->pos,
{ /* it was not the first block */
newblock = isamd_alloc_block(pp->is, firstpp->cat);
pp->next = isamd_addr(newblock,firstpp->cat);
- if (pp->is->method->debug >1) //!!! 3
+ if (pp->is->method->debug >3)
logf(LOG_LOG,"isamd_build: Alloc new after p=%d=%d:%d n=%d=%d:%d",
isamd_addr(pp->pos,pp->cat), pp->cat, pp->pos,
isamd_addr(newblock,pp->cat), pp->cat, newblock );
/*
* $Log: merge-d.c,v $
- * Revision 1.9 1999-08-17 19:46:53 heikki
+ * Revision 1.10 1999-08-18 09:13:31 heikki
+ * Fixed a detail
+ *
+ * Revision 1.9 1999/08/17 19:46:53 heikki
* Fixed a memory leak
*
* Revision 1.8 1999/08/07 11:30:59 heikki