mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Strip trailing whitespace from textkeys
This commit is contained in:
parent
0db02af807
commit
8e24cab935
@ -688,6 +688,21 @@ class NIFObjectLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string::size_type nextpos = std::min(str.find('\r', pos), str.find('\n', pos));
|
std::string::size_type nextpos = std::min(str.find('\r', pos), str.find('\n', pos));
|
||||||
|
if(nextpos != std::string::npos)
|
||||||
|
{
|
||||||
|
do {
|
||||||
|
nextpos--;
|
||||||
|
} while(nextpos > pos && ::isspace(str[nextpos]));
|
||||||
|
nextpos++;
|
||||||
|
}
|
||||||
|
else if(::isspace(*str.rbegin()))
|
||||||
|
{
|
||||||
|
std::string::const_iterator last = str.end();
|
||||||
|
do {
|
||||||
|
last--;
|
||||||
|
} while(last != str.begin() && ::isspace(*last));
|
||||||
|
nextpos = std::distance(str.begin(), ++last);
|
||||||
|
}
|
||||||
std::string result = str.substr(pos, nextpos-pos);
|
std::string result = str.substr(pos, nextpos-pos);
|
||||||
textkeys.insert(std::make_pair(tk->list[i].time, Misc::StringUtils::toLower(result)));
|
textkeys.insert(std::make_pair(tk->list[i].time, Misc::StringUtils::toLower(result)));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user