diff --git a/src/core/session.c b/src/core/session.c index 5fe481fb..3a63a785 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -59,13 +60,19 @@ void session_upgrade(void) static void cmd_upgrade(const char *data) { CONFIG_REC *session; - char *session_file, *str; + char *session_file, *str, *name; char *binary; if (*data == '\0') - data = irssi_binary; + name = irssi_binary; + else + name = convert_home(data); - if ((binary = g_find_program_in_path(data)) == NULL) + binary = g_find_program_in_path(name); + if (name != irssi_binary) + g_free(name); + + if (binary == NULL) cmd_return_error(CMDERR_PROGRAM_NOT_FOUND); /* save the session */