--- path.cc	2002-06-02 05:14:47.000000000 +0200
+++ path.cc.patched	2002-06-04 11:34:49.000000000 +0200
@@ -803,7 +803,8 @@ out:
   if (saw_symlinks)
     set_has_symlinks ();
 
-  if (!error && !(path_flags & PATH_ALL_EXEC))
+  if (!error && !(path_flags & PATH_ALL_EXEC) &&
+      !(fileattr & FILE_ATTRIBUTE_DIRECTORY))
     {
       const char *p = strchr (path, '\0') - 4;
       if (p >= path &&
