Disallow filenames with trailing periods

This commit is contained in:
Alexander van Gessel 2017-10-02 21:26:28 +02:00
parent 02907ebe75
commit b3f8a5a7c0

View file

@ -59,7 +59,7 @@ bool addon_name_legal(const std::string& name)
bool addon_filename_legal(const std::string& name)
{
if(name.empty() || name == "." ||
if(name.empty() || name.back() == '.' ||
name.find_first_of("/:\\~ \r\n\v\t") != std::string::npos ||
name.find("..") != std::string::npos) {
return false;