tools/errmsg: code correction
This commit is contained in:
parent
934b251ec6
commit
a62d3da857
|
@ -19,8 +19,9 @@ public:
|
|||
static const unsigned int ALL = 1;
|
||||
static const unsigned int STYLE = 2;
|
||||
|
||||
std::string msg(const char str[]) const
|
||||
std::string msg(bool code) const
|
||||
{
|
||||
const char *str = code ? "\"" : "";
|
||||
std::string ret( str + _msg + str );
|
||||
if (! _par1.empty())
|
||||
{
|
||||
|
@ -28,7 +29,10 @@ public:
|
|||
while ((pos = ret.find("%1", pos)) != std::string::npos)
|
||||
{
|
||||
ret.erase(pos, 2);
|
||||
ret.insert(pos, str + _par1 + str);
|
||||
if ( code )
|
||||
ret.insert(pos, "\" + " + _par1 + " + \"");
|
||||
else
|
||||
ret.insert(pos, _par1);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue