mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Windows: is_executable(): do not check exec bit.
In Windows there is no equivalent to the filesystem executable bit; the documentation states that for Windows :executable() returns 1 for all files. But this behaviour was broken because is_executable() checked for the UNIX bit. When WIN32 is defined we now skip the S_IXUSR check.
This commit is contained in:
parent
5090d94699
commit
e7b58b4e53
@ -120,9 +120,13 @@ static bool is_executable(const char_u *name)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (S_ISREG(mode) && (S_IXUSR & mode)) {
|
||||
return true;
|
||||
}
|
||||
#if WIN32
|
||||
// Windows does not have exec bit; just check if the file exists and is not
|
||||
// a directory.
|
||||
return (S_ISREG(mode));
|
||||
#else
|
||||
return (S_ISREG(mode) && (S_IXUSR & mode));
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user