From 5db2a12cf8daec83ae44241375c9a284f77617c9 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 21 Dec 2006 09:04:58 +0000 Subject: [PATCH] emoved dependency from SHELL32.DLL --- TSRM/tsrm_virtual_cwd.c | 5 ----- TSRM/tsrm_win32.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index bd350689d3..f52790dfd5 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -35,11 +35,6 @@ #ifdef TSRM_WIN32 #include #include "tsrm_win32.h" -# if HAVE_NEWAPIS_H -# define WANT_GETLONGPATHNAME_WRAPPER -# define COMPILE_NEWAPIS_STUBS -# include -# endif #endif #ifdef NETWARE diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index a87cf177fa..0552b034d2 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -86,11 +86,19 @@ TSRM_API void tsrm_win32_shutdown(void) TSRM_API int tsrm_win32_access(const char *pathname, int mode) { - SHFILEINFO sfi; - if (mode == 1 /*X_OK*/) { +#if 1 + /* This code is not supported by Windows 98, + * but we don't support it anymore */ + DWORD type; + + return GetBinaryType(pathname, &type)?0:-1; +#else + SHFILEINFO sfi; + return access(pathname, 0) == 0 && SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1; +#endif } else { return access(pathname, mode); } -- 2.40.0