summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-12-04 04:53:22 (UTC)
committer zautrix <zautrix>2004-12-04 04:53:22 (UTC)
commit7828f46413766ee5db72dc9bd457eac0868f0646 (patch) (unidiff)
treed3da09120bdef2b498f836c5b1b97a5b2aa2da99 /kmicromail
parent967f7c879d06961dd7a25d019380c521f7a84792 (diff)
downloadkdepimpi-7828f46413766ee5db72dc9bd457eac0868f0646.zip
kdepimpi-7828f46413766ee5db72dc9bd457eac0868f0646.tar.gz
kdepimpi-7828f46413766ee5db72dc9bd457eac0868f0646.tar.bz2
fixed some bugs
Diffstat (limited to 'kmicromail') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libetpan/maildir/maildir.c25
-rw-r--r--kmicromail/libetpan/mh/mailmh.c12
2 files changed, 26 insertions, 11 deletions
diff --git a/kmicromail/libetpan/maildir/maildir.c b/kmicromail/libetpan/maildir/maildir.c
index 0e038b1..1ef0b7a 100644
--- a/kmicromail/libetpan/maildir/maildir.c
+++ b/kmicromail/libetpan/maildir/maildir.c
@@ -110,5 +110,7 @@ static char * maildir_get_new_message_filename(struct maildir * md,
110 time_t now; 110 time_t now;
111 111 struct stat f_stat;
112 now = time(NULL); 112 now = time(NULL);
113 k = 0; 113 k = 0;
114
115 fprintf(stderr,"maildir_get_new_message_filename: %s \n", tmpfile);
114 while (k < MAX_TRY_ALLOC) { 116 while (k < MAX_TRY_ALLOC) {
@@ -118,4 +120,6 @@ static char * maildir_get_new_message_filename(struct maildir * md,
118 md->mdir_path, basename); 120 md->mdir_path, basename);
119 121 fprintf(stderr,"filename %s \n", filename);
120 if (link(tmpfile, filename) == 0) { 122 // LR changed following lines
123 if ( stat( filename, &f_stat ) == -1 ) {
124 //if (link(tmpfile, filename) == 0) {
121 char * dup_filename; 125 char * dup_filename;
@@ -124,7 +128,8 @@ static char * maildir_get_new_message_filename(struct maildir * md,
124 if (dup_filename == NULL) { 128 if (dup_filename == NULL) {
125 unlink(filename); 129 //unlink(filename);
126 return NULL; 130 return NULL;
127 } 131 }
128 132 fprintf(stderr,"filename %s %s \n", tmpfile,dup_filename);
129 unlink(tmpfile); 133 //unlink(tmpfile);
134 rename (tmpfile,dup_filename );
130 md->mdir_counter ++; 135 md->mdir_counter ++;
@@ -274,2 +279,3 @@ static int add_message(struct maildir * md,
274 279
280 fprintf(stderr,"add_message filename: %s \n", filename);
275 msg = msg_new(filename, is_new); 281 msg = msg_new(filename, is_new);
@@ -448,2 +454,3 @@ int maildir_message_add_uid(struct maildir * md,
448 454
455 fprintf(stderr,"maildir_message_add_uid for uid: %s \n", uid);
449 r = maildir_update(md); 456 r = maildir_update(md);
@@ -560,2 +567,3 @@ int maildir_message_add_file_uid(struct maildir * md, int fd,
560 567
568 fprintf(stderr,"maildir_message_add_file_uid: %s \n", uid);
561 if (fstat(fd, &buf) == -1) 569 if (fstat(fd, &buf) == -1)
@@ -576,2 +584,3 @@ int maildir_message_add_file(struct maildir * md, int fd)
576{ 584{
585 fprintf(stderr,"maildir_message_add_file \n");
577 return maildir_message_add_file_uid(md, fd, 586 return maildir_message_add_file_uid(md, fd,
@@ -590,2 +599,3 @@ char * maildir_message_get(struct maildir * md, const char * uid)
590 599
600 fprintf(stderr,"maildir_message_get for uid: %s \n", uid);
591 key.data = (void *) uid; 601 key.data = (void *) uid;
@@ -622,2 +632,3 @@ int maildir_message_remove(struct maildir * md, const char * uid)
622 632
633 fprintf(stderr,"maildir_message_remove for uid: %s \n", uid);
623 key.data = (void *) uid; 634 key.data = (void *) uid;
@@ -664,3 +675,3 @@ int maildir_message_change_flags(struct maildir * md,
664 int res; 675 int res;
665 676 fprintf(stderr,"maildir_message_change_flags for uid: %s \n", uid);
666 key.data = (void *) uid; 677 key.data = (void *) uid;
diff --git a/kmicromail/libetpan/mh/mailmh.c b/kmicromail/libetpan/mh/mailmh.c
index 119f217..5e2b4cc 100644
--- a/kmicromail/libetpan/mh/mailmh.c
+++ b/kmicromail/libetpan/mh/mailmh.c
@@ -609,2 +609,3 @@ static int mailmh_folder_alloc_msg(struct mailmh_folder * folder,
609 size_t len; 609 size_t len;
610 struct stat f_stat;
610 611
@@ -617,2 +618,3 @@ static int mailmh_folder_alloc_msg(struct mailmh_folder * folder,
617 618
619 //fprintf(stderr,"mailmh_folder_alloc_msg filename: %s \n", filename);
618 k = 0; 620 k = 0;
@@ -621,8 +623,10 @@ static int mailmh_folder_alloc_msg(struct mailmh_folder * folder,
621 MAIL_DIR_SEPARATOR, (unsigned long) (max + k)); 623 MAIL_DIR_SEPARATOR, (unsigned long) (max + k));
622 624 //fprintf(stderr,"mailmh_folder_alloc_msg new_filename: %s \n", new_filename);
623 if (link(filename, new_filename) == 0) { 625 if ( stat( new_filename, &f_stat ) == -1 ) {
626 // if (link(filename, new_filename) == 0) {
624 int r; 627 int r;
625 628 //fprintf(stderr,"filename found \n");
629 //unlink(filename);
630 rename (filename,new_filename );
626 free(new_filename); 631 free(new_filename);
627 unlink(filename);
628 632