patch 8.0.1561: crash with rust syntax highligting
Problem: Crash with rust syntax highligting. (Edd Barrett)
Solution: Avoid going past the end of an empty line.
diff --git a/src/syntax.c b/src/syntax.c
index 81f4604..d0d4515 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2470,7 +2470,8 @@
/* nextgroup ends at end of line, unless "skipnl" or "skipempty" present */
if (current_next_list != NULL
- && syn_getcurline()[current_col + 1] == NUL
+ && (line = syn_getcurline())[current_col] != NUL
+ && line[current_col + 1] == NUL
&& !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
current_next_list = NULL;