aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index a3b798e3f..d64d7d0c2 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -871,6 +871,9 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type)
strcpy(found, name_found);
if (S_ISDIR(st.st_mode)) {
+ /* skip directories if searching PATH */
+ if (type == FIND_EXE_ONLY && !dirbuf)
+ goto cont;
/* name is a directory, add slash */
found[len] = '/';
found[len + 1] = '\0';