aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-05-04 21:32:53 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-05-04 21:32:53 -0400
commita62cc5f807a6dc730c871c1fd53f29805a9cdc6e (patch)
tree03e26246b5a89ffcd584b0b33f69dbf857450344 /src/nvim/path.c
parente2cc3f98fb3ca771d9bd108ae9c37c19bea8025b (diff)
parent11f41a3c8c4b667b30db38875b37d5d25979003e (diff)
downloadrneovim-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/path.c')
-rw-r--r--src/nvim/path.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 80ad643aa1..aff0ee2d48 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -981,12 +981,12 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern)
* "/path/file", "/path/dir/", "/path//dir", "/file"
* ^ ^ ^ ^
*/
-static char_u *gettail_dir(char_u *fname)
+char_u *gettail_dir(const char_u *fname)
{
- char_u *dir_end = fname;
- char_u *next_dir_end = fname;
+ const char_u *dir_end = fname;
+ const char_u *next_dir_end = fname;
bool look_for_sep = true;
- char_u *p;
+ const char_u *p;
for (p = fname; *p != NUL; ) {
if (vim_ispathsep(*p)) {
@@ -1001,7 +1001,7 @@ static char_u *gettail_dir(char_u *fname)
}
mb_ptr_adv(p);
}
- return dir_end;
+ return (char_u *)dir_end;
}
@@ -1318,9 +1318,12 @@ void addfile(
if ((isdir && !(flags & EW_DIR)) || (!isdir && !(flags & EW_FILE)))
return;
- /* If the file isn't executable, may not add it. Do accept directories. */
- if (!isdir && (flags & EW_EXEC) && !os_can_exe(f, NULL))
+ // If the file isn't executable, may not add it. Do accept directories.
+ // When invoked from expand_shellcmd() do not use $PATH.
+ if (!isdir && (flags & EW_EXEC)
+ && !os_can_exe(f, NULL, !(flags & EW_SHELLCMD))) {
return;
+ }
char_u *p = xmalloc(STRLEN(f) + 1 + isdir);