aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/ninja/Ninja.cpp9
-rw-r--r--src/FileUtil.cpp5
2 files changed, 4 insertions, 10 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index d311110..6b013c4 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -385,16 +385,7 @@ namespace backend
string result;
result.reserve(2048);
- Result<FileString> globalIncDirResult = getHomeDir();
- if (!globalIncDirResult)
- return Result<bool>::Err(globalIncDirResult);
-
- FileString globalIncDir = globalIncDirResult.unwrap();
- globalIncDir += TINYDIR_STRING("/.sibs/lib");
- string globalIncDirUtf8 = toUtf8(globalIncDir);
-
result += "globalIncDir = ";
- result += getIncludeOptionFlag(config.getCompiler(), globalIncDirUtf8);
for(const auto &includeDir : config.getIncludeDirs())
{
diff --git a/src/FileUtil.cpp b/src/FileUtil.cpp
index 7541a61..5ac2641 100644
--- a/src/FileUtil.cpp
+++ b/src/FileUtil.cpp
@@ -358,8 +358,11 @@ namespace sibs
return Result<FileString>::Err("Failed to open process token");
if (!GetUserProfileDirectory(hToken, &homeDir[0], &homeDirLen))
+ {
+ CloseHandle(hToken);
return Result<FileString>::Err("Failed to get home directory");
-
+ }
+
CloseHandle(hToken);
homeDir.resize(_tinydir_strlen(homeDir.c_str()));
return Result<FileString>::Ok(homeDir);