summaryrefslogtreecommitdiffstats
path: root/source/OSSupport/File.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-09-21 19:45:11 +0200
committermadmaxoft <github@xoft.cz>2013-09-21 19:45:11 +0200
commit744b3be4549719e4c8e7446849a679ad31c17050 (patch)
tree525e475fe9ff4999f574f81eac66ca48486b2614 /source/OSSupport/File.cpp
parentImplemented cWebAdmin:GetMemoryUsage() on Linux proper. (diff)
downloadcuberite-744b3be4549719e4c8e7446849a679ad31c17050.tar
cuberite-744b3be4549719e4c8e7446849a679ad31c17050.tar.gz
cuberite-744b3be4549719e4c8e7446849a679ad31c17050.tar.bz2
cuberite-744b3be4549719e4c8e7446849a679ad31c17050.tar.lz
cuberite-744b3be4549719e4c8e7446849a679ad31c17050.tar.xz
cuberite-744b3be4549719e4c8e7446849a679ad31c17050.tar.zst
cuberite-744b3be4549719e4c8e7446849a679ad31c17050.zip
Diffstat (limited to 'source/OSSupport/File.cpp')
-rw-r--r--source/OSSupport/File.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/OSSupport/File.cpp b/source/OSSupport/File.cpp
index 871d9fb94..a4c9a22f4 100644
--- a/source/OSSupport/File.cpp
+++ b/source/OSSupport/File.cpp
@@ -290,7 +290,8 @@ bool cFile::Rename(const AString & a_OrigFileName, const AString & a_NewFileName
bool cFile::IsFolder(const AString & a_Path)
{
#ifdef _WIN32
- return ((GetFileAttributes(a_Path.c_str()) & FILE_ATTRIBUTE_DIRECTORY) != 0);
+ DWORD FileAttrib = GetFileAttributes(a_Path.c_str());
+ return ((FileAttrib != INVALID_FILE_ATTRIBUTES) && ((FileAttrib & FILE_ATTRIBUTE_DIRECTORY) != 0));
#else
struct stat st;
return ((stat(a_Path.c_str(), &st) == 0) && S_ISDIR(st.st_mode));