diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-03 10:50:44 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-03 10:50:44 +0000 |
commit | 3c02a9fad304101bcfce495d881c9590f6998943 (patch) | |
tree | 3d4be9558cd2fe2bc9725f5a0b2416b34aee68cb | |
parent | 49149b2fd0e2e53cf8fbb7c48bcb3be3c7e52136 (diff) |
use stat in is_dir ().
git-svn-id: svn://tug.org/texlive/trunk@27870 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/mingw32.c | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index d2ccb97e461..8207f8dabbf 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2012-10-03 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mingw32.c: use stat in static int is_dir (). + 2012-10-02 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * win32lib.c: use stat in static int is_dir (). 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); } /* |