Patch 8.2.0942
Problem:    Expanding to local dir after homedir keeps "~/".
Solution:   Adjust modify_fname(). (Christian Brabandt, closes #6205,
            closes #5979)
Files:      src/filepath.c, src/testdir/test_fnamemodify.vim


*** ../vim-8.2.0941/src/filepath.c      2020-06-05 22:33:38.405658765 +0200
--- src/filepath.c      2020-06-10 13:11:59.943102876 +0200
***************
*** 416,422 ****
        // Need full path first (use expand_env() to remove a "~/")
        if (!has_fullname && !has_homerelative)
        {
!           if (c == '.' && **fnamep == '~')
                p = pbuf = expand_env_save(*fnamep);
            else
                p = pbuf = FullName_save(*fnamep, FALSE);
--- 416,422 ----
        // Need full path first (use expand_env() to remove a "~/")
        if (!has_fullname && !has_homerelative)
        {
!           if ((c == '.' || c == '~') && **fnamep == '~')
                p = pbuf = expand_env_save(*fnamep);
            else
                p = pbuf = FullName_save(*fnamep, FALSE);
***************
*** 2397,2407 ****
                if (--dstlen > 0)
                    *dst++ = '~';
  
!               /*
!                * If it's just the home directory, add  "/".
!                */
!               if (!vim_ispathsep(src[0]) && --dstlen > 0)
!                   *dst++ = '/';
                break;
            }
            if (p == homedir_env)
--- 2397,2405 ----
                if (--dstlen > 0)
                    *dst++ = '~';
  
!               // Do not add directory separator into dst, because dst is
!               // expected to just return the directory name without the
!               // directory separator '/'.
                break;
            }
            if (p == homedir_env)
*** ../vim-8.2.0941/src/testdir/test_fnamemodify.vim    2020-04-25 
15:24:40.551354115 +0200
--- src/testdir/test_fnamemodify.vim    2020-06-10 13:08:30.279730546 +0200
***************
*** 31,36 ****
--- 31,39 ----
    call assert_equal('tar', fnamemodify('abc.fb2.tar.gz', ':e:e:r'))
  
    let cwd = getcwd()
+   call chdir($HOME)
+   call assert_equal('foobar', fnamemodify('~/foobar', ':~:.'))
+   call chdir(cwd)
    call mkdir($HOME . '/XXXXXXXX/a', 'p')
    call mkdir($HOME . '/XXXXXXXX/b', 'p')
    call chdir($HOME . '/XXXXXXXX/a/')
*** ../vim-8.2.0941/src/version.c       2020-06-10 12:15:46.827919259 +0200
--- src/version.c       2020-06-10 13:11:04.571271042 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     942,
  /**/

-- 
FATHER:    Who are you?
PRINCE:    I'm ... your son ...
FATHER:    Not you.
LAUNCELOT: I'm ... er ... Sir Launcelot, sir.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202006101112.05ABCxaL821977%40masaka.moolenaar.net.

Raspunde prin e-mail lui