forked from mirror/openmw-tes3mp
Strip trailing whitespace from textkeys
This commit is contained in:
parent
0db02af807
commit
8e24cab935
1 changed files with 15 additions and 0 deletions
|
@ -688,6 +688,21 @@ class NIFObjectLoader
|
|||
}
|
||||
|
||||
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);
|
||||
textkeys.insert(std::make_pair(tk->list[i].time, Misc::StringUtils::toLower(result)));
|
||||
|
||||
|
|
Loading…
Reference in a new issue