1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

core: auto disable upgrade process (command line option "--upgrade") if the file weechat.upgrade is not found

This commit is contained in:
Sébastien Helleu
2019-06-24 21:35:37 +02:00
parent 98b5e90469
commit 1d6714e428
9 changed files with 29 additions and 58 deletions
+4 -12
View File
@@ -750,7 +750,9 @@ exec_debug_dump_cb (const void *pointer, void *data,
int
weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
{
int i, upgrading;
/* make C compiler happy */
(void) argc;
(void) argv;
weechat_plugin = plugin;
@@ -767,17 +769,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
/* hook completions */
exec_completion_init ();
/* look at arguments */
upgrading = 0;
for (i = 0; i < argc; i++)
{
if (weechat_strcasecmp (argv[i], "--upgrade") == 0)
{
upgrading = 1;
}
}
if (upgrading)
if (weechat_exec_plugin->upgrading)
exec_buffer_set_callbacks ();
return WEECHAT_RC_OK;