diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-04 10:17:45 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-04 10:17:45 +0000 |
commit | d9fb534f18ff3816d0d7152a10e56f5fcd3821f7 (patch) | |
tree | 1a4c53617f27b6e19665be707f7d1e126cba43e7 /Build/source/texk/kpathsea/win32/dirutil.c | |
parent | 98e0dde44b1cc1668a98162cd1037770216bb41b (diff) |
kpathsea/win32: Use stat in is_dir()
git-svn-id: svn://tug.org/texlive/trunk@27876 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/win32/dirutil.c')
-rw-r--r-- | Build/source/texk/kpathsea/win32/dirutil.c | 13 |
1 files changed, 2 insertions, 11 deletions
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 */ |