From 8620b2cc72ddfe68409a02da67ec2fcb497881cd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Aug 2012 13:58:47 -0700 Subject: [PATCH] Use io_utils for resolving real path --- Atom-Linux/atom.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Atom-Linux/atom.cpp b/Atom-Linux/atom.cpp index f88c7edfd..632b627ec 100644 --- a/Atom-Linux/atom.cpp +++ b/Atom-Linux/atom.cpp @@ -3,7 +3,6 @@ // can be found in the LICENSE file. #include -#include #include #include #include @@ -14,6 +13,7 @@ #include "include/cef_runnable.h" #include "client_handler.h" #include "onig_regexp_extension.h" +#include "io_utils.h" char* szWorkingDir; // The current working directory @@ -111,17 +111,12 @@ int main(int argc, char *argv[]) { window_info.SetAsChild(vbox); - std::string path; - path.append(szPath); - path.append("/../index.html"); - char* realPath; - realPath = realpath(path.c_str(), NULL); - if (realPath == NULL) + std::string path = io_utils_real_app_path("/../index.html"); + if (path.empty()) return -1; std::string resolved("file://"); - resolved.append(realPath); - free(realPath); + resolved.append(path); CefBrowser::CreateBrowserSync(window_info, static_cast >(g_handler), resolved, browserSettings);