From d9356b1ee59470c2d9c24732e348f3b623e89e71 Mon Sep 17 00:00:00 2001 From: Senthil Date: Tue, 29 Dec 2015 17:04:22 -0800 Subject: [PATCH] Fix bug as getenv returns true on empty env var --- src/corehost/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corehost/src/main.cpp b/src/corehost/src/main.cpp index a1afc3edf..ae586eb13 100644 --- a/src/corehost/src/main.cpp +++ b/src/corehost/src/main.cpp @@ -115,7 +115,7 @@ int run(const arguments_t& args, const pal::string_t& clr_path) // Workaround for dotnet/cli Issue #488 and #652 pal::string_t server_gc; - std::string server_gc_cstr = (pal::getenv(_X("COREHOST_SERVER_GC"), &server_gc)) ? pal::to_stdstring(server_gc) : "1"; + std::string server_gc_cstr = (pal::getenv(_X("COREHOST_SERVER_GC"), &server_gc) && !server_gc.empty()) ? pal::to_stdstring(server_gc) : "1"; const char* property_values[] = { // TRUSTED_PLATFORM_ASSEMBLIES