diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/lineedit.c | 3 |
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) | |||
871 | strcpy(found, name_found); | 871 | strcpy(found, name_found); |
872 | 872 | ||
873 | if (S_ISDIR(st.st_mode)) { | 873 | if (S_ISDIR(st.st_mode)) { |
874 | /* skip directories if searching PATH */ | ||
875 | if (type == FIND_EXE_ONLY && !dirbuf) | ||
876 | goto cont; | ||
874 | /* name is a directory, add slash */ | 877 | /* name is a directory, add slash */ |
875 | found[len] = '/'; | 878 | found[len] = '/'; |
876 | found[len + 1] = '\0'; | 879 | found[len + 1] = '\0'; |