From b5e76f005690e1c94245af430bdfae8dd4a8915f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 29 Mar 2012 16:28:53 -0500 Subject: Fix to commodity printing --- src/annotate.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/annotate.h') diff --git a/src/annotate.h b/src/annotate.h index 878d6148..37ee0685 100644 --- a/src/annotate.h +++ b/src/annotate.h @@ -265,9 +265,14 @@ public: virtual void print(std::ostream& out, bool elide_quotes = false, bool print_annotations = false) const { - commodity_t::print(out, elide_quotes); - if (print_annotations) - write_annotations(out); + if (print_annotations) { + std::ostringstream buf; + commodity_t::print(buf, elide_quotes); + write_annotations(buf); + out << buf.str(); + } else { + commodity_t::print(out, elide_quotes); + } } virtual void write_annotations(std::ostream& out, -- cgit v1.2.3