From 3ea77cacbbba4108aad51df2ce182f292ec9e179 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Wed, 14 Oct 2015 13:32:27 +0200 Subject: [PATCH] Revert "remove unused function" This reverts commit cb3755d7a4ea4bcbec81c6a350e9ef610eefa18a. Conflicts: config/depgen.cpp --- config/depgen.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/depgen.cpp b/config/depgen.cpp index e64a956ea..3f0ea5234 100644 --- a/config/depgen.cpp +++ b/config/depgen.cpp @@ -25,6 +25,15 @@ #include #include +/// returns directory from file name +std::string directory(const std::string& file_name) +{ + const std::size_t pos = file_name.find_last_of("/\\"); + if (pos == std::string::npos) + return "."; + return file_name.substr(0,pos); +} + /// checks if given file exists bool file_exists(const std::string& name) {