mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.0942: expanding to local dir after homedir keeps "~/"
Problem: Expanding to local dir after homedir keeps "~/". Solution: Adjust modify_fname(). (Christian Brabandt, closes #6205, closes #5979)
This commit is contained in:
@@ -416,7 +416,7 @@ repeat:
|
||||
// Need full path first (use expand_env() to remove a "~/")
|
||||
if (!has_fullname && !has_homerelative)
|
||||
{
|
||||
if (c == '.' && **fnamep == '~')
|
||||
if ((c == '.' || c == '~') && **fnamep == '~')
|
||||
p = pbuf = expand_env_save(*fnamep);
|
||||
else
|
||||
p = pbuf = FullName_save(*fnamep, FALSE);
|
||||
@@ -2397,11 +2397,9 @@ home_replace(
|
||||
if (--dstlen > 0)
|
||||
*dst++ = '~';
|
||||
|
||||
/*
|
||||
* If it's just the home directory, add "/".
|
||||
*/
|
||||
if (!vim_ispathsep(src[0]) && --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)
|
||||
|
Reference in New Issue
Block a user