vim-patch:7.4.741 #4121

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)

a7b7b1cef9
This commit is contained in:
Jurica Bradaric
2016-01-28 19:28:15 +01:00
committed by Justin M. Keyes
parent 99067b7e56
commit 59ef994f8f
3 changed files with 21 additions and 1 deletions

View File

@@ -1673,6 +1673,11 @@ do_set (
&& *newval != NUL);
if (adding) {
i = (int)STRLEN(origval);
// Strip a trailing comma, would get 2.
if (comma && i > 1 && origval[i - 1] == ','
&& origval[i - 2] != '\\') {
--i;
}
memmove(newval + i + comma, newval,
STRLEN(newval) + 1);
memmove(newval, origval, (size_t)i);

View File

@@ -421,7 +421,7 @@ static int included_patches[] = {
// 744 NA
// 743,
// 742,
// 741,
741,
// 740,
739,
// 738 NA