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/ChangeLog | 5 +++++ Build/source/texk/kpathsea/win32/Makefile.am | 6 +++--- Build/source/texk/kpathsea/win32/Makefile.in | 5 +++-- Build/source/texk/kpathsea/win32/dirutil.c | 13 ++----------- 4 files changed, 13 insertions(+), 16 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/kpathsea/win32/ChangeLog b/Build/source/texk/kpathsea/win32/ChangeLog index feac8b70271..235de44da59 100644 --- a/Build/source/texk/kpathsea/win32/ChangeLog +++ b/Build/source/texk/kpathsea/win32/ChangeLog @@ -1,3 +1,8 @@ +2012-10-04 Peter Breitenlohner + + * dirutil.c: Use stat in int is_dir (). + * Makefile.am: Avoid use of deprecated INCLUDES. + 2012-08-08 Peter Breitenlohner * Makefile.am: Install texhash.exe as copy of mktexlsr.exe. diff --git a/Build/source/texk/kpathsea/win32/Makefile.am b/Build/source/texk/kpathsea/win32/Makefile.am index ddc8763fe19..4edf1d1a077 100644 --- a/Build/source/texk/kpathsea/win32/Makefile.am +++ b/Build/source/texk/kpathsea/win32/Makefile.am @@ -1,10 +1,10 @@ -## Makefile.am for the TeX Live subdirectory texk/dviljk/win32/ +## Makefile.am for the TeX Live subdirectory texk/kpathsea/win32/ ## ## Copyright (C) 2011, 2012 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. ## -INCLUDES = -I$(top_builddir)/.. -I$(top_srcdir)/.. -AM_CPPFLAGS = -DWEB2C_KPSE_VERSION='"Web2C-$(WEB2CVERSION) Kpathsea-$(KPSEVERSION)"' +AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir)/.. +AM_CPPFLAGS += -DWEB2C_KPSE_VERSION='"Web2C-$(WEB2CVERSION) Kpathsea-$(KPSEVERSION)"' AM_CFLAGS = $(WARNING_CFLAGS) # Build WIN32 replacements for Unix shell scripts. diff --git a/Build/source/texk/kpathsea/win32/Makefile.in b/Build/source/texk/kpathsea/win32/Makefile.in index 6fadabf6324..4a62ea57c55 100644 --- a/Build/source/texk/kpathsea/win32/Makefile.in +++ b/Build/source/texk/kpathsea/win32/Makefile.in @@ -256,8 +256,9 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -INCLUDES = -I$(top_builddir)/.. -I$(top_srcdir)/.. -AM_CPPFLAGS = -DWEB2C_KPSE_VERSION='"Web2C-$(WEB2CVERSION) Kpathsea-$(KPSEVERSION)"' +AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir)/.. \ + -DWEB2C_KPSE_VERSION='"Web2C-$(WEB2CVERSION) \ + Kpathsea-$(KPSEVERSION)"' AM_CFLAGS = $(WARNING_CFLAGS) fmtutil_SOURCES = \ 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