From eac78ac5f6a34f8ac5ae2a738db85e2864facc01 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 17 Jun 2015 09:20:03 +0100 Subject: lineedit: skip non-executables when tab-completing commands Directories on PATH in Windows are stuffed full of DLLs: ignore them when doing tab completion. --- libbb/lineedit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libbb') diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 8d265a625..86ded6bc5 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -865,6 +865,9 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type) if (stat(found, &st) && lstat(found, &st)) goto cont; /* hmm, remove in progress? */ + if (type == FIND_EXE_ONLY && !file_is_executable(found)) + goto cont; + /* Save only name */ len = strlen(name_found); found = xrealloc(found, len + 2); /* +2: for slash and NUL */ -- cgit v1.2.3-55-g6feb