summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-07-15 00:39:48 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-07-15 00:39:48 +0000
commit79d1d7089a699cf8a09bd5227f9033282001b0b3 (patch)
tree11a2e10bce84587e2b5a13029c43354a185e846c /src/fe-common
parentbcbb55dd1e0ecf828942dcc91d5661e9a44ab841 (diff)
downloadirssi-79d1d7089a699cf8a09bd5227f9033282001b0b3.zip
Added --home and --config command line parameters to irssi to specify
locations for ~/.irssi and ~/.irssi/config git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1626 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/autorun.c2
-rw-r--r--src/fe-common/core/fe-settings.c5
-rw-r--r--src/fe-common/core/themes.c7
3 files changed, 6 insertions, 8 deletions
diff --git a/src/fe-common/core/autorun.c b/src/fe-common/core/autorun.c
index b305b82e..8035e97e 100644
--- a/src/fe-common/core/autorun.c
+++ b/src/fe-common/core/autorun.c
@@ -32,7 +32,7 @@ static void sig_autorun(void)
int f, ret, recvlen;
/* open ~/.irssi/startup and run all commands in it */
- path = g_strdup_printf("%s/.irssi/startup", g_get_home_dir());
+ path = g_strdup_printf("%s/startup", get_irssi_dir());
f = open(path, O_RDONLY);
g_free(path);
if (f == -1) {
diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c
index d9bf8c72..f44138fb 100644
--- a/src/fe-common/core/fe-settings.c
+++ b/src/fe-common/core/fe-settings.c
@@ -247,13 +247,12 @@ static void cmd_reload(const char *data)
{
char *fname;
- fname = *data != '\0' ? g_strdup(data) :
- g_strdup_printf("%s/.irssi/config", g_get_home_dir());
+ fname = *data == '\0' ? NULL : g_strdup(data);
if (settings_reread(fname)) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
TXT_CONFIG_RELOADED, fname);
}
- g_free(fname);
+ g_free_not_null(fname);
}
static void settings_save_fe(const char *fname)
diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c
index 7fcd31ac..a371a953 100644
--- a/src/fe-common/core/themes.c
+++ b/src/fe-common/core/themes.c
@@ -701,7 +701,7 @@ THEME_REC *theme_load(const char *setname)
theme = theme_find(name);
/* check home dir */
- fname = g_strdup_printf("%s/.irssi/%s.theme", g_get_home_dir(), name);
+ fname = g_strdup_printf("%s/%s.theme", get_irssi_dir(), name);
if (stat(fname, &statbuf) != 0) {
/* check global config dir */
g_free(fname);
@@ -1005,7 +1005,7 @@ static void theme_save(THEME_REC *theme)
g_hash_table_foreach(theme->modules, (GHFunc) module_save, config);
/* always save the theme to ~/.irssi/ */
- path = g_strdup_printf("%s/.irssi/%s", g_get_home_dir(),
+ path = g_strdup_printf("%s/%s", get_irssi_dir(),
g_basename(theme->path));
ok = config_write(config, path, 0660) == 0;
@@ -1135,8 +1135,7 @@ static void themes_read(void)
/* first there's default theme.. */
current_theme = theme_load("default");
if (current_theme == NULL) {
- fname = g_strdup_printf("%s/.irssi/default.theme",
- g_get_home_dir());
+ fname = g_strdup_printf("%s/default.theme", get_irssi_dir());
current_theme = theme_create(fname, "default");
current_theme->default_color = 0;
current_theme->default_real_color = 7;