Browse Source

Mostly complete fix for http://bugs.vcmi.eu/view.php?id=2429

AlexVinS 9 years ago
parent
commit
49e2bde3c0
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lib/filesystem/ResourceID.cpp

+ 6 - 1
lib/filesystem/ResourceID.cpp

@@ -38,7 +38,12 @@ static inline std::string readName(std::string name)
 {
 	const auto dotPos = name.find_last_of('.');
 
-	if (dotPos != std::string::npos)
+	//do not cut "extension" of directory name
+	auto delimPos = name.find_last_of('/');
+	if(delimPos == std::string::npos)
+		delimPos = name.find_last_of('\\');
+
+	if((delimPos == std::string::npos || delimPos < dotPos) && dotPos != std::string::npos)
 		name.resize(dotPos);
 
 	toUpper(name);