mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Fixed /RELOAD crashing without parameters.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1664 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
9668285467
commit
802ee7564c
@ -556,9 +556,9 @@ int settings_reread(const char *fname)
|
|||||||
CONFIG_REC *tempconfig;
|
CONFIG_REC *tempconfig;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
str = convert_home(fname);
|
str = fname == NULL ? NULL : convert_home(fname);
|
||||||
tempconfig = parse_configfile(str);
|
tempconfig = parse_configfile(str);
|
||||||
g_free(str);
|
g_free_not_null(str);
|
||||||
|
|
||||||
if (tempconfig == NULL) {
|
if (tempconfig == NULL) {
|
||||||
signal_emit("gui dialog", 2, "error", g_strerror(errno));
|
signal_emit("gui dialog", 2, "error", g_strerror(errno));
|
||||||
|
@ -245,14 +245,14 @@ static void cmd_unalias(const char *data)
|
|||||||
/* SYNTAX: RELOAD [<file>] */
|
/* SYNTAX: RELOAD [<file>] */
|
||||||
static void cmd_reload(const char *data)
|
static void cmd_reload(const char *data)
|
||||||
{
|
{
|
||||||
char *fname;
|
const char *fname;
|
||||||
|
|
||||||
|
fname = *data == '\0' ? get_irssi_config() : data;
|
||||||
|
|
||||||
fname = *data == '\0' ? NULL : g_strdup(data);
|
|
||||||
if (settings_reread(fname)) {
|
if (settings_reread(fname)) {
|
||||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
||||||
TXT_CONFIG_RELOADED, fname);
|
TXT_CONFIG_RELOADED, fname);
|
||||||
}
|
}
|
||||||
g_free_not_null(fname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void settings_save_fe(const char *fname)
|
static void settings_save_fe(const char *fname)
|
||||||
|
Loading…
Reference in New Issue
Block a user