updated for version 7.0217
diff --git a/src/os_unix.c b/src/os_unix.c
index c60ddaf..a80bd21 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2610,8 +2610,6 @@
 #endif
 }
 
-#if defined(FEAT_EVAL) || defined(PROTO)
-
 static int executable_file __ARGS((char_u *name));
 
 /*
@@ -2681,7 +2679,6 @@
     vim_free(buf);
     return retval;
 }
-#endif
 
 /*
  * Check what "name" is:
@@ -4924,6 +4921,10 @@
 		if ((dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
 		    continue;
 
+		/* Skip files that are not executable if we check for that. */
+		if (!dir && (flags & EW_EXEC) && !mch_can_exe(p))
+		    continue;
+
 		if (--files_free == 0)
 		{
 		    /* need more room in table of pointers */
@@ -5390,6 +5391,10 @@
 	if ((dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
 	    continue;
 
+	/* Skip files that are not executable if we check for that. */
+	if (!dir && (flags & EW_EXEC) && !mch_can_exe((*file)[i]))
+	    continue;
+
 	p = alloc((unsigned)(STRLEN((*file)[i]) + 1 + dir));
 	if (p)
 	{