diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/win32lib.c | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 5c908834df5..d2ccb97e461 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2012-10-02 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * win32lib.c: use stat in static int is_dir (). + 2012-10-01 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * win32lib.c: remove _osver since it is obsolete. diff --git a/Build/source/texk/kpathsea/win32lib.c b/Build/source/texk/kpathsea/win32lib.c index 274dc2c9f60..bff2f1e94ee 100644 --- a/Build/source/texk/kpathsea/win32lib.c +++ b/Build/source/texk/kpathsea/win32lib.c @@ -19,6 +19,7 @@ #include <kpathsea/config.h> #include <kpathsea/concatn.h> #include <kpathsea/variable.h> +#include <kpathsea/c-stat.h> FILE * __cdecl kpathsea_win32_popen (kpathsea kpse, const char *cmd, const char *fmode) { @@ -322,18 +323,9 @@ xfseek64 (FILE *f, __int64 offset, int wherefrom, const char *filename) 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); } /* |