Karsten Hopp d653cd
To: vim_dev@googlegroups.com
Karsten Hopp d653cd
Subject: Patch 7.4.233
Karsten Hopp d653cd
Fcc: outbox
Karsten Hopp d653cd
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp d653cd
Mime-Version: 1.0
Karsten Hopp d653cd
Content-Type: text/plain; charset=UTF-8
Karsten Hopp d653cd
Content-Transfer-Encoding: 8bit
Karsten Hopp d653cd
------------
Karsten Hopp d653cd
Karsten Hopp d653cd
Patch 7.4.233
Karsten Hopp d653cd
Problem:    Escaping special characters for using "%" with a shell command is
Karsten Hopp d653cd
	    inconsistant, parenthesis are escaped but spaces are not.
Karsten Hopp d653cd
Solution:   Only escape "!". (Gary Johnson)
Karsten Hopp d653cd
Files:	    src/ex_docmd.c
Karsten Hopp d653cd
Karsten Hopp d653cd
Karsten Hopp d653cd
*** ../vim-7.4.232/src/ex_docmd.c	2014-04-01 17:49:40.140891378 +0200
Karsten Hopp d653cd
--- src/ex_docmd.c	2014-04-01 18:26:16.036861171 +0200
Karsten Hopp d653cd
***************
Karsten Hopp d653cd
*** 4580,4604 ****
Karsten Hopp d653cd
  
Karsten Hopp d653cd
  	/* For a shell command a '!' must be escaped. */
Karsten Hopp d653cd
  	if ((eap->usefilter || eap->cmdidx == CMD_bang)
Karsten Hopp d653cd
! 			    && vim_strpbrk(repl, (char_u *)"!&;()<>") != NULL)
Karsten Hopp d653cd
  	{
Karsten Hopp d653cd
  	    char_u	*l;
Karsten Hopp d653cd
  
Karsten Hopp d653cd
! 	    l = vim_strsave_escaped(repl, (char_u *)"!&;()<>");
Karsten Hopp d653cd
  	    if (l != NULL)
Karsten Hopp d653cd
  	    {
Karsten Hopp d653cd
  		vim_free(repl);
Karsten Hopp d653cd
  		repl = l;
Karsten Hopp d653cd
- 		/* For a sh-like shell escape "!" another time. */
Karsten Hopp d653cd
- 		if (strstr((char *)p_sh, "sh") != NULL)
Karsten Hopp d653cd
- 		{
Karsten Hopp d653cd
- 		    l = vim_strsave_escaped(repl, (char_u *)"!");
Karsten Hopp d653cd
- 		    if (l != NULL)
Karsten Hopp d653cd
- 		    {
Karsten Hopp d653cd
- 			vim_free(repl);
Karsten Hopp d653cd
- 			repl = l;
Karsten Hopp d653cd
- 		    }
Karsten Hopp d653cd
- 		}
Karsten Hopp d653cd
  	    }
Karsten Hopp d653cd
  	}
Karsten Hopp d653cd
  
Karsten Hopp d653cd
--- 4580,4594 ----
Karsten Hopp d653cd
  
Karsten Hopp d653cd
  	/* For a shell command a '!' must be escaped. */
Karsten Hopp d653cd
  	if ((eap->usefilter || eap->cmdidx == CMD_bang)
Karsten Hopp d653cd
! 			    && vim_strpbrk(repl, (char_u *)"!") != NULL)
Karsten Hopp d653cd
  	{
Karsten Hopp d653cd
  	    char_u	*l;
Karsten Hopp d653cd
  
Karsten Hopp d653cd
! 	    l = vim_strsave_escaped(repl, (char_u *)"!");
Karsten Hopp d653cd
  	    if (l != NULL)
Karsten Hopp d653cd
  	    {
Karsten Hopp d653cd
  		vim_free(repl);
Karsten Hopp d653cd
  		repl = l;
Karsten Hopp d653cd
  	    }
Karsten Hopp d653cd
  	}
Karsten Hopp d653cd
  
Karsten Hopp d653cd
*** ../vim-7.4.232/src/version.c	2014-04-01 17:49:40.144891378 +0200
Karsten Hopp d653cd
--- src/version.c	2014-04-01 18:54:13.276838100 +0200
Karsten Hopp d653cd
***************
Karsten Hopp d653cd
*** 736,737 ****
Karsten Hopp d653cd
--- 736,739 ----
Karsten Hopp d653cd
  {   /* Add new patch number below this line */
Karsten Hopp d653cd
+ /**/
Karsten Hopp d653cd
+     233,
Karsten Hopp d653cd
  /**/
Karsten Hopp d653cd
Karsten Hopp d653cd
-- 
Karsten Hopp d653cd
hundred-and-one symptoms of being an internet addict:
Karsten Hopp d653cd
17. You turn on your intercom when leaving the room so you can hear if new
Karsten Hopp d653cd
    e-mail arrives.
Karsten Hopp d653cd
Karsten Hopp d653cd
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp d653cd
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp d653cd
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp d653cd
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///