summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp
index 769ff0a7c23..4804b56f404 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp
@@ -310,7 +310,8 @@ bool FileSystem::exists (const string &fname) {
bool FileSystem::isDirectory (const string &fname) {
if (const char *cfname = fname.c_str()) {
#ifdef _WIN32
- return GetFileAttributes(cfname) & FILE_ATTRIBUTE_DIRECTORY;
+ auto attr = GetFileAttributes(cfname);
+ return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY);
#else
struct stat attr;
return stat(cfname, &attr) == 0 && S_ISDIR(attr.st_mode);