# # patch "commands.cc" # from [23c6d804719fb4b56aa09287320f4cf7cc1a5150] # to [12f20a9dce89088ee2089c495cd56a0adde51af7] # # patch "ui.cc" # from [359384e05f3ce77726285d606854eb967c3f0ff5] # to [403dbf11aebf69618ecbaf53dbb87695a78cb940] # ======================================================================== --- commands.cc 23c6d804719fb4b56aa09287320f4cf7cc1a5150 +++ commands.cc 12f20a9dce89088ee2089c495cd56a0adde51af7 @@ -167,8 +167,6 @@ return cmd; } - // this writes utf-8 to its ostream; if the caller doesn't like that, they - // get to fix it. void explain_usage(string const & cmd, ostream & out) { map::const_iterator i; @@ -566,7 +564,7 @@ string washed; if (guess_binary(tv())) { - washed = _(""); + washed = ""; } else { ======================================================================== --- ui.cc 359384e05f3ce77726285d606854eb967c3f0ff5 +++ ui.cc 403dbf11aebf69618ecbaf53dbb87695a78cb940 @@ -167,7 +167,7 @@ // bytes, not by characters) tickline1.resize(tw); } - clog << outprep(tickline1) << outprep("\n"); + clog << tickline1 << "\n"; } if (tw && length(utf8(tickline2)) > tw) { @@ -177,13 +177,13 @@ // bytes, not by characters) tickline2.resize(tw + 1); } - clog << outprep(tickline2); + clog << tickline2; clog.flush(); } void tick_write_count::clear_line() { - clog << outprep("\n"); + clog << endl; } @@ -248,13 +248,13 @@ } } - clog << outprep(tickline1) << outprep(tickline2); + clog << tickline1 << tickline2; clog.flush(); } void tick_write_dot::clear_line() { - clog << outprep("\n"); + clog << endl; } @@ -327,21 +327,13 @@ % fatal % PACKAGE_BUGREPORT); } -void -user_interface::ensure_clean_line() -{ - if (last_write_was_a_tick) - { - write_ticks(); - t_writer->clear_line(); - } - last_write_was_a_tick = false; -} static inline string sanitize(string const & line) { - // UTF-8 does not have safe values in the sub-0x20 range. + // FIXME: you might want to adjust this if you're using a charset + // which has safe values in the sub-0x20 range. ASCII, UTF-8, + // and most ISO8859-x sets do not. string tmp; tmp.reserve(line.size()); for (size_t i = 0; i < line.size(); ++i) @@ -356,13 +348,24 @@ return tmp; } +void +user_interface::ensure_clean_line() +{ + if (last_write_was_a_tick) + { + write_ticks(); + t_writer->clear_line(); + } + last_write_was_a_tick = false; +} + void user_interface::inform(string const & line) { string prefixedLine; prefix_lines_with(_("monotone: "), line, prefixedLine); ensure_clean_line(); - clog << outprep(sanitize(prefixedLine)) << endl; + clog << sanitize(prefixedLine) << endl; clog.flush(); }