From efca18acf1e17be9932b375347ce95f733c2dc59 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 4 Mar 2010 20:45:14 +0000 Subject: Use portable path construction. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2518 a436a847-0d15-0410-975c-d299462d15a1 --- src/shared/runtime_paths.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/shared') diff --git a/src/shared/runtime_paths.cpp b/src/shared/runtime_paths.cpp index fe1923b7..f823c4e2 100644 --- a/src/shared/runtime_paths.cpp +++ b/src/shared/runtime_paths.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include "ingen-config.h" #include "runtime_paths.hpp" @@ -45,8 +46,8 @@ set_bundle_path_from_code(void* function) #ifdef BUNDLE string bundle = bin_loc; - bundle = bundle.substr(0, bundle.find_last_of("/")); - bundle_path = bundle;; + bundle = bundle.substr(0, bundle.find_last_of(G_DIR_SEPARATOR)); + bundle_path = bundle; #endif } @@ -58,9 +59,9 @@ data_file_path(const std::string& name) { std::string ret; #ifdef BUNDLE - ret = bundle_path + "/" + INGEN_DATA_DIR + "/" + name; + ret = Glib::build_filename(bundle_path, Glib::build_path(INGEN_DATA_DIR, name)); #else - ret = std::string(INGEN_DATA_DIR) + "/" + name; + ret = Glib::build_filename(INGEN_DATA_DIR, name); #endif return ret; } @@ -73,7 +74,7 @@ module_path(const std::string& name) { std::string ret; #ifdef BUNDLE - ret = Glib::Module::build_path(bundle_path + "/" + INGEN_MODULE_DIR, name); + ret = Glib::Module::build_path(Glib::build_path(bundle_path, INGEN_MODULE_DIR), name); #else ret = Glib::Module::build_path(INGEN_MODULE_DIR, name); #endif -- cgit v1.2.1