diff options
-rw-r--r-- | src/nvim/option.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index e6b41d63d0..69e7bb4b21 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1207,6 +1207,9 @@ static void do_set_option_string(int opt_idx, int opt_flags, char **argp, int ne // Set the new value. *(char **)(varp) = newval; + if (newval == NULL) { + *(char **)(varp) = empty_option; + } // origval may be freed by did_set_string_option(), make a copy. char *saved_origval = (origval != NULL) ? xstrdup(origval) : NULL; |