From d9fb534f18ff3816d0d7152a10e56f5fcd3821f7 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Thu, 4 Oct 2012 10:17:45 +0000 Subject: kpathsea/win32: Use stat in is_dir() git-svn-id: svn://tug.org/texlive/trunk@27876 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/win32/dirutil.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'Build/source/texk/kpathsea/win32/dirutil.c') diff --git a/Build/source/texk/kpathsea/win32/dirutil.c b/Build/source/texk/kpathsea/win32/dirutil.c index fbedd4c9b8b..db0525f6529 100644 --- a/Build/source/texk/kpathsea/win32/dirutil.c +++ b/Build/source/texk/kpathsea/win32/dirutil.c @@ -7,18 +7,9 @@ int is_dir (char *buff) { - HANDLE h; - WIN32_FIND_DATA w32fd; + struct stat stats; - if (((h = FindFirstFile (buff, &w32fd)) - != INVALID_HANDLE_VALUE) && - (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - FindClose (h); - return (1); - } else { - FindClose (h); - return (0); - } + return stat (buff, &stats) == 0 && S_ISDIR (stats.st_mode); } /* make a directory */ -- cgit v1.2.3