Of course, on *nix systems there are probably very few non-executables
in directories on PATH.

Signed-off-by: Ron Yorston <[email protected]>
---
 libbb/lineedit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 2ddb2b6..1fd0dbc 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -817,6 +817,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 */
-- 
2.1.0

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to