diff options
-rw-r--r-- | src/syntax.c | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/syntax.c b/src/syntax.c index 483a9b02f4..788a9f5aab 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6988,8 +6988,22 @@ init_highlight(both, reset) * and 'background' or 't_Co' is changed. */ p = get_var_value((char_u *)"g:colors_name"); - if (p != NULL && load_colors(p) == OK) - return; + if (p != NULL) + { + /* The value of g:colors_name could be freed when sourcing the script, + * making "p" invalid, so copy it. */ + char_u *copy_p = vim_strsave(p); + int r; + + if (copy_p != NULL) + { + r = load_colors(copy_p); + vim_free(copy_p); + if (r == OK) + return; + } + } + #endif /* diff --git a/src/version.c b/src/version.c index 21a910d702..11d2ff2e22 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 660, +/**/ 659, /**/ 658, |