summaryrefslogtreecommitdiffstats
path: root/src/shared/runtime_paths.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-03-04 20:45:14 +0000
committerDavid Robillard <d@drobilla.net>2010-03-04 20:45:14 +0000
commitefca18acf1e17be9932b375347ce95f733c2dc59 (patch)
treed5bf359f287281fe9b2760fd7ec653f3ea5e3451 /src/shared/runtime_paths.cpp
parentf2d901fe0424bafa39b794117c9547e4969017c6 (diff)
downloadingen-efca18acf1e17be9932b375347ce95f733c2dc59.tar.gz
ingen-efca18acf1e17be9932b375347ce95f733c2dc59.tar.bz2
ingen-efca18acf1e17be9932b375347ce95f733c2dc59.zip
Use portable path construction.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2518 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared/runtime_paths.cpp')
-rw-r--r--src/shared/runtime_paths.cpp11
1 files changed, 6 insertions, 5 deletions
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 <limits.h>
#include <stdlib.h>
#include <glibmm/module.h>
+#include <glibmm/miscutils.h>
#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