mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Windows: Check drive letter in absolute paths
Check if drive letter is alphabetic character in path_is_absolute_path().
This commit is contained in:
parent
22e9c51b0f
commit
6b94d4d14f
@ -2191,7 +2191,7 @@ int path_is_absolute_path(const char_u *fname)
|
||||
{
|
||||
#ifdef WIN32
|
||||
// A name like "d:/foo" and "//server/share" is absolute
|
||||
return ((fname[0] && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\'))
|
||||
return ((isalpha(fname[0]) && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\'))
|
||||
|| (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
|
||||
#else
|
||||
// UNIX: This just checks if the file name starts with '/' or '~'.
|
||||
|
Loading…
Reference in New Issue
Block a user