Karsten Hopp c17bcc
To: vim-dev@vim.org
Karsten Hopp c17bcc
Subject: Patch 7.1.195
Karsten Hopp c17bcc
Fcc: outbox
Karsten Hopp c17bcc
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c17bcc
Mime-Version: 1.0
Karsten Hopp c17bcc
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp c17bcc
Content-Transfer-Encoding: 8bit
Karsten Hopp c17bcc
------------
Karsten Hopp c17bcc
Karsten Hopp c17bcc
Patch 7.1.195
Karsten Hopp c17bcc
Problem:    '0 mark doesn't work for "~/foo ~ foo".
Karsten Hopp c17bcc
Solution:   Don't expand the whole file name, only "~/".
Karsten Hopp c17bcc
Files:	    src/mark.c
Karsten Hopp c17bcc
Karsten Hopp c17bcc
Karsten Hopp c17bcc
*** ../vim-7.1.194/src/mark.c	Thu May 10 18:48:03 2007
Karsten Hopp c17bcc
--- src/mark.c	Thu Jan  3 20:17:29 2008
Karsten Hopp c17bcc
***************
Karsten Hopp c17bcc
*** 505,513 ****
Karsten Hopp c17bcc
      {
Karsten Hopp c17bcc
  	/*
Karsten Hopp c17bcc
  	 * First expand "~/" in the file name to the home directory.
Karsten Hopp c17bcc
! 	 * Try to shorten the file name.
Karsten Hopp c17bcc
  	 */
Karsten Hopp c17bcc
! 	expand_env(fm->fname, NameBuff, MAXPATHL);
Karsten Hopp c17bcc
  	mch_dirname(IObuff, IOSIZE);
Karsten Hopp c17bcc
  	p = shorten_fname(NameBuff, IObuff);
Karsten Hopp c17bcc
  
Karsten Hopp c17bcc
--- 505,528 ----
Karsten Hopp c17bcc
      {
Karsten Hopp c17bcc
  	/*
Karsten Hopp c17bcc
  	 * First expand "~/" in the file name to the home directory.
Karsten Hopp c17bcc
! 	 * Don't expand the whole name, it may contain other '~' chars.
Karsten Hopp c17bcc
  	 */
Karsten Hopp c17bcc
! 	if (fm->fname[0] == '~' && (fm->fname[1] == '/'
Karsten Hopp c17bcc
! #ifdef BACKSLASH_IN_FILENAME
Karsten Hopp c17bcc
! 		    || fm->fname[1] == '\\'
Karsten Hopp c17bcc
! #endif
Karsten Hopp c17bcc
! 		    ))
Karsten Hopp c17bcc
! 	{
Karsten Hopp c17bcc
! 	    int len;
Karsten Hopp c17bcc
! 
Karsten Hopp c17bcc
! 	    expand_env((char_u *)"~/", NameBuff, MAXPATHL);
Karsten Hopp c17bcc
! 	    len = STRLEN(NameBuff);
Karsten Hopp c17bcc
! 	    vim_strncpy(NameBuff + len, fm->fname + 2, MAXPATHL - len - 1);
Karsten Hopp c17bcc
! 	}
Karsten Hopp c17bcc
! 	else
Karsten Hopp c17bcc
! 	    vim_strncpy(NameBuff, fm->fname, MAXPATHL - 1);
Karsten Hopp c17bcc
! 
Karsten Hopp c17bcc
! 	/* Try to shorten the file name. */
Karsten Hopp c17bcc
  	mch_dirname(IObuff, IOSIZE);
Karsten Hopp c17bcc
  	p = shorten_fname(NameBuff, IObuff);
Karsten Hopp c17bcc
  
Karsten Hopp c17bcc
*** ../vim-7.1.194/src/version.c	Thu Jan  3 18:55:21 2008
Karsten Hopp c17bcc
--- src/version.c	Thu Jan  3 20:10:16 2008
Karsten Hopp c17bcc
***************
Karsten Hopp c17bcc
*** 668,669 ****
Karsten Hopp c17bcc
--- 668,671 ----
Karsten Hopp c17bcc
  {   /* Add new patch number below this line */
Karsten Hopp c17bcc
+ /**/
Karsten Hopp c17bcc
+     195,
Karsten Hopp c17bcc
  /**/
Karsten Hopp c17bcc
Karsten Hopp c17bcc
-- 
Karsten Hopp c17bcc
GUARD #2:  Wait a minute -- supposing two swallows carried it together?
Karsten Hopp c17bcc
GUARD #1:  No, they'd have to have it on a line.
Karsten Hopp c17bcc
GUARD #2:  Well, simple!  They'd just use a standard creeper!
Karsten Hopp c17bcc
GUARD #1:  What, held under the dorsal guiding feathers?
Karsten Hopp c17bcc
GUARD #2:  Well, why not?
Karsten Hopp c17bcc
                                  The Quest for the Holy Grail (Monty Python)
Karsten Hopp c17bcc
Karsten Hopp c17bcc
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c17bcc
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c17bcc
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp c17bcc
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///