summaryrefslogtreecommitdiffstats
path: root/src/optionstr.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-02-02 16:34:11 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-02 16:34:11 +0000
commit78012f55faf7444e554c0a97a589d99fa215bea9 (patch)
tree1be0c2873a9fe80dbd806eba1167501c3eb351fa /src/optionstr.c
parentbe4e01637e71c8d5095c33b9861fd70b41476732 (diff)
patch 9.0.1275: the code for setting options is too complicatedv9.0.1275
Problem: The code for setting options is too complicated. Solution: Refactor the do_set() function. (Yegappan Lakshmanan, Lewis Russell, closes #11932)
Diffstat (limited to 'src/optionstr.c')
-rw-r--r--src/optionstr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/optionstr.c b/src/optionstr.c
index 46e9ac00b2..d218d5662b 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -680,7 +680,8 @@ did_set_term(int *opt_idx, long_u *free_oldval)
// Both 'term' and 'ttytype' point to T_NAME, only set the
// P_ALLOCED flag on 'term'.
*opt_idx = findoption((char_u *)"term");
- *free_oldval = (get_option_flags(*opt_idx) & P_ALLOCED);
+ if (*opt_idx >= 0)
+ *free_oldval = (get_option_flags(*opt_idx) & P_ALLOCED);
}
return errmsg;