From 4d1dbe8059686ed244c4c9de1ad5db0ae18f8482 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Fri, 16 Sep 2011 15:01:02 +0100 Subject: [PATCH] Fix test for return value of GetCurrentDirectory() on Windows. GetCurrentDirectory() returns zero on error or the length of the path otherwise. --- src/FileUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileUtils.cpp b/src/FileUtils.cpp index e1e7efe..9c37760 100644 --- a/src/FileUtils.cpp +++ b/src/FileUtils.cpp @@ -543,7 +543,7 @@ std::string FileUtils::getcwd() throw (IOException) return std::string(path); #else char path[MAX_PATH]; - if (GetCurrentDirectory(MAX_PATH,path) != 0) + if (GetCurrentDirectory(MAX_PATH,path) == 0) { throw FileUtils::IOException("Failed to get current directory"); }