summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-01 14:48:20 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-01 14:48:20 +0100
commit8f79acdf7ede2693fbda53c3c9693f16db4f193b (patch)
treeb897f76e3c986698541a575f74034c0ae358d853 /src/option.c
parent8dfc5eb32818b11ff5818a060324b94345c40031 (diff)
downloadvim-git-8f79acdf7ede2693fbda53c3c9693f16db4f193b.tar.gz
patch 7.4.1017v7.4.1017
Problem: When there is a backslash in an option ":set -=" doesn't work. Solution: Handle a backslash better. (Jacob Niehus) Add a new test, merge in old test.
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index c7ef6ee3c..aca0f315f 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4839,9 +4839,15 @@ do_set(arg, opt_flags)
|| s[i] == NUL))
break;
/* Count backslashes. Only a comma with an
- * even number of backslashes before it is
- * recognized as a separator */
- if (s > origval && s[-1] == '\\')
+ * even number of backslashes or a single
+ * backslash preceded by a comma before it
+ * is recognized as a separator */
+ if ((s > origval + 1
+ && s[-1] == '\\'
+ && s[-2] != ',')
+ || (s == origval + 1
+ && s[-1] == '\\'))
+
++bs;
else
bs = 0;