# # patch "ChangeLog" # from [0d5fa026a495aeb4563f214e9cb19de559c05de6] # to [89970b8b70f83072d56e92c6d1c4d8636ca6d9d5] # # patch "commands.cc" # from [a51fe27426368a95bc8d587c2cc631e3c78ea736] # to [0f5035f5040dd32e3d297d1f4cbb8e76d08f3b52] # ======================================================================== --- ChangeLog 0d5fa026a495aeb4563f214e9cb19de559c05de6 +++ ChangeLog 89970b8b70f83072d56e92c6d1c4d8636ca6d9d5 @@ -1,5 +1,10 @@ 2005-08-25 Benoît Dejean + * commands.cc (safe_gettext): New function. + (explain_usage): Used there to avoid _(""). + +2005-08-25 Benoît Dejean + * sanity.{cc,hh} (sanity::do_format): Merged code from sanity::{log, warning, progress} in order to merge strings. Fixed exception rethrowing. ======================================================================== --- commands.cc a51fe27426368a95bc8d587c2cc631e3c78ea736 +++ commands.cc 0f5035f5040dd32e3d297d1f4cbb8e76d08f3b52 @@ -167,6 +167,14 @@ return cmd; } + const char * safe_gettext(const char * msgid) + { + if (strlen(msgid) == 0) + return msgid; + + return _(msgid); + } + void explain_usage(string const & cmd, ostream & out) { map::const_iterator i; @@ -177,13 +185,13 @@ if (i != cmds.end()) { - string params = _(i->second->params.c_str()); + string params = safe_gettext(i->second->params.c_str()); vector lines; split_into_lines(params, lines); for (vector::const_iterator j = lines.begin(); j != lines.end(); ++j) out << " " << i->second->name << " " << *j << endl; - split_into_lines(_(i->second->desc.c_str()), lines); + split_into_lines(safe_gettext(i->second->desc.c_str()), lines); for (vector::const_iterator j = lines.begin(); j != lines.end(); ++j) out << " " << *j << endl; @@ -214,7 +222,7 @@ { curr_group = idx(sorted, i)->cmdgroup; out << endl; - out << " " << _(idx(sorted, i)->cmdgroup.c_str()); + out << " " << safe_gettext(idx(sorted, i)->cmdgroup.c_str()); col = idx(sorted, i)->cmdgroup.size() + 2; while (col++ < (col2 + 3)) out << ' ';