lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
657a79e
To: vim-dev@vim.org
657a79e
Subject: patch 7.1.121
657a79e
Fcc: outbox
657a79e
From: Bram Moolenaar <Bram@moolenaar.net>
657a79e
Mime-Version: 1.0
657a79e
Content-Type: text/plain; charset=ISO-8859-1
657a79e
Content-Transfer-Encoding: 8bit
657a79e
------------
657a79e
657a79e
Patch 7.1.121
657a79e
Problem:    Using ":cd %:h" when editing a file in the current directory
657a79e
	    results in an error message for using an empty string.
657a79e
Solution:   When "%:h" results in an empty string use ".".
657a79e
Files:	    src/eval.c
657a79e
657a79e
657a79e
*** ../vim-7.1.120/src/eval.c	Tue Sep 25 17:54:41 2007
657a79e
--- src/eval.c	Sun Sep 16 19:24:49 2007
657a79e
***************
657a79e
*** 21308,21321 ****
657a79e
  	*usedlen += 2;
657a79e
  	s = get_past_head(*fnamep);
657a79e
  	while (tail > s && after_pathsep(s, tail))
657a79e
! 	    --tail;
657a79e
  	*fnamelen = (int)(tail - *fnamep);
657a79e
  #ifdef VMS
657a79e
  	if (*fnamelen > 0)
657a79e
  	    *fnamelen += 1; /* the path separator is part of the path */
657a79e
  #endif
657a79e
! 	while (tail > s && !after_pathsep(s, tail))
657a79e
! 	    mb_ptr_back(*fnamep, tail);
657a79e
      }
657a79e
  
657a79e
      /* ":8" - shortname  */
657a79e
--- 21308,21334 ----
657a79e
  	*usedlen += 2;
657a79e
  	s = get_past_head(*fnamep);
657a79e
  	while (tail > s && after_pathsep(s, tail))
657a79e
! 	    mb_ptr_back(*fnamep, tail);
657a79e
  	*fnamelen = (int)(tail - *fnamep);
657a79e
  #ifdef VMS
657a79e
  	if (*fnamelen > 0)
657a79e
  	    *fnamelen += 1; /* the path separator is part of the path */
657a79e
  #endif
657a79e
! 	if (*fnamelen == 0)
657a79e
! 	{
657a79e
! 	    /* Result is empty.  Turn it into "." to make ":cd %:h" work. */
657a79e
! 	    p = vim_strsave((char_u *)".");
657a79e
! 	    if (p == NULL)
657a79e
! 		return -1;
657a79e
! 	    vim_free(*bufp);
657a79e
! 	    *bufp = *fnamep = tail = p;
657a79e
! 	    *fnamelen = 1;
657a79e
! 	}
657a79e
! 	else
657a79e
! 	{
657a79e
! 	    while (tail > s && !after_pathsep(s, tail))
657a79e
! 		mb_ptr_back(*fnamep, tail);
657a79e
! 	}
657a79e
      }
657a79e
  
657a79e
      /* ":8" - shortname  */
657a79e
*** ../vim-7.1.120/src/version.c	Tue Sep 25 17:54:41 2007
657a79e
--- src/version.c	Tue Sep 25 20:38:08 2007
657a79e
***************
657a79e
*** 668,669 ****
657a79e
--- 668,671 ----
657a79e
  {   /* Add new patch number below this line */
657a79e
+ /**/
657a79e
+     121,
657a79e
  /**/
657a79e
657a79e
-- 
657a79e
It is illegal for anyone to try and stop a child from playfully jumping over
657a79e
puddles of water.
657a79e
		[real standing law in California, United States of America]
657a79e
657a79e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
657a79e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
657a79e
\\\        download, build and distribute -- http://www.A-A-P.org        ///
657a79e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///