1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Merge pull request #1462 from mauke/upgrade-tilde-expand

expand ~ to $HOME in /upgrade
This commit is contained in:
ailin-nemui 2023-04-04 13:12:50 +00:00 committed by GitHub
commit 5c42345ea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,7 @@
#include <irssi/src/core/net-sendbuffer.h>
#include <irssi/src/core/pidwait.h>
#include <irssi/src/lib-config/iconfig.h>
#include <irssi/src/core/misc.h>
#include <irssi/src/core/chat-protocols.h>
#include <irssi/src/core/servers.h>
@ -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 */