diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2006-09-22 14:04:53 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2006-09-22 14:04:53 +0000 |
commit | 46bc99acf862debdf2271177f3d55815f1191e51 (patch) | |
tree | 06836f20e448456f5f257992fd48c80fbde77e36 /src/core | |
parent | ea9f3be18ceed4e4bf09925eb1aba85ca35ce9e8 (diff) | |
download | irssi-46bc99acf862debdf2271177f3d55815f1191e51.zip |
Compute absolute path name of argv[0] at startup to make Irssi::get_irssi_binary
useful again.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4377 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/session.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/session.c b/src/core/session.c index 9bbd3eb7..8934a61a 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -89,7 +89,7 @@ void session_set_binary(const char *path) { g_free_and_null(irssi_binary); - irssi_binary = g_strdup(path); + irssi_binary = g_find_program_in_path(path); } void session_upgrade(void) @@ -110,9 +110,11 @@ static void cmd_upgrade(const char *data) char *binary; if (*data == '\0') - data = irssi_binary; + binary = g_strdup(irssi_binary); + else + binary = g_find_program_in_path(data); - if ((binary = g_find_program_in_path(data)) == NULL) + if (binary == NULL) cmd_return_error(CMDERR_PROGRAM_NOT_FOUND); /* save the session */ |