diff options
-rw-r--r-- | camel/ChangeLog | 11 | ||||
-rw-r--r-- | camel/camel-block-file.c | 12 | ||||
-rw-r--r-- | camel/camel-text-index.c | 24 |
3 files changed, 34 insertions, 13 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 93e331f462..f454cad21b 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,14 @@ +2002-04-26 Not Zed <NotZed@Ximian.com> + + * camel-block-file.c (block_file_validate_root): Remove the + excessive \n's, after printfs. + + * camel-text-index.c (text_index_compress_nosync): @!#$@#$!@$#!. + Since the rename op was fixed, this broke compression's rename, + resulting in the index 'vanishing' after every compress + (i.e. after every reindex). Fix this code to account for the + fixed rename operation. + 2002-04-25 Jeffrey Stedfast <fejj@ximian.com> * providers/smtp/camel-smtp-transport.c (smtp_rcpt): Don't put a diff --git a/camel/camel-block-file.c b/camel/camel-block-file.c index 34e62a7c8a..be30ad6f17 100644 --- a/camel/camel-block-file.c +++ b/camel/camel-block-file.c @@ -117,15 +117,15 @@ block_file_validate_root(CamelBlockFile *bs) || st.st_size != br->last || br->free > st.st_size || (br->flags & CAMEL_BLOCK_FILE_SYNC) == 0) { - g_warning("Invalid root: '%s'\n", bs->path); - g_warning("version: %.8s (%.8s)\n", bs->root->version, bs->version); - g_warning("block size: %d (%d)%s\n", br->block_size, bs->block_size, + g_warning("Invalid root: '%s'", bs->path); + g_warning("version: %.8s (%.8s)", bs->root->version, bs->version); + g_warning("block size: %d (%d)%s", br->block_size, bs->block_size, br->block_size != bs->block_size ? " BAD":" OK"); - g_warning("free: %ld (%d add size < %ld)%s\n", (long)br->free, br->free / bs->block_size * bs->block_size, (long)st.st_size, + g_warning("free: %ld (%d add size < %ld)%s", (long)br->free, br->free / bs->block_size * bs->block_size, (long)st.st_size, (br->free > st.st_size) || (br->free % bs->block_size) != 0 ? " BAD":" OK"); - g_warning("last: %ld (%d and size: %ld)%s\n", (long)br->last, br->last / bs->block_size * bs->block_size, (long)st.st_size, + g_warning("last: %ld (%d and size: %ld)%s", (long)br->last, br->last / bs->block_size * bs->block_size, (long)st.st_size, (br->last != st.st_size) || ((br->last % bs->block_size) != 0) ? " BAD": " OK"); - g_warning("flags: %s\n", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC"); + g_warning("flags: %s", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC"); return -1; } diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c index 9822df85f1..ab2ec72661 100644 --- a/camel/camel-text-index.c +++ b/camel/camel-text-index.c @@ -372,12 +372,21 @@ text_index_compress_nosync(CamelIndex *idx) camel_key_t *records, newrecords[256]; struct _CamelTextIndexRoot *rb; - newpath = alloca(strlen(idx->path)+5); - tmp_name(idx->path, newpath); - savepath = alloca(strlen(idx->path)+2); - sprintf(savepath, "%s~", idx->path); - oldpath = alloca(strlen(idx->path)+1); + i = strlen(idx->path)+16; + oldpath = alloca(i); + newpath = alloca(i); + savepath = alloca(i); + strcpy(oldpath, idx->path); + oldpath[strlen(oldpath)-strlen(".index")] = 0; + + tmp_name(oldpath, newpath); + sprintf(savepath, "%s~", oldpath); + + d(printf("Old index: %s\n", idx->path)); + d(printf("Old path: %s\n", oldpath)); + d(printf("New: %s\n", newpath)); + d(printf("Save: %s\n", savepath)); newidx = camel_text_index_new(newpath, O_RDWR|O_CREAT); if (newidx == NULL) @@ -504,8 +513,9 @@ fail: /* clean up temp files always */ camel_text_index_remove(newpath); + + sprintf(savepath, "%s~.index", oldpath); unlink(savepath); - newpath = alloca(strlen(savepath)+6); sprintf(newpath, "%s.data", savepath); unlink(newpath); @@ -1519,7 +1529,7 @@ camel_text_index_name_new(CamelTextIndex *idx, const char *name, camel_key_t nam cin->index = (CamelIndex *)idx; camel_object_ref((CamelObject *)idx); - cin->name = g_strdup(name); + cin->name = e_mempool_strdup(p->pool, name); p->nameid = nameid; return idn; |