about summary refs log tree commit diff stats
path: root/src/config/preferences.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-08-02 15:28:28 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-08-02 15:55:47 +0200
commit10ca3e8c315794138ac4c413aea179ea8a0e1249 (patch)
tree22c9d710cdab0433a786fff472668f70bf419cfc /src/config/preferences.c
parent5d711639b060eb0454fee69c5f8e5ffcc27f492f (diff)
downloadprofani-tty-10ca3e8c315794138ac4c413aea179ea8a0e1249.tar.gz
Possibility to specify alternative config file
Introduce `profanity -c` to specify an alternative config file.
Diffstat (limited to 'src/config/preferences.c')
-rw-r--r--src/config/preferences.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index 80b6cc15..e8f19996 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -79,10 +79,15 @@ static gboolean _get_default_boolean(preference_t pref);
 static char* _get_default_string(preference_t pref);
 
 void
-prefs_load(void)
+prefs_load(char *config_file)
 {
     GError *err;
-    prefs_loc = files_get_config_path(FILE_PROFRC);
+
+    if (config_file == NULL) {
+        prefs_loc = files_get_config_path(FILE_PROFRC);
+    } else {
+        prefs_loc = config_file;
+    }
 
     if (g_file_test(prefs_loc, G_FILE_TEST_EXISTS)) {
         g_chmod(prefs_loc, S_IRUSR | S_IWUSR);