[balsa] fix calculation of IMAP cache folder paths



commit fa2c837f1c9ac1a5b43f8d66d68053763a72bc90
Author: Albrecht Dreß <albrecht dress netcologne de>
Date:   Sun May 2 18:40:48 2021 +0200

    fix calculation of IMAP cache folder paths
    
    simplify calculating the persistent folder path, fix redundant slash
    calculating the non-persistent path
    
    Signed-off-by: Albrecht Dreß <albrecht dress netcologne de>

 libbalsa/mailbox_imap.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/libbalsa/mailbox_imap.c b/libbalsa/mailbox_imap.c
index 1763f7d31..58a80c08a 100644
--- a/libbalsa/mailbox_imap.c
+++ b/libbalsa/mailbox_imap.c
@@ -435,14 +435,13 @@ static gchar*
 get_cache_dir(gboolean is_persistent)
 {
     gchar *fname;
-    if(is_persistent) {
-        const gchar *home = g_get_home_dir();
-        fname = g_strconcat(home, G_DIR_SEPARATOR_S ".balsa"
-                            G_DIR_SEPARATOR_S "imap-cache", NULL);
-    } else
+    if (is_persistent) {
+        fname = g_build_filename(g_get_home_dir(), ".balsa", "imap-cache", NULL);
+    } else {
         fname = g_strconcat(g_get_tmp_dir(),
-                            G_DIR_SEPARATOR_S "/balsa-",
+                            G_DIR_SEPARATOR_S "balsa-",
                             g_get_user_name(), NULL);
+    }
 
     return fname;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]