1
0
forked from aniani/vim

patch 7.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.
This commit is contained in:
Bram Moolenaar
2016-01-01 14:48:20 +01:00
parent 8dfc5eb328
commit 8f79acdf7e
8 changed files with 40 additions and 18 deletions

View File

@@ -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;