0
0
mirror of https://github.com/vim/vim.git synced 2025-10-10 06:24:10 -04:00

patch 7.4.915

Problem:    When removing from 'path' and then adding, a comma may go missing.
            (Malcolm Rowe)
Solution:   Fix the check for P_ONECOMMA. (closes #471)
This commit is contained in:
Bram Moolenaar
2015-11-10 17:50:24 +01:00
parent 98b30a473a
commit 174674743d
4 changed files with 13 additions and 3 deletions

View File

@@ -4883,7 +4883,8 @@ do_set(arg, opt_flags)
{
i = (int)STRLEN(origval);
/* strip a trailing comma, would get 2 */
if (comma && (flags & P_ONECOMMA) && i > 1
if (comma && i > 1
&& (flags & P_ONECOMMA) == P_ONECOMMA
&& origval[i - 1] == ','
&& origval[i - 2] != '\\')
i--;

View File

@@ -10,6 +10,12 @@ STARTTEST
:endtry
:buf 1
:$put =caught
:"
:" Test that changing 'path' keeps two commas.
:set path=foo,,bar
:set path-=bar
:set path+=bar
:$put =&path
:/^result/,$w! test.out
:qa!
ENDTEST

View File

@@ -1,2 +1,3 @@
result
ok
foo,,bar

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
915,
/**/
914,
/**/