aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-06-17 09:20:03 +0100
committerRon Yorston <rmy@pobox.com>2015-06-17 09:20:03 +0100
commiteac78ac5f6a34f8ac5ae2a738db85e2864facc01 (patch)
treea1d2e5cc0c2e00a2d59161b1561a2621821fc1ac
parent899efb44dbc38410a546ed740c1bff4881da0e96 (diff)
downloadbusybox-w32-eac78ac5f6a34f8ac5ae2a738db85e2864facc01.tar.gz
busybox-w32-eac78ac5f6a34f8ac5ae2a738db85e2864facc01.tar.bz2
busybox-w32-eac78ac5f6a34f8ac5ae2a738db85e2864facc01.zip
lineedit: skip non-executables when tab-completing commands
Directories on PATH in Windows are stuffed full of DLLs: ignore them when doing tab completion.
-rw-r--r--libbb/lineedit.c3
1 files changed, 3 insertions, 0 deletions
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)
865 if (stat(found, &st) && lstat(found, &st)) 865 if (stat(found, &st) && lstat(found, &st))
866 goto cont; /* hmm, remove in progress? */ 866 goto cont; /* hmm, remove in progress? */
867 867
868 if (type == FIND_EXE_ONLY && !file_is_executable(found))
869 goto cont;
870
868 /* Save only name */ 871 /* Save only name */
869 len = strlen(name_found); 872 len = strlen(name_found);
870 found = xrealloc(found, len + 2); /* +2: for slash and NUL */ 873 found = xrealloc(found, len + 2); /* +2: for slash and NUL */