From a28a44b88daff1a354eb84d2e4e488da104843e9 Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 25 Jun 2013 20:00:46 +0200 Subject: [PATCH] fixed a folder creation bug --- src/pilerimport.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pilerimport.c b/src/pilerimport.c index be08af54..86cef92f 100644 --- a/src/pilerimport.c +++ b/src/pilerimport.c @@ -132,10 +132,10 @@ int import_mbox_from_dir(char *directory, struct session_data *sdata, struct __d if(S_ISREG(st.st_mode)){ if(i == 0 && data->recursive_folder_names == 1){ folder = get_folder_id(sdata, data, fname, data->folder); - if(folder == 0){ + if(folder == -1){ folder = add_new_folder(sdata, data, fname, data->folder); - if(folder == 0){ + if(folder == -1){ printf("error: cannot get/add folder '%s' to parent id: %d\n", fname, data->folder); return ERR; } @@ -208,10 +208,10 @@ int import_from_maildir(char *directory, struct session_data *sdata, struct __da } folder = get_folder_id(sdata, data, p, data->folder); - if(folder == 0){ + if(folder == -1){ folder = add_new_folder(sdata, data, p, data->folder); - if(folder == 0){ + if(folder == -1){ printf("error: cannot get/add folder '%s' to parent id: %d\n", p, data->folder); return ERR; }