summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-06-19 14:06:43 +0200
committerBram Moolenaar <Bram@vim.org>2015-06-19 14:06:43 +0200
commita7b7b1cef9b61700ba5076c1d889dce791392388 (patch)
tree83f9d334df5c9f15803421e217d0123385b22603 /src/option.c
parent541f92d6cfdf2215e743553b5f4b6529dd9fcf31 (diff)
patch 7.4.741v7.4.741
Problem: When using += with ":set" a trailing comma is not recognized. (Issue 365) Solution: Don't add a second comma. Add a test. (partly by Christian Brabandt)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index 7bcb26abcf..a6ce0ac633 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4829,6 +4829,10 @@ do_set(arg, opt_flags)
if (adding)
{
i = (int)STRLEN(origval);
+ /* strip a trailing comma, would get 2 */
+ if (comma && i > 1 && origval[i - 1] == ','
+ && origval[i - 2] != '\\')
+ i--;
mch_memmove(newval + i + comma, newval,
STRLEN(newval) + 1);
mch_memmove(newval, origval, (size_t)i);