Make botan’s policy configurable from a file

fix #3244
This commit is contained in:
louiz’
2017-04-30 15:14:54 +02:00
parent 1472adfa77
commit 7b3e0e0cf3
15 changed files with 207 additions and 24 deletions
+16
View File
@@ -0,0 +1,16 @@
#include <utils/dirname.hpp>
namespace utils
{
std::string dirname(const std::string filename)
{
if (filename.empty())
return "./";
if (filename == ".." || filename == ".")
return filename;
auto pos = filename.rfind('/');
if (pos == std::string::npos)
return "./";
return filename.substr(0, pos + 1);
}
}