Skip to content

Commit

Permalink
When figuring out the folder name for the "Move to subfolder" command…
Browse files Browse the repository at this point in the history
…, ignore case. And also trim the right of special chars and whitespaces.
  • Loading branch information
stefankueng committed Jul 24, 2018
1 parent 65d93a5 commit aec8b08
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions StExBar/src/SRBand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1677,6 +1677,8 @@ void CDeskBand::MoveToSubfolder(HWND hWnd, std::wstring cwd, const std::map<std:
{
if (foldername[i] == name[i])
neqpos = i;
else if (::towlower(foldername[i]) == ::towlower(name[i]))
neqpos = i;
else
break;
}
Expand All @@ -1689,6 +1691,11 @@ void CDeskBand::MoveToSubfolder(HWND hWnd, std::wstring cwd, const std::map<std:
}
}
}
foldername.erase(std::find_if(foldername.rbegin(), foldername.rend(), [](int ch)
{
return ch != '\n' || ch != '\r' || ch != ' ' || ch != '\t' || ch != '-' || ch != '_' || ch != '.' || ch != ';';
}).base(), foldername.end());

if (foldername.empty())
foldername = L"folder";

Expand Down

0 comments on commit aec8b08

Please sign in to comment.