diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-05-04 21:32:53 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-05-04 21:32:53 -0400 |
commit | a62cc5f807a6dc730c871c1fd53f29805a9cdc6e (patch) | |
tree | 03e26246b5a89ffcd584b0b33f69dbf857450344 /src/nvim/eval.c | |
parent | e2cc3f98fb3ca771d9bd108ae9c37c19bea8025b (diff) | |
parent | 11f41a3c8c4b667b30db38875b37d5d25979003e (diff) | |
download | rneovim-a62cc5f807a6dc730c871c1fd53f29805a9cdc6e.tar.gz rneovim-a62cc5f807a6dc730c871c1fd53f29805a9cdc6e.tar.bz2 rneovim-a62cc5f807a6dc730c871c1fd53f29805a9cdc6e.zip |
Merge pull request #4678 from KillTheMule/vim-7.4.672
vim-patch:7.4.672
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index fdeb2c1371..d84bdfebfe 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8692,7 +8692,11 @@ static void f_eventhandler(typval_T *argvars, typval_T *rettv) */ static void f_executable(typval_T *argvars, typval_T *rettv) { - rettv->vval.v_number = os_can_exe(get_tv_string(&argvars[0]), NULL); + char_u *name = get_tv_string(&argvars[0]); + + // Check in $PATH and also check directly if there is a directory name + rettv->vval.v_number = os_can_exe(name, NULL, true) + || (gettail_dir(name) != name && os_can_exe(name, NULL, false)); } /// "exepath()" function @@ -8701,7 +8705,7 @@ static void f_exepath(typval_T *argvars, typval_T *rettv) char_u *arg = get_tv_string(&argvars[0]); char_u *path = NULL; - (void)os_can_exe(arg, &path); + (void)os_can_exe(arg, &path, true); rettv->v_type = VAR_STRING; rettv->vval.v_string = path; @@ -11606,7 +11610,7 @@ static char **tv_to_argv(typval_T *cmd_tv, char **cmd) assert(argl->lv_first); const char_u *exe = get_tv_string_chk(&argl->lv_first->li_tv); - if (!exe || !os_can_exe(exe, NULL)) { + if (!exe || !os_can_exe(exe, NULL, true)) { // String is not executable if (exe) { EMSG2(e_jobexe, exe); |