diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/gui-buffer.c | 11 | ||||
-rw-r--r-- | src/gui/gui-hotlist.c | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 05bf6ce58..1766b2ecb 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1709,19 +1709,24 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property, if (!property || !value) return; - /* properties that does NOT need a buffer */ + /* properties with optional buffer */ if (string_strcasecmp (property, "hotlist") == 0) { if (strcmp (value, "-") == 0) gui_add_hotlist = 0; else if (strcmp (value, "+") == 0) gui_add_hotlist = 1; - else + else if (buffer) { error = NULL; number = strtol (value, &error, 10); if (error && !error[0]) - (void) gui_hotlist_add (buffer, number, NULL); + { + if (number < 0) + gui_hotlist_remove_buffer (buffer); + else + (void) gui_hotlist_add (buffer, number, NULL); + } } } else if (string_strcasecmp (property, "completion_freeze") == 0) diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index 8904e2c01..3f8dbd319 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -492,7 +492,7 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer) int hotlist_changed; struct t_gui_hotlist *ptr_hotlist, *next_hotlist; - if (weechat_upgrading) + if (!buffer || weechat_upgrading) return; hotlist_changed = 0; |