1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
This commit is contained in:
Michael 2023-08-11 20:09:41 +02:00 committed by GitHub
parent 2d9bb34825
commit 6ca5518ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,8 +374,13 @@ auto SelectionTab::checkSubfolder(std::string path)
filetree.erase(filetree.begin());
std::string pathWithoutPrefix = boost::algorithm::join(filetree, "/");
filetree.pop_back();
ret.baseFolder = boost::algorithm::join(filetree, "/");
if(!filetree.empty())
{
filetree.pop_back();
ret.baseFolder = boost::algorithm::join(filetree, "/");
}
else
ret.baseFolder = "";
if(boost::algorithm::starts_with(ret.baseFolder, curFolder))
{
@ -613,8 +618,6 @@ int SelectionTab::getLine(const Point & clickPos) const
void SelectionTab::selectFileName(std::string fname)
{
boost::to_upper(fname);
auto [folderName, baseFolder, parentExists, fileInFolder] = checkSubfolder(fname);
curFolder = baseFolder != "" ? baseFolder + "/" : "";