From ae7dc3c576a0b44ed8eed7ace23b8ebedee3fdf2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 1 Sep 2015 13:51:57 +0100 Subject: [PATCH] Simplify runtime_directory --- src/main.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main.cc b/src/main.cc index 9d58d84c..397a057a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -34,11 +34,7 @@ using namespace Kakoune; String runtime_directory() { - String bin_path = get_kak_binary_path(); - auto it = find(reversed(bin_path), '/'); - if (it == bin_path.rend()) - throw runtime_error("unable to determine runtime directory"); - return StringView{bin_path.begin(), it.base()-1} + "/../share/kak"; + return split_path(get_kak_binary_path()).first + "../share/kak"; } static void write(int fd, StringView str)