Skip to content

Commit 069dafc

Browse files
committed
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.
1 parent 3767b61 commit 069dafc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/syntax.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,8 @@ syn_current_attr(
24702470

24712471
/* nextgroup ends at end of line, unless "skipnl" or "skipempty" present */
24722472
if (current_next_list != NULL
2473-
&& syn_getcurline()[current_col + 1] == NUL
2473+
&& (line = syn_getcurline())[current_col] != NUL
2474+
&& line[current_col + 1] == NUL
24742475
&& !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
24752476
current_next_list = NULL;
24762477

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,8 @@ static char *(features[]) =
778778

779779
static int included_patches[] =
780780
{ /* Add new patch number below this line */
781+
/**/
782+
1561,
781783
/**/
782784
1560,
783785
/**/

0 commit comments

Comments
 (0)