mirror of
https://git.busybox.net/busybox
synced 2026-01-31 16:43:21 +00:00
lineedit: omit directories when tab-completing from PATH
Only files should be matched when using PATH for tab-completion. function old new delta complete_cmd_dir_file 883 894 +11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 11/0) Total: 11 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
caba1a16ec
commit
8506dd6730
1 changed files with 3 additions and 0 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in a new issue