- Properly skips all escape sequences if no fg and bg colors are specified.

This commit is contained in:
Paul Beckingham 2008-06-24 01:21:40 -04:00
parent 994f98b57a
commit 0034534803

View file

@ -242,7 +242,10 @@ std::string decode (color c)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
std::string colorize (color fg, color bg, const std::string& input) std::string colorize (color fg, color bg, const std::string& input)
{ {
return decode (fg) + decode (bg) + input + decode (off); if (fg != nocolor || bg != nocolor)
return decode (fg) + decode (bg) + input + decode (off);
return input;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////