astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
59c864e
To: vim-dev@vim.org
59c864e
Subject: Patch 7.1.156
59c864e
Fcc: outbox
59c864e
From: Bram Moolenaar <Bram@moolenaar.net>
59c864e
Mime-Version: 1.0
59c864e
Content-Type: text/plain; charset=ISO-8859-1
59c864e
Content-Transfer-Encoding: 8bit
59c864e
------------
59c864e
59c864e
Patch 7.1.156
59c864e
Problem:    Overlapping arguments for strcpy() when expanding command line
59c864e
	    variables.
59c864e
Solution:   Use mch_memmove() instead of STRCPY().  Also fix a few typos.
59c864e
	    (Dominique Pelle)
59c864e
Files:	    src/ex_docmd.c
59c864e
59c864e
59c864e
*** ../vim-7.1.155/src/ex_docmd.c	Fri Oct 19 16:20:09 2007
59c864e
--- src/ex_docmd.c	Sat Nov 10 12:39:51 2007
59c864e
***************
59c864e
*** 666,672 ****
59c864e
  		if (ex_pressedreturn)
59c864e
  		{
59c864e
  		    /* go up one line, to overwrite the ":<CR>" line, so the
59c864e
! 		     * output doensn't contain empty lines. */
59c864e
  		    msg_row = prev_msg_row;
59c864e
  		    if (prev_msg_row == Rows - 1)
59c864e
  			msg_row--;
59c864e
--- 666,672 ----
59c864e
  		if (ex_pressedreturn)
59c864e
  		{
59c864e
  		    /* go up one line, to overwrite the ":<CR>" line, so the
59c864e
! 		     * output doesn't contain empty lines. */
59c864e
  		    msg_row = prev_msg_row;
59c864e
  		    if (prev_msg_row == Rows - 1)
59c864e
  			msg_row--;
59c864e
***************
59c864e
*** 2760,2766 ****
59c864e
  
59c864e
      /*
59c864e
       * Isolate the command and search for it in the command table.
59c864e
!      * Exeptions:
59c864e
       * - the 'k' command can directly be followed by any character.
59c864e
       * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
59c864e
       *	    but :sre[wind] is another command, as are :scrip[tnames],
59c864e
--- 2760,2766 ----
59c864e
  
59c864e
      /*
59c864e
       * Isolate the command and search for it in the command table.
59c864e
!      * Exceptions:
59c864e
       * - the 'k' command can directly be followed by any character.
59c864e
       * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
59c864e
       *	    but :sre[wind] is another command, as are :scrip[tnames],
59c864e
***************
59c864e
*** 6677,6683 ****
59c864e
   * The list should be allocated using alloc(), as should each item in the
59c864e
   * list. This function takes over responsibility for freeing the list.
59c864e
   *
59c864e
!  * XXX The list is made into the arggument list. This is freed using
59c864e
   * FreeWild(), which does a series of vim_free() calls, unless the two defines
59c864e
   * __EMX__ and __ALWAYS_HAS_TRAILING_NUL_POINTER are set. In this case, a
59c864e
   * routine _fnexplodefree() is used. This may cause problems, but as the drop
59c864e
--- 6677,6683 ----
59c864e
   * The list should be allocated using alloc(), as should each item in the
59c864e
   * list. This function takes over responsibility for freeing the list.
59c864e
   *
59c864e
!  * XXX The list is made into the argument list. This is freed using
59c864e
   * FreeWild(), which does a series of vim_free() calls, unless the two defines
59c864e
   * __EMX__ and __ALWAYS_HAS_TRAILING_NUL_POINTER are set. In this case, a
59c864e
   * routine _fnexplodefree() is used. This may cause problems, but as the drop
59c864e
***************
59c864e
*** 7795,7801 ****
59c864e
  	if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged()
59c864e
  							     && !eap->forceit)
59c864e
  	{
59c864e
! 	    EMSG(_("E747: Cannot change directory, buffer is modifed (add ! to override)"));
59c864e
  	    return;
59c864e
  	}
59c864e
  
59c864e
--- 7795,7801 ----
59c864e
  	if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged()
59c864e
  							     && !eap->forceit)
59c864e
  	{
59c864e
! 	    EMSG(_("E747: Cannot change directory, buffer is modified (add ! to override)"));
59c864e
  	    return;
59c864e
  	}
59c864e
  
59c864e
***************
59c864e
*** 9391,9397 ****
59c864e
      if (src > srcstart && src[-1] == '\\')
59c864e
      {
59c864e
  	*usedlen = 0;
59c864e
! 	STRCPY(src - 1, src);		/* remove backslash */
59c864e
  	return NULL;
59c864e
      }
59c864e
  
59c864e
--- 9391,9397 ----
59c864e
      if (src > srcstart && src[-1] == '\\')
59c864e
      {
59c864e
  	*usedlen = 0;
59c864e
! 	mch_memmove(src - 1, src, STRLEN(src) + 1);	/* remove backslash */
59c864e
  	return NULL;
59c864e
      }
59c864e
  
59c864e
*** ../vim-7.1.155/src/version.c	Sat Nov 10 22:50:20 2007
59c864e
--- src/version.c	Sun Nov 11 19:15:51 2007
59c864e
***************
59c864e
*** 668,669 ****
59c864e
--- 668,671 ----
59c864e
  {   /* Add new patch number below this line */
59c864e
+ /**/
59c864e
+     156,
59c864e
  /**/
59c864e
59c864e
-- 
59c864e
Common sense is what tells you that the world is flat.
59c864e
59c864e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
59c864e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
59c864e
\\\        download, build and distribute -- http://www.A-A-P.org        ///
59c864e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///