summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
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 7bcb26abc..a6ce0ac63 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);