updated for version 7.4.672
Problem: When completing a shell command, directories in the current
directory are not listed.
Solution: When "." is not in $PATH also look in the current directory for
directories.
diff --git a/src/ex_getln.c b/src/ex_getln.c
index e18a8ed..31e61d0 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4885,6 +4885,7 @@
char_u *s, *e;
int flags = flagsarg;
int ret;
+ int did_curdir = FALSE;
if (buf == NULL)
return FAIL;
@@ -4896,7 +4897,7 @@
if (pat[i] == '\\' && pat[i + 1] == ' ')
STRMOVE(pat + i, pat + i + 1);
- flags |= EW_FILE | EW_EXEC;
+ flags |= EW_FILE | EW_EXEC | EW_SHELLCMD;
/* For an absolute name we don't use $PATH. */
if (mch_isFullName(pat))
@@ -4913,11 +4914,22 @@
/*
* Go over all directories in $PATH. Expand matches in that directory and
- * collect them in "ga".
+ * collect them in "ga". When "." is not in $PATH also expand for the
+ * current directory, to find "subdir/cmd".
*/
ga_init2(&ga, (int)sizeof(char *), 10);
- for (s = path; *s != NUL; s = e)
+ for (s = path; ; s = e)
{
+ if (*s == NUL)
+ {
+ if (did_curdir)
+ break;
+ /* Find directories in the current directory, path is empty. */
+ did_curdir = TRUE;
+ }
+ else if (*s == '.')
+ did_curdir = TRUE;
+
if (*s == ' ')
++s; /* Skip space used for absolute path name. */