Karsten Hopp df6481
To: vim_dev@googlegroups.com
Karsten Hopp df6481
Subject: Patch 7.4.915
Karsten Hopp df6481
Fcc: outbox
Karsten Hopp df6481
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp df6481
Mime-Version: 1.0
Karsten Hopp df6481
Content-Type: text/plain; charset=UTF-8
Karsten Hopp df6481
Content-Transfer-Encoding: 8bit
Karsten Hopp df6481
------------
Karsten Hopp df6481
Karsten Hopp df6481
Patch 7.4.915
Karsten Hopp df6481
Problem:    When removing from 'path' and then adding, a comma may go missing.
Karsten Hopp df6481
            (Malcolm Rowe)
Karsten Hopp df6481
Solution:   Fix the check for P_ONECOMMA. (closes #471)
Karsten Hopp df6481
Files:      src/option.c, src/testdir/test_options.in, 
Karsten Hopp df6481
            src/testdir/test_options.ok
Karsten Hopp df6481
Karsten Hopp df6481
Karsten Hopp df6481
*** ../vim-7.4.914/src/option.c	2015-11-10 13:30:34.999047749 +0100
Karsten Hopp df6481
--- src/option.c	2015-11-10 17:46:36.191651303 +0100
Karsten Hopp df6481
***************
Karsten Hopp df6481
*** 4883,4891 ****
Karsten Hopp df6481
  				{
Karsten Hopp df6481
  				    i = (int)STRLEN(origval);
Karsten Hopp df6481
  				    /* strip a trailing comma, would get 2 */
Karsten Hopp df6481
! 				    if (comma && (flags & P_ONECOMMA) && i > 1
Karsten Hopp df6481
! 					            && origval[i - 1] == ','
Karsten Hopp df6481
! 						    && origval[i - 2] != '\\')
Karsten Hopp df6481
  					i--;
Karsten Hopp df6481
  				    mch_memmove(newval + i + comma, newval,
Karsten Hopp df6481
  							  STRLEN(newval) + 1);
Karsten Hopp df6481
--- 4883,4892 ----
Karsten Hopp df6481
  				{
Karsten Hopp df6481
  				    i = (int)STRLEN(origval);
Karsten Hopp df6481
  				    /* strip a trailing comma, would get 2 */
Karsten Hopp df6481
! 				    if (comma && i > 1
Karsten Hopp df6481
! 					  && (flags & P_ONECOMMA) == P_ONECOMMA
Karsten Hopp df6481
! 					  && origval[i - 1] == ','
Karsten Hopp df6481
! 					  && origval[i - 2] != '\\')
Karsten Hopp df6481
  					i--;
Karsten Hopp df6481
  				    mch_memmove(newval + i + comma, newval,
Karsten Hopp df6481
  							  STRLEN(newval) + 1);
Karsten Hopp df6481
*** ../vim-7.4.914/src/testdir/test_options.in	2014-04-01 14:08:14.685074130 +0200
Karsten Hopp df6481
--- src/testdir/test_options.in	2015-11-10 17:45:50.096107003 +0100
Karsten Hopp df6481
***************
Karsten Hopp df6481
*** 10,15 ****
Karsten Hopp df6481
--- 10,21 ----
Karsten Hopp df6481
  :endtry
Karsten Hopp df6481
  :buf 1
Karsten Hopp df6481
  :$put =caught
Karsten Hopp df6481
+ :"
Karsten Hopp df6481
+ :" Test that changing 'path' keeps two commas.
Karsten Hopp df6481
+ :set path=foo,,bar
Karsten Hopp df6481
+ :set path-=bar
Karsten Hopp df6481
+ :set path+=bar
Karsten Hopp df6481
+ :$put =&path
Karsten Hopp df6481
  :/^result/,$w! test.out
Karsten Hopp df6481
  :qa!
Karsten Hopp df6481
  ENDTEST
Karsten Hopp df6481
*** ../vim-7.4.914/src/testdir/test_options.ok	2014-04-01 14:08:14.685074130 +0200
Karsten Hopp df6481
--- src/testdir/test_options.ok	2015-11-10 17:46:07.283937094 +0100
Karsten Hopp df6481
***************
Karsten Hopp df6481
*** 1,2 ****
Karsten Hopp df6481
--- 1,3 ----
Karsten Hopp df6481
  result
Karsten Hopp df6481
  ok
Karsten Hopp df6481
+ foo,,bar
Karsten Hopp df6481
*** ../vim-7.4.914/src/version.c	2015-11-10 15:17:59.166278487 +0100
Karsten Hopp df6481
--- src/version.c	2015-11-10 17:48:31.650509518 +0100
Karsten Hopp df6481
***************
Karsten Hopp df6481
*** 743,744 ****
Karsten Hopp df6481
--- 743,746 ----
Karsten Hopp df6481
  {   /* Add new patch number below this line */
Karsten Hopp df6481
+ /**/
Karsten Hopp df6481
+     915,
Karsten Hopp df6481
  /**/
Karsten Hopp df6481
Karsten Hopp df6481
-- 
Karsten Hopp df6481
There's no place like $(HOME)!
Karsten Hopp df6481
Karsten Hopp df6481
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp df6481
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp df6481
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp df6481
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///