mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.1740: exepath() doesn't work for "bin/cat"
Problem: Exepath() doesn't work for "bin/cat". Solution: Check for any path separator. (Daniel Hahler, closes #4724, closes #4710)
This commit is contained in:
@@ -3103,12 +3103,11 @@ mch_can_exe(char_u *name, char_u **path, int use_path)
|
||||
|
||||
/* When "use_path" is false and if it's an absolute or relative path don't
|
||||
* need to use $PATH. */
|
||||
if (!use_path || mch_isFullName(name) || (name[0] == '.'
|
||||
&& (name[1] == '/' || (name[1] == '.' && name[2] == '/'))))
|
||||
if (!use_path || gettail(name) != name)
|
||||
{
|
||||
/* There must be a path separator, files in the current directory
|
||||
* can't be executed. */
|
||||
if (gettail(name) != name && executable_file(name))
|
||||
if ((use_path || gettail(name) != name) && executable_file(name))
|
||||
{
|
||||
if (path != NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user