browser: if current dir doesn't exists, go down one level automatically

This commit is contained in:
Andrzej Rybczak
2010-08-10 00:11:44 +02:00
parent a93096fbda
commit 7c75be82bd
4 changed files with 18 additions and 0 deletions

View File

@@ -372,6 +372,12 @@ std::string ExtractTopName(const std::string &s)
return slash != std::string::npos ? s.substr(++slash) : s;
}
std::string PathGoDownOneLevel(const std::string &path)
{
size_t i = path.rfind('/');
return i == std::string::npos ? "/" : path.substr(0, i);
}
std::basic_string<my_char_t> Scroller(const std::basic_string<my_char_t> &str, size_t &pos, size_t width)
{
std::basic_string<my_char_t> s(str);