fixed a crash

This commit is contained in:
gugus 2012-03-17 16:56:22 +01:00
parent 5b08baf5bf
commit 846196d048

View file

@ -145,13 +145,20 @@ void addColorInString(std::string& str, const std::string& keyword,std::string c
str.insert(pos,color2);
pos+= color2.length();
}
else if(str.substr(pos -1,1) == " ")
else
{
str.insert(pos,color1);
pos += color1.length();
pos += keyword.length();
str.insert(pos,color2);
pos+= color2.length();
if(str.substr(pos -1,1) == " ")
{
str.insert(pos,color1);
pos += color1.length();
pos += keyword.length();
str.insert(pos,color2);
pos+= color2.length();
}
else
{
pos += keyword.length();
}
}
}
}