From 52cd08915de39ac520c246ec76d0814bed2be68d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 13 Mar 2015 13:09:54 +0000 Subject: [PATCH] Keep the dir trailing slash in split_path --- src/file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.cc b/src/file.cc index 268cd47d..a3cc8bbb 100644 --- a/src/file.cc +++ b/src/file.cc @@ -60,7 +60,7 @@ std::pair split_path(StringView path) if (it == path.rend()) return { {}, path }; const char* slash = it.base()-1; - return { {path.begin(), slash}, {slash+1, path.end()} }; + return { {path.begin(), slash+1}, {slash+1, path.end()} }; } String real_path(StringView filename) @@ -278,7 +278,7 @@ String find_file(StringView filename, ConstArrayView paths) template Vector list_files(StringView prefix, StringView dirname, - Filter filter) + Filter filter) { kak_assert(dirname.empty() or dirname.back() == '/'); DIR* dir = opendir(dirname.empty() ? "./" : dirname.zstr());