summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-30 14:55:42 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-30 14:55:42 +0100
commitb09920203a0f2b202497ef9632f8447f73d0f1fb (patch)
tree2103a2423c7222e61f77a9138331d5444fa18de3 /src/terminal.c
parentdf54382eacdbfa10291adb80ad6b89ad83bd7c9b (diff)
downloadvim-git-b09920203a0f2b202497ef9632f8447f73d0f1fb.tar.gz
patch 8.2.0179: still a few places where range() does not workv8.2.0179
Problem: Still a few places where range() does not work. Solution: Fix using range() causing problems.
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/terminal.c b/src/terminal.c
index da27a9c17..3bf914ae9 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -417,7 +417,11 @@ term_start(
if ((opt->jo_set & (JO_IN_IO + JO_OUT_IO + JO_ERR_IO))
== (JO_IN_IO + JO_OUT_IO + JO_ERR_IO)
|| (!(opt->jo_set & JO_OUT_IO) && (opt->jo_set & JO_OUT_BUF))
- || (!(opt->jo_set & JO_ERR_IO) && (opt->jo_set & JO_ERR_BUF)))
+ || (!(opt->jo_set & JO_ERR_IO) && (opt->jo_set & JO_ERR_BUF))
+ || (argvar != NULL
+ && argvar->v_type == VAR_LIST
+ && argvar->vval.v_list != NULL
+ && argvar->vval.v_list->lv_first == &range_list_item))
{
emsg(_(e_invarg));
return NULL;
@@ -538,7 +542,7 @@ term_start(
}
else if (argvar->v_type != VAR_LIST
|| argvar->vval.v_list == NULL
- || argvar->vval.v_list->lv_len < 1
+ || argvar->vval.v_list->lv_len == 0
|| (cmd = tv_get_string_chk(
&argvar->vval.v_list->lv_first->li_tv)) == NULL)
cmd = (char_u*)"";
@@ -3763,9 +3767,9 @@ set_ansi_colors_list(VTerm *vterm, list_T *list)
{
int n = 0;
long_u rgb[16];
- listitem_T *li = list->lv_first;
+ listitem_T *li;
- for (; li != NULL && n < 16; li = li->li_next, n++)
+ for (li = list->lv_first; li != NULL && n < 16; li = li->li_next, n++)
{
char_u *color_name;
guicolor_T guicolor;
@@ -3800,6 +3804,7 @@ init_vterm_ansi_colors(VTerm *vterm)
if (var != NULL
&& (var->di_tv.v_type != VAR_LIST
|| var->di_tv.vval.v_list == NULL
+ || var->di_tv.vval.v_list->lv_first == &range_list_item
|| set_ansi_colors_list(vterm, var->di_tv.vval.v_list) == FAIL))
semsg(_(e_invarg2), "g:terminal_ansi_colors");
}