aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-08 13:56:27 +0800
committerGitHub <noreply@github.com>2024-03-08 13:56:27 +0800
commit6a580b997b9f8124d23ca6c87a47b4fec2e3e9e7 (patch)
tree5ca7f0e9f2e2b164f3c8620a5145ff0e2884e497 /src
parent25124d3607b8f645d65e734c72cfc1da7498b34e (diff)
downloadrneovim-6a580b997b9f8124d23ca6c87a47b4fec2e3e9e7.tar.gz
rneovim-6a580b997b9f8124d23ca6c87a47b4fec2e3e9e7.tar.bz2
rneovim-6a580b997b9f8124d23ca6c87a47b4fec2e3e9e7.zip
vim-patch:8.2.5077: various warnings from clang on MS-Windows (#27773)
Problem: Various warnings from clang on MS-Windows. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#10553) https://github.com/vim/vim/commit/a34b4460c2843c67a35a2d236b01e6cb9bc38734 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/env.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 0d4452662d..5b1cb01976 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -586,6 +586,9 @@ void expand_env_esc(char *restrict srcp, char *restrict dst, int dstlen, bool es
bool copy_char;
bool mustfree; // var was allocated, need to free it later
bool at_start = true; // at start of a name
+#if defined(BACKSLASH_IN_FILENAME)
+ char *const save_dst = dst;
+#endif
int prefix_len = (prefix == NULL) ? 0 : (int)strlen(prefix);
@@ -726,7 +729,7 @@ void expand_env_esc(char *restrict srcp, char *restrict dst, int dstlen, bool es
// with it, skip a character
if (after_pathsep(dst, dst + c)
#if defined(BACKSLASH_IN_FILENAME)
- && dst[-1] != ':'
+ && (dst == save_dst || dst[-1] != ':')
#endif
&& vim_ispathsep(*tail)) {
tail++;