vim-patch:8.2.4924: maparg() may return a string that cannot be reused

Problem:    maparg() may return a string that cannot be reused.
Solution:   use msg_outtrans_special() instead of str2special().
            (closes vim/vim#10384)
0519ce0039
This commit is contained in:
zeertzjq
2022-05-09 19:19:07 +08:00
parent 41ce7b07e2
commit db506d991d
5 changed files with 62 additions and 18 deletions

View File

@@ -4980,7 +4980,11 @@ int get_option_value(const char *name, long *numval, char **stringval, int opt_f
return -2;
}
if (stringval != NULL) {
*stringval = xstrdup(*(char **)varp);
if ((char_u **)varp == &p_pt) { // 'pastetoggle'
*stringval = str2special_save(*(char **)(varp), false, false);
} else {
*stringval = xstrdup(*(char **)(varp));
}
}
return 0;
}