mirror of
https://github.com/vim/vim.git
synced 2025-10-09 06:14:17 -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:
@@ -4883,9 +4883,10 @@ do_set(arg, opt_flags)
|
|||||||
{
|
{
|
||||||
i = (int)STRLEN(origval);
|
i = (int)STRLEN(origval);
|
||||||
/* strip a trailing comma, would get 2 */
|
/* strip a trailing comma, would get 2 */
|
||||||
if (comma && (flags & P_ONECOMMA) && i > 1
|
if (comma && i > 1
|
||||||
&& origval[i - 1] == ','
|
&& (flags & P_ONECOMMA) == P_ONECOMMA
|
||||||
&& origval[i - 2] != '\\')
|
&& origval[i - 1] == ','
|
||||||
|
&& origval[i - 2] != '\\')
|
||||||
i--;
|
i--;
|
||||||
mch_memmove(newval + i + comma, newval,
|
mch_memmove(newval + i + comma, newval,
|
||||||
STRLEN(newval) + 1);
|
STRLEN(newval) + 1);
|
||||||
|
@@ -10,6 +10,12 @@ STARTTEST
|
|||||||
:endtry
|
:endtry
|
||||||
:buf 1
|
:buf 1
|
||||||
:$put =caught
|
:$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
|
:/^result/,$w! test.out
|
||||||
:qa!
|
:qa!
|
||||||
ENDTEST
|
ENDTEST
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
result
|
result
|
||||||
ok
|
ok
|
||||||
|
foo,,bar
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
915,
|
||||||
/**/
|
/**/
|
||||||
914,
|
914,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user