mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-24 03:06:21 +00:00
Follow symlinks for profrc and accounts files
This commit is contained in:
@@ -808,9 +808,16 @@ _save_accounts(void)
|
||||
{
|
||||
gsize g_data_size;
|
||||
gchar *g_accounts_data = g_key_file_to_data(accounts, &g_data_size, NULL);
|
||||
g_file_set_contents(accounts_loc, g_accounts_data, g_data_size, NULL);
|
||||
gchar *xdg_data = xdg_get_data_home();
|
||||
GString *base_str = g_string_new(xdg_data);
|
||||
g_string_append(base_str, "/profanity/");
|
||||
gchar *true_loc = get_file_or_linked(accounts_loc, base_str->str);
|
||||
g_file_set_contents(true_loc, g_accounts_data, g_data_size, NULL);
|
||||
g_chmod(accounts_loc, S_IRUSR | S_IWUSR);
|
||||
g_free(xdg_data);
|
||||
free(true_loc);
|
||||
g_free(g_accounts_data);
|
||||
g_string_free(base_str, TRUE);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
|
||||
@@ -406,9 +406,16 @@ _save_prefs(void)
|
||||
{
|
||||
gsize g_data_size;
|
||||
gchar *g_prefs_data = g_key_file_to_data(prefs, &g_data_size, NULL);
|
||||
g_file_set_contents(prefs_loc, g_prefs_data, g_data_size, NULL);
|
||||
gchar *xdg_config = xdg_get_config_home();
|
||||
GString *base_str = g_string_new(xdg_config);
|
||||
g_string_append(base_str, "/profanity/");
|
||||
gchar *true_loc = get_file_or_linked(prefs_loc, base_str->str);
|
||||
g_file_set_contents(true_loc, g_prefs_data, g_data_size, NULL);
|
||||
g_chmod(prefs_loc, S_IRUSR | S_IWUSR);
|
||||
g_free(xdg_config);
|
||||
free(true_loc);
|
||||
g_free(g_prefs_data);
|
||||
g_string_free(base_str, TRUE);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
|
||||
Reference in New Issue
Block a user