Skip to content

Commit 76fc628

Browse files
committed
Use FILE_PATH_LITERAL instead of AppendASCII
1 parent 54ab674 commit 76fc628

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

atom/common/node_bindings.cc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,29 +147,31 @@ void NodeBindings::Initialize() {
147147

148148
node::Environment* NodeBindings::CreateEnvironment(
149149
v8::Handle<v8::Context> context) {
150+
CommandLine* command_line = CommandLine::ForCurrentProcess();
150151
std::vector<std::string> args =
151152
#if defined(OS_WIN)
152-
String16VectorToStringVector(CommandLine::ForCurrentProcess()->argv());
153+
String16VectorToStringVector(command_line->argv());
153154
#else
154-
CommandLine::ForCurrentProcess()->argv();
155+
command_line->argv();
155156
#endif
156157

157158
// Feed node the path to initialization script.
158-
base::FilePath exec_path(CommandLine::ForCurrentProcess()->argv()[0]);
159+
base::FilePath exec_path(command_line->argv()[0]);
159160
PathService::Get(base::FILE_EXE, &exec_path);
160161
base::FilePath resources_path =
161162
#if defined(OS_MACOSX)
162163
is_browser_ ? exec_path.DirName().DirName().Append("Resources") :
163164
exec_path.DirName().DirName().DirName().DirName().DirName()
164165
.Append("Resources");
165166
#else
166-
exec_path.DirName().AppendASCII("resources");
167+
exec_path.DirName().Append(FILE_PATH_LITERAL("resources"));
167168
#endif
168169
base::FilePath script_path =
169-
resources_path.AppendASCII("atom")
170-
.AppendASCII(is_browser_ ? "browser" : "renderer")
171-
.AppendASCII("lib")
172-
.AppendASCII("init.js");
170+
resources_path.Append(FILE_PATH_LITERAL("atom"))
171+
.Append(is_browser_ ? FILE_PATH_LITERAL("browser") :
172+
FILE_PATH_LITERAL("renderer"))
173+
.Append(FILE_PATH_LITERAL("lib"))
174+
.Append(FILE_PATH_LITERAL("init.js"));
173175
std::string script_path_str = script_path.AsUTF8Unsafe();
174176
args.insert(args.begin() + 1, script_path_str.c_str());
175177

0 commit comments

Comments
 (0)