From 256215b7498cdc6c2fabaa1a70079681841ebe71 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 5 Sep 2013 12:18:19 +0800 Subject: [PATCH] Use base::Environment to replace getenv. --- app/atom_main.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/atom_main.cc b/app/atom_main.cc index 0dfeb386..b2f4c7cd 100644 --- a/app/atom_main.cc +++ b/app/atom_main.cc @@ -17,14 +17,18 @@ int Start(int argc, char *argv[]); #include // NOLINT #include "app/atom_main_delegate.h" +#include "base/environment.h" #include "content/public/app/startup_helper_win.h" #include "sandbox/win/src/sandbox_types.h" int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { int argc = 0; wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - char* node_indicator = getenv("ATOM_SHELL_INTERNAL_RUN_AS_NODE"); - if (node_indicator != NULL && strcmp(node_indicator, "1") == 0) + + scoped_ptr env(base::Environment::Create()); + std::string node_indicator; + if (env->GetVar("ATOM_SHELL_INTERNAL_RUN_AS_NODE", &node_indicator) && + node_indicator == "1") { // Convert argv to to UTF8 char** argv = new char*[argc]; for (int i = 0; i < argc; i++) { -- 2.43.0