mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
win: executable(): fix relative path bug
Qualified (i.e. dot-prefixed) relative paths should only search CWD, not $PATH.
This commit is contained in:
parent
d13803f64f
commit
519b93d236
@ -242,8 +242,12 @@ bool os_can_exe(const char_u *name, char_u **abspath, bool use_path)
|
||||
FUNC_ATTR_NONNULL_ARG(1)
|
||||
{
|
||||
bool no_path = !use_path || path_is_absolute(name);
|
||||
#ifndef WIN32
|
||||
#ifdef WIN32
|
||||
// If the filename is "qualified" (relative or absolute) do not check $PATH.
|
||||
no_path |= (name[0] == '.'
|
||||
&& ((name[1] == '/' || name[1] == '\\')
|
||||
|| (name[1] == '.' && (name[2] == '/' || name[2] == '\\'))));
|
||||
#else
|
||||
no_path |= (name[0] == '.'
|
||||
&& (name[1] == '/' || (name[1] == '.' && name[2] == '/')));
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user