summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-04-26 09:37:31 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-04-26 09:37:31 +0000
commit9044f31921e52c4348944ad6b5c457132ebff584 (patch)
tree7641238039e34494cf3c8cf25eb1ab9bc0afbb13 /src
parent00c23886660d96a445a0c7e8b0004bee798e96b3 (diff)
downloadirssi-9044f31921e52c4348944ad6b5c457132ebff584.zip
fixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@175 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/settings.c14
-rw-r--r--src/core/signals.c2
2 files changed, 9 insertions, 7 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index af6e5ee6..5db3c790 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -208,15 +208,16 @@ void sig_term(int n)
static CONFIG_REC *parse_configfile(const char *fname)
{
CONFIG_REC *config;
- char *str;
+ char *real_fname;
- str = fname != NULL ? g_strdup(fname) :
+ real_fname = fname != NULL ? g_strdup(fname) :
g_strdup_printf("%s/.irssi/config", g_get_home_dir());
- config = config_open(str, -1);
- g_free(str);
+ config = config_open(real_fname, -1);
- if (config == NULL && *fname != '\0')
+ if (config == NULL && fname != NULL) {
+ g_free(real_fname);
return NULL; /* specified config file not found */
+ }
if (config != NULL)
config_parse(config);
@@ -233,9 +234,10 @@ static CONFIG_REC *parse_configfile(const char *fname)
config_parse_data(config, default_config, "internal");
}
- config_change_file_name(config, fname, 0660);
+ config_change_file_name(config, real_fname, 0660);
}
+ g_free(real_fname);
return config;
}
diff --git a/src/core/signals.c b/src/core/signals.c
index cbd92d45..8ab313bb 100644
--- a/src/core/signals.c
+++ b/src/core/signals.c
@@ -224,7 +224,7 @@ static int signal_emitv_id(int signal_id, int params, va_list va)
arglist[0] = GINT_TO_POINTER(signal_id);
for (n = 1; n < 8; n++)
- arglist[n] = n >= params ? NULL : va_arg(va, gconstpointer);
+ arglist[n] = n > params ? NULL : va_arg(va, gconstpointer);
/* send "signal" */
if (first_signal_rec != NULL) {