From 5b8bd33a777be3c651176ea421108fd9eaaa6f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 22 Aug 2014 20:49:54 +0200 Subject: [PATCH] script: fix crash on "/script update" if a script detail is displayed in buffer (closes #177) (cherry picked from commit 067f310be66118814b4e8a75cc6e18ae7a4d3da4) --- ChangeLog.asciidoc | 2 ++ src/plugins/script/script-repo.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 33353f55c..2451abcd6 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -22,6 +22,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * tests: fix memory leak in tests launcher * aspell: fix crash with command "/aspell addword" if no word is given (closes #164, closes #165) +* script: fix crash on "/script update" if a script detail is displayed in + buffer (closes #177) * trigger: fix regex used in default triggers to hide passwords ("\S" is not supported on *BSD) (closes #172) diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index bd6d5105b..b0f9155ef 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -652,6 +652,10 @@ script_repo_remove (struct t_script_repo *script) { struct t_script_repo *new_scripts_repo; + /* unlink script from buffer (if it is used) */ + if (script_buffer_detail_script == script) + script_buffer_detail_script = NULL; + /* remove script from list */ if (last_script_repo == script) last_script_repo = script->prev_script;