1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 23:36:37 +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
@@ -1301,7 +1301,9 @@ trigger_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;
@@ -1320,17 +1322,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
/* hook completions */
trigger_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_trigger_plugin->upgrading)
trigger_buffer_set_callbacks ();
return WEECHAT_RC_OK;