From 3e57c5216fadc3dfe5ab1d04388e2b4de1b0e8c6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 4 Jan 2026 18:48:34 +0800 Subject: [PATCH] vim-patch:9.1.1648: MS-Windows: some style issues with patch v9.1.1646 Problem: MS-Windows: some style issues with patch v9.1.1646 Solution: Fix typose and code style issues (zeertzjq). closes: vim/vim#18036 https://github.com/vim/vim/commit/14afa278c1bcb2df51b647ffda2821c5294eb7ff --- src/nvim/eval/fs.c | 2 +- src/nvim/path.c | 6 +++--- test/old/testdir/test_cd.vim | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nvim/eval/fs.c b/src/nvim/eval/fs.c index ba6620d82b..65e27b0620 100644 --- a/src/nvim/eval/fs.c +++ b/src/nvim/eval/fs.c @@ -112,7 +112,7 @@ repeat: // FullName_save() is slow, don't use it when not needed. if (*p != NUL || !vim_isAbsName(*fnamep) -#ifdef MSWIN // enforce drive letter on windows paths +#ifdef MSWIN // enforce drive letter on Windows paths || **fnamep == '/' || **fnamep == '\\' #endif ) { diff --git a/src/nvim/path.c b/src/nvim/path.c index c24238a404..9d4c8d7bde 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -381,7 +381,7 @@ int path_fnamencmp(const char *const fname1, const char *const fname2, size_t le const char *p2 = fname2; # ifdef MSWIN - // To allow proper comparisson of absolute paths: + // To allow proper comparison of absolute paths: // - one with explicit drive letter C:\xxx // - another with implicit drive letter \xxx // advance the pointer, of the explicit one, to skip the drive @@ -396,7 +396,7 @@ int path_fnamencmp(const char *const fname1, const char *const fname2, size_t le // Check for the colon p2 += utfc_ptr2len(p2); c2 = utf_ptr2char(p2); - if (c2 == ':' && drive == _getdrive()) { // skip the drive for comparisson + if (c2 == ':' && drive == _getdrive()) { // skip the drive for comparison p2 += utfc_ptr2len(p2); break; } else { // ignore @@ -2415,7 +2415,7 @@ bool path_is_absolute(const char *fname) return false; } // A name like "d:/foo" and "//server/share" is absolute - // /foo and \foo are absolute too because windows keeps a current drive. + // /foo and \foo are absolute too because Windows keeps a current drive. return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':' && vim_ispathsep_nocolon(fname[2])) || vim_ispathsep_nocolon(fname[0])); #else diff --git a/test/old/testdir/test_cd.vim b/test/old/testdir/test_cd.vim index 015f7e4178..5d6d4018c4 100644 --- a/test/old/testdir/test_cd.vim +++ b/test/old/testdir/test_cd.vim @@ -226,7 +226,7 @@ func Test_cd_completion() set cdpath& if has('win32') - " Test windows absolute path completion + " Test Windows absolute path completion " Retrieve a suitable dir in the current drive let dir = readdir('/', 'isdirectory("/" .. v:val) && len(v:val) > 2')[-1] " Get partial path