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: #18036

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-08-18 21:01:46 +02:00
committed by Christian Brabandt
parent 44c8072ef6
commit 14afa278c1
4 changed files with 9 additions and 7 deletions

View File

@ -360,7 +360,7 @@ repeat:
// FullName_save() is slow, don't use it when not needed. // FullName_save() is slow, don't use it when not needed.
if (*p != NUL || !vim_isAbsName(*fnamep) if (*p != NUL || !vim_isAbsName(*fnamep)
#ifdef MSWIN // enforce drive letter on windows paths #ifdef MSWIN // enforce drive letter on Windows paths
|| **fnamep == '/' || **fnamep == '\\' || **fnamep == '/' || **fnamep == '\\'
#endif #endif
) )
@ -3114,9 +3114,9 @@ vim_fnamencmp(char_u *x, char_u *y, size_t len)
int cx = NUL; int cx = NUL;
int cy = NUL; int cy = NUL;
#ifdef MSWIN # ifdef MSWIN
/* /*
* To allow proper comparisson of absolute paths: * To allow proper comparison of absolute paths:
* - one with explicit drive letter C:\xxx * - one with explicit drive letter C:\xxx
* - another with implicit drive letter \xxx * - another with implicit drive letter \xxx
* advance the pointer, of the explicit one, to skip the drive * advance the pointer, of the explicit one, to skip the drive
@ -3135,7 +3135,7 @@ vim_fnamencmp(char_u *x, char_u *y, size_t len)
py += mb_ptr2len(py); py += mb_ptr2len(py);
cy = PTR2CHAR(py); cy = PTR2CHAR(py);
if (cy == ':' && drive == _getdrive()) if (cy == ':' && drive == _getdrive())
{ // skip the drive for comparisson { // skip the drive for comparison
py += mb_ptr2len(py); py += mb_ptr2len(py);
break; break;
} }
@ -3148,7 +3148,7 @@ vim_fnamencmp(char_u *x, char_u *y, size_t len)
px = py; px = py;
py = tmp; py = tmp;
} }
#endif # endif
while (len > 0) while (len > 0)
{ {

View File

@ -319,7 +319,7 @@ mch_FullName(
mch_isFullName(char_u *fname) mch_isFullName(char_u *fname)
{ {
// A name like "d:/foo" and "//server/share" is absolute. "d:foo" is not. // A name like "d:/foo" and "//server/share" is absolute. "d:foo" is not.
// /foo and \foo are absolute too because windows keeps a current drive. // /foo and \foo are absolute too because Windows keeps a current drive.
// Another way to check is to use mch_FullName() and see if the result is // Another way to check is to use mch_FullName() and see if the result is
// the same as the name or mch_FullName() fails. However, this has quite a // the same as the name or mch_FullName() fails. However, this has quite a
// bit of overhead, so let's not do that. // bit of overhead, so let's not do that.

View File

@ -223,7 +223,7 @@ func Test_cd_completion()
set cdpath& set cdpath&
if has('win32') if has('win32')
" Test windows absolute path completion " Test Windows absolute path completion
" Retrieve a suitable dir in the current drive " Retrieve a suitable dir in the current drive
let dir = readdir('/', 'isdirectory("/" .. v:val) && len(v:val) > 2')[-1] let dir = readdir('/', 'isdirectory("/" .. v:val) && len(v:val) > 2')[-1]
" Get partial path " Get partial path

View File

@ -719,6 +719,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1648,
/**/ /**/
1647, 1647,
/**/ /**/