Fixed getCleanName(path).

This commit is contained in:
Aloshi 2014-05-14 19:06:40 -05:00
parent 91561480b3
commit f32e8fff5a

View file

@ -20,11 +20,12 @@ std::string getCleanFileName(const fs::path& path)
done = true; done = true;
for(int i = 0; i < NUM_TO_REPLACE; i++) for(int i = 0; i < NUM_TO_REPLACE; i++)
{ {
start = ret.find(toReplace[i*2]); end = ret.find_first_of(toReplace[i*2+1]);
end = ret.find(toReplace[i*2+1], start != std::string::npos ? start + 1 : 0); start = ret.find_last_of(toReplace[i*2], end);
if(start != std::string::npos && end != std::string::npos) if(start != std::string::npos && end != std::string::npos)
{ {
ret.replace(start, end, ""); ret.erase(start, end - start + 1);
done = false; done = false;
} }
} }