mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
fix: bounds check for underdot
This commit is contained in:
@@ -11410,14 +11410,14 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'u': {
|
case 'u': {
|
||||||
int len = STRLEN(what);
|
const size_t len = STRLEN(what);
|
||||||
if (len <= 5 || (TOLOWER_ASC(what[5]) == 'l' && len <= 9)) { // underline
|
if (len <= 5 || (TOLOWER_ASC(what[5]) == 'l' && len <= 9)) { // underline
|
||||||
p = highlight_has_attr(id, HL_UNDERCURL, modec);
|
p = highlight_has_attr(id, HL_UNDERCURL, modec);
|
||||||
} else if (TOLOWER_ASC(what[5]) == 'c') { // undercurl
|
} else if (TOLOWER_ASC(what[5]) == 'c') { // undercurl
|
||||||
p = highlight_has_attr(id, HL_UNDERCURL, modec);
|
p = highlight_has_attr(id, HL_UNDERCURL, modec);
|
||||||
} else if (len > 9 && TOLOWER_ASC(what[9]) == 'l') { // underlineline
|
} else if (len > 9 && TOLOWER_ASC(what[9]) == 'l') { // underlineline
|
||||||
p = highlight_has_attr(id, HL_UNDERLINELINE, modec);
|
p = highlight_has_attr(id, HL_UNDERLINELINE, modec);
|
||||||
} else if (len > 5 && TOLOWER_ASC(what[6]) == 'o') { // underdot
|
} else if (len > 6 && TOLOWER_ASC(what[6]) == 'o') { // underdot
|
||||||
p = highlight_has_attr(id, HL_UNDERDOT, modec);
|
p = highlight_has_attr(id, HL_UNDERDOT, modec);
|
||||||
} else { // underdash
|
} else { // underdash
|
||||||
p = highlight_has_attr(id, HL_UNDERDASH, modec);
|
p = highlight_has_attr(id, HL_UNDERDASH, modec);
|
||||||
|
Reference in New Issue
Block a user