aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-11-25 01:07:43 -0800
committerGitHub <noreply@github.com>2019-11-25 01:07:43 -0800
commit967f229f32a3093613feaf99969e44333efd8a0a (patch)
treea436baaac95f85a5b820df86169cb072bf3ef35b /src/nvim/ex_getln.c
parentedb194f3306b6b8a9df7a06c15a60425911c7e85 (diff)
parent0ee4df4d96751cb329b4f72df71ee4f6e831ff6d (diff)
downloadrneovim-967f229f32a3093613feaf99969e44333efd8a0a.tar.gz
rneovim-967f229f32a3093613feaf99969e44333efd8a0a.tar.bz2
rneovim-967f229f32a3093613feaf99969e44333efd8a0a.zip
Merge #11454 from janlazo/vim-8.1.1732
vim-patch:8.1.{223,836,1732}
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 9e2671ca5e..7948da5e6b 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -5008,19 +5008,24 @@ static void expand_shellcmd(char_u *filepat, int *num_file, char_u ***file,
hashtab_T found_ht;
hash_init(&found_ht);
for (s = path; ; s = e) {
+ e = vim_strchr(s, ENV_SEPCHAR);
+ if (e == NULL) {
+ e = s + STRLEN(s);
+ }
+
if (*s == NUL) {
if (did_curdir) {
break;
}
// Find directories in the current directory, path is empty.
did_curdir = true;
- } else if (*s == '.') {
+ flags |= EW_DIR;
+ } else if (STRNCMP(s, ".", e - s) == 0) {
did_curdir = true;
- }
-
- e = vim_strchr(s, ENV_SEPCHAR);
- if (e == NULL) {
- e = s + STRLEN(s);
+ flags |= EW_DIR;
+ } else {
+ // Do not match directories inside a $PATH item.
+ flags &= ~EW_DIR;
}
l = (size_t)(e - s);