summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/mingw32.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/kpathsea/mingw32.c')
-rw-r--r--Build/source/texk/kpathsea/mingw32.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/Build/source/texk/kpathsea/mingw32.c b/Build/source/texk/kpathsea/mingw32.c
index c0d037b41ca..488bc013e11 100644
--- a/Build/source/texk/kpathsea/mingw32.c
+++ b/Build/source/texk/kpathsea/mingw32.c
@@ -32,6 +32,7 @@
#include <kpathsea/lib.h>
#include <kpathsea/concatn.h>
#include <kpathsea/variable.h>
+#include <kpathsea/c-stat.h>
#include <shlobj.h>
#include <errno.h>
@@ -490,18 +491,9 @@ look_for_cmd(const char *cmd, char **app)
static int is_dir (char *buff)
{
- HANDLE h;
- WIN32_FIND_DATA w32fd;
-
- if (((h = FindFirstFile (buff, &w32fd))
- != INVALID_HANDLE_VALUE) &&
- (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- FindClose (h);
- return (1);
- } else {
- FindClose (h);
- return (0);
- }
+ struct stat stats;
+
+ return stat (buff, &stats) == 0 && S_ISDIR (stats.st_mode);
}
/*