diff src/option.c @ 7426:779a7c14c795 v7.4.1017

commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 1 14:48:20 2016 +0100 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.
author Christian Brabandt <cb@256bit.org>
date Fri, 01 Jan 2016 15:00:04 +0100
parents 08e62c4fc17d
children ad432f8f68fb
line wrap: on
line diff
--- 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;