aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/env.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-07 07:13:13 +0800
committerGitHub <noreply@github.com>2022-02-07 07:13:13 +0800
commitcf86adba61d7ae93f129823eb65a0dcaf3df70c5 (patch)
tree56a429f22215a8cca22dbca44b35135d508a8b30 /src/nvim/os/env.c
parent380bc4fe22e8dbd478e58d568e0d749df439fec9 (diff)
parent72816136a57adbd051c688ee3213fa9446ea48f6 (diff)
downloadrneovim-cf86adba61d7ae93f129823eb65a0dcaf3df70c5.tar.gz
rneovim-cf86adba61d7ae93f129823eb65a0dcaf3df70c5.tar.bz2
rneovim-cf86adba61d7ae93f129823eb65a0dcaf3df70c5.zip
Merge pull request #17263 from zeertzjq/vim-8.2.0208
vim-patch:8.2.{0208,0215,0942,3824,3939}: fnamemodify() patches
Diffstat (limited to 'src/nvim/os/env.c')
-rw-r--r--src/nvim/os/env.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index e9f44d2775..e9868d6b61 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -1111,10 +1111,9 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst
*dst_p++ = '~';
}
- // If it's just the home directory, add "/".
- if (!vim_ispathsep(src[0]) && --dstlen > 0) {
- *dst_p++ = '/';
- }
+ // 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_mod) {