Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65420 - trunk/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2010-09-14 16:46:33


Author: danieljames
Date: 2010-09-14 16:46:31 EDT (Tue, 14 Sep 2010)
New Revision: 65420
URL: http://svn.boost.org/trac/boost/changeset/65420

Log:
Only create output file after a successful parse.
Text files modified:
   trunk/tools/quickbook/src/quickbook.cpp | 22 +++++++++++-----------
   1 files changed, 11 insertions(+), 11 deletions(-)

Modified: trunk/tools/quickbook/src/quickbook.cpp
==============================================================================
--- trunk/tools/quickbook/src/quickbook.cpp (original)
+++ trunk/tools/quickbook/src/quickbook.cpp 2010-09-14 16:46:31 EDT (Tue, 14 Sep 2010)
@@ -136,24 +136,24 @@
       , bool pretty_print)
     {
         int result = 0;
- std::ofstream fileout(fileout_);
         fs::path outdir = fs::path(fileout_).parent_path();
         if (outdir.empty())
             outdir = ".";
- if (pretty_print)
+ string_stream buffer;
+ result = parse_document(filein_, outdir, buffer);
+
+ if (result == 0)
         {
- string_stream buffer;
- result = parse_document(filein_, outdir, buffer);
- if (result == 0)
+ std::ofstream fileout(fileout_);
+
+ if (pretty_print)
             {
                 result = post_process(buffer.str(), fileout, indent, linewidth);
             }
- }
- else
- {
- string_stream buffer;
- result = parse_document(filein_, outdir, buffer);
- fileout << buffer.str();
+ else
+ {
+ fileout << buffer.str();
+ }
         }
         return result;
     }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk