Mercurial > vim
diff src/misc1.c @ 29113:495d55210aac v8.2.5077
patch 8.2.5077: various warnings from clang on MS-Windows
Commit: https://github.com/vim/vim/commit/a34b4460c2843c67a35a2d236b01e6cb9bc38734
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sat Jun 11 10:43:26 2022 +0100
patch 8.2.5077: various warnings from clang on MS-Windows
Problem: Various warnings from clang on MS-Windows.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/10553)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Jun 2022 11:45:04 +0200 |
parents | d0241e74bfdb |
children | b1304512c036 |
line wrap: on
line diff
--- a/src/misc1.c +++ b/src/misc1.c @@ -1351,6 +1351,9 @@ expand_env_esc( int mustfree; // var was allocated, need to free it later int at_start = TRUE; // at start of a name int startstr_len = 0; +#if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) + char_u *save_dst = dst; +#endif if (startstr != NULL) startstr_len = (int)STRLEN(startstr); @@ -1575,7 +1578,7 @@ expand_env_esc( // with it, skip a character if (after_pathsep(dst, dst + c) #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) - && dst[-1] != ':' + && (dst == save_dst || dst[-1] != ':') #endif && vim_ispathsep(*tail)) ++tail;