fixed a crash

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

View file

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