about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-06-13 15:02:43 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-06-13 15:02:43 +0200
commit914c6752dd4ac3421311817d585cd687cec693e4 (patch)
tree95c569c99b738fd4e81bd43ef489d4ea81f2bfbd /src/config
parent74e061165a808883c5b17ff356bde60fa335cbda (diff)
downloadprofani-tty-914c6752dd4ac3421311817d585cd687cec693e4.tar.gz
Fix reading/writing linked files
"base" was not really base but the filename :-)

Fix https://github.com/profanity-im/profanity/issues/1362
Diffstat (limited to 'src/config')
-rw-r--r--src/config/accounts.c2
-rw-r--r--src/config/preferences.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/config/accounts.c b/src/config/accounts.c
index 1c194a9a..92bf19d0 100644
--- a/src/config/accounts.c
+++ b/src/config/accounts.c
@@ -969,7 +969,7 @@ _save_accounts(void)
     gsize g_data_size;
     gchar *g_accounts_data = g_key_file_to_data(accounts, &g_data_size, NULL);
 
-    gchar *base = g_path_get_basename(accounts_loc);
+    gchar *base = g_path_get_dirname(accounts_loc);
     gchar *true_loc = get_file_or_linked(accounts_loc, base);
     g_file_set_contents(true_loc, g_accounts_data, g_data_size, NULL);
     g_chmod(accounts_loc, S_IRUSR | S_IWUSR);
diff --git a/src/config/preferences.c b/src/config/preferences.c
index d1c1d900..093d7679 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -1665,7 +1665,7 @@ _save_prefs(void)
 {
     gsize g_data_size;
     gchar *g_prefs_data = g_key_file_to_data(prefs, &g_data_size, NULL);
-    gchar *base = g_path_get_basename(prefs_loc);
+    gchar *base = g_path_get_dirname(prefs_loc);
     gchar *true_loc = get_file_or_linked(prefs_loc, base);
 
     g_file_set_contents(true_loc, g_prefs_data, g_data_size, NULL);