summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-11-10 17:50:24 +0100
committerBram Moolenaar <Bram@vim.org>2015-11-10 17:50:24 +0100
commit174674743d9a2d7361c9cd89836f8dd8651edeeb (patch)
treecc9bee4c0a351541dd3ddfc1a236420c5f0df757 /src/option.c
parent98b30a473a58ae98c280e0383c8b1e08c0ebced5 (diff)
downloadvim-git-174674743d9a2d7361c9cd89836f8dd8651edeeb.tar.gz
patch 7.4.915v7.4.915
Problem: When removing from 'path' and then adding, a comma may go missing. (Malcolm Rowe) Solution: Fix the check for P_ONECOMMA. (closes #471)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index db3a197af..bc44cb2d4 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4883,9 +4883,10 @@ do_set(arg, opt_flags)
{
i = (int)STRLEN(origval);
/* strip a trailing comma, would get 2 */
- if (comma && (flags & P_ONECOMMA) && i > 1
- && origval[i - 1] == ','
- && origval[i - 2] != '\\')
+ if (comma && i > 1
+ && (flags & P_ONECOMMA) == P_ONECOMMA
+ && origval[i - 1] == ','
+ && origval[i - 2] != '\\')
i--;
mch_memmove(newval + i + comma, newval,
STRLEN(newval) + 1);