don't bother renaming the message file if we are about to unlink() it
This commit is contained in:
		
							parent
							
								
									dd22bd3f22
								
							
						
					
					
						commit
						d00a65bebd
					
				
					 1 changed files with 35 additions and 28 deletions
				
			
		
							
								
								
									
										7
									
								
								sync.c
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								sync.c
									
										
									
									
									
								
							|  | @ -200,6 +200,11 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags, | ||||||
| 		mbox->deleted++; | 		mbox->deleted++; | ||||||
| 	    cur->flags |= (tmp->flags & ~(D_RECENT | D_DRAFT)); | 	    cur->flags |= (tmp->flags & ~(D_RECENT | D_DRAFT)); | ||||||
| 
 | 
 | ||||||
|  | 	    /* don't bother renaming the file if we are just going to
 | ||||||
|  | 	     * remove it later. | ||||||
|  | 	     */ | ||||||
|  | 	    if ((cur->flags & D_DELETED) == 0 || (flags & SYNC_EXPUNGE) == 0) | ||||||
|  | 	    { | ||||||
| 		    /* generate old path */ | 		    /* generate old path */ | ||||||
| 		    snprintf (path, sizeof (path), "%s/%s/%s", | 		    snprintf (path, sizeof (path), "%s/%s/%s", | ||||||
| 				    mbox->path, cur->new ? "new" : "cur", cur->file); | 				    mbox->path, cur->new ? "new" : "cur", cur->file); | ||||||
|  | @ -230,6 +235,8 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags, | ||||||
| 			    p = strrchr (newpath, '/'); | 			    p = strrchr (newpath, '/'); | ||||||
| 			    free (cur->file); | 			    free (cur->file); | ||||||
| 			    cur->file = strdup (p + 1); | 			    cur->file = strdup (p + 1); | ||||||
|  | 			    cur->new = 0; /* not any more */ | ||||||
|  | 		    } | ||||||
| 	    } | 	    } | ||||||
| 	} | 	} | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue