Fix checking for non-empty string in prefix check

This commit is contained in:
Patrick Niklaus
2018-03-29 16:10:26 +00:00
committed by Patrick Niklaus
parent 5a68f4c214
commit 39effb8f7e
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ namespace detail
inline std::string trimName(const std::string &name_prefix, const std::string &name)
{
// list directory and
if (name_prefix.back() == '/')
if (!name_prefix.empty() && name_prefix.back() == '/')
{
auto directory_position = name.find_first_of("/", name_prefix.length());
// this is a "file" in the directory of name_prefix