From 8b7513e883fcca3b45c5a8a211292d9d60606687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 27 Aug 2023 17:19:01 +0200 Subject: [PATCH] script: fix crash when a `/script` command triggers another `/script` command (issue #923) --- ChangeLog.adoc | 1 + src/plugins/script/script-action.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 89d51edac..1015f302a 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -20,6 +20,7 @@ New features:: Bug fixes:: * irc: fix string comparison when CASEMAPPING is set to "ascii" + * script: fix crash when a `/script` command triggers another `/script` command (issue #923) Tests:: diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c index 551733c2f..ce0097491 100644 --- a/src/plugins/script/script-action.c +++ b/src/plugins/script/script-action.c @@ -1254,6 +1254,9 @@ script_action_run_all () | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, 0, &num_actions); + + script_action_clear (); + if (actions) { for (i = 0; i < num_actions; i++) @@ -1511,8 +1514,6 @@ script_action_run_all () weechat_string_free_split (actions); } - script_action_clear (); - return 1; }