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)
Files:      src/option.c, src/testdir/test_options.in, 
            src/testdir/test_options.ok


*** ../vim-7.4.914/src/option.c 2015-11-10 13:30:34.999047749 +0100
--- src/option.c        2015-11-10 17:46:36.191651303 +0100
***************
*** 4883,4891 ****
                                {
                                    i = (int)STRLEN(origval);
                                    /* strip a trailing comma, would get 2 */
!                                   if (comma && (flags & P_ONECOMMA) && i > 1
!                                                   && origval[i - 1] == ','
!                                                   && origval[i - 2] != '\\')
                                        i--;
                                    mch_memmove(newval + i + comma, newval,
                                                          STRLEN(newval) + 1);
--- 4883,4892 ----
                                {
                                    i = (int)STRLEN(origval);
                                    /* strip a trailing comma, would get 2 */
!                                   if (comma && i > 1
!                                         && (flags & P_ONECOMMA) == P_ONECOMMA
!                                         && origval[i - 1] == ','
!                                         && origval[i - 2] != '\\')
                                        i--;
                                    mch_memmove(newval + i + comma, newval,
                                                          STRLEN(newval) + 1);
*** ../vim-7.4.914/src/testdir/test_options.in  2014-04-01 14:08:14.685074130 
+0200
--- src/testdir/test_options.in 2015-11-10 17:45:50.096107003 +0100
***************
*** 10,15 ****
--- 10,21 ----
  :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
*** ../vim-7.4.914/src/testdir/test_options.ok  2014-04-01 14:08:14.685074130 
+0200
--- src/testdir/test_options.ok 2015-11-10 17:46:07.283937094 +0100
***************
*** 1,2 ****
--- 1,3 ----
  result
  ok
+ foo,,bar
*** ../vim-7.4.914/src/version.c        2015-11-10 15:17:59.166278487 +0100
--- src/version.c       2015-11-10 17:48:31.650509518 +0100
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     915,
  /**/

-- 
There's no place like $(HOME)!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui