From e5e44c6174c7b33aa9ae2f5b5ca45af40b37ec72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 11 Mar 2011 14:17:34 +0200 Subject: Suppress empty lines --- odb/emitter.cxx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/odb/emitter.cxx b/odb/emitter.cxx index 2989ffb..42b88b3 100644 --- a/odb/emitter.cxx +++ b/odb/emitter.cxx @@ -31,21 +31,24 @@ sync () s.resize (n - 1); } - // Temporary restore output diversion. - // - bool r (false); - context& ctx (context::current ()); - - if (ctx.os.rdbuf () == this) + if (!s.empty ()) { - ctx.restore (); - r = true; - } + // Temporary restore output diversion. + // + bool r (false); + context& ctx (context::current ()); - e_.line (s); + if (ctx.os.rdbuf () == this) + { + ctx.restore (); + r = true; + } - if (r) - ctx.diverge (this); + e_.line (s); + + if (r) + ctx.diverge (this); + } str (string ()); return 0; -- cgit v1.1