Diffstat (limited to 'libetpan/src/low-level/maildir/maildir.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libetpan/src/low-level/maildir/maildir.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libetpan/src/low-level/maildir/maildir.c b/libetpan/src/low-level/maildir/maildir.c index 98b9f87..e81625d 100644 --- a/libetpan/src/low-level/maildir/maildir.c +++ b/libetpan/src/low-level/maildir/maildir.c | |||
@@ -112,2 +112,4 @@ static char * maildir_get_new_message_filename(struct maildir * md, | |||
112 | time_t now; | 112 | time_t now; |
113 | //LR | ||
114 | struct stat f_stat; | ||
113 | int got_file; | 115 | int got_file; |
@@ -123,3 +125,14 @@ static char * maildir_get_new_message_filename(struct maildir * md, | |||
123 | md->mdir_path, basename); | 125 | md->mdir_path, basename); |
124 | 126 | ||
127 | // LR changed following lines | ||
128 | if ( stat( filename, &f_stat ) == -1 ) { | ||
129 | char * dup_filename; | ||
130 | |||
131 | dup_filename = strdup(filename); | ||
132 | if (dup_filename == NULL) { | ||
133 | //unlink(filename); | ||
134 | return NULL; | ||
135 | } | ||
136 | rename (tmpfile,dup_filename ); | ||
137 | #if 0 | ||
125 | if (link(tmpfile, filename) == 0) { | 138 | if (link(tmpfile, filename) == 0) { |
@@ -149,3 +162,3 @@ static char * maildir_get_new_message_filename(struct maildir * md, | |||
149 | } | 162 | } |
150 | 163 | #endif | |
151 | md->mdir_counter ++; | 164 | md->mdir_counter ++; |