summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-10-02 12:49:20 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-10-02 12:49:20 +0000
commitcf3a673589aa2b89a25ddcb9b36bf61bd053220e (patch)
treed0e553027256fa79b2705b5670836c5dc24933f1 /Build
parent46ef45dc7a53ace0b5d2516a67aa1608d55acc89 (diff)
use stat in is_dir ().
git-svn-id: svn://tug.org/texlive/trunk@27866 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/win32lib.c16
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);
}
/*