patch 8.2.1909: number of status line items is limited to 80
Problem: Number of status line items is limited to 80.
Solution: Dynamically allocate the arrays. (Rom Grk, closes #7181)
diff --git a/src/optionstr.c b/src/optionstr.c
index 430e3c3..8f3f0c5 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -571,11 +571,10 @@
static char *
check_stl_option(char_u *s)
{
- int itemcnt = 0;
int groupdepth = 0;
static char errbuf[80];
- while (*s && itemcnt < STL_MAX_ITEM)
+ while (*s)
{
// Check for valid keys after % sequences
while (*s && *s != '%')
@@ -583,8 +582,6 @@
if (!*s)
break;
s++;
- if (*s != '%' && *s != ')')
- ++itemcnt;
if (*s == '%' || *s == STL_TRUNCMARK || *s == STL_MIDDLEMARK)
{
s++;
@@ -627,8 +624,6 @@
return N_("E540: Unclosed expression sequence");
}
}
- if (itemcnt >= STL_MAX_ITEM)
- return N_("E541: too many items");
if (groupdepth != 0)
return N_("E542: unbalanced groups");
return NULL;