summaryrefslogtreecommitdiffstats
path: root/src/binary_location.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary_location.h')
-rw-r--r--src/binary_location.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/binary_location.h b/src/binary_location.h
index 91e8b29..303a3bd 100644
--- a/src/binary_location.h
+++ b/src/binary_location.h
@@ -41,3 +41,14 @@ binary_location()
}
return loc;
}
+
+/** Return the absolute path of the bundle (binary parent directory). */
+static std::string
+bundle_location()
+{
+ const std::string binary = binary_location();
+ if (binary.empty()) {
+ return "";
+ }
+ return binary.substr(0, binary.find_last_of('/'));
+}