0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

Fix crash for ":ownsyntax". (Dominique Pelle)

This commit is contained in:
Bram Moolenaar
2010-06-06 23:10:19 +02:00
parent 9d6650f6c4
commit e0c6a656f3

View File

@@ -6198,10 +6198,13 @@ ex_ownsyntax(eap)
/* move value of b:current_syntax to w:current_syntax */
new_value = get_var_value((char_u *)"b:current_syntax");
set_internal_string_var((char_u *)"w:current_syntax", new_value);
if (new_value != NULL)
set_internal_string_var((char_u *)"w:current_syntax", new_value);
/* restore value of b:current_syntax */
if (old_value != NULL)
if (old_value == NULL)
do_unlet((char_u *)"b:current_syntax", TRUE);
else
{
set_internal_string_var((char_u *)"b:current_syntax", old_value);
vim_free(old_value);