From f60b3e30907c33a478827ccbc8c1328e6f2d630a Mon Sep 17 00:00:00 2001 From: NotFound Date: Wed, 14 Mar 2012 23:36:34 +0100 Subject: Version 0.10.3 - fix bug in save --- NEWS | 8 ++++++++ program.cpp | 7 ++++--- runner.cpp | 4 ++-- version.cpp | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 5bfc64c..4ae931a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +Version 0.10.3 + + Fix save silently failing if the file can't be open. + +Version 0.10.2 + + Minor fixes. + Version 0.10.1 Added msx option and charset. diff --git a/program.cpp b/program.cpp index 2d24c29..b6f0497 100644 --- a/program.cpp +++ b/program.cpp @@ -1,5 +1,5 @@ // program.cpp -// Revision 24-apr-2009 +// Revision 14-mar-2012 #include "program.h" @@ -1211,10 +1211,10 @@ void ProgramImpl::save (const std::string & name) const TRACEFUNC (tr, "ProgramImpl::save"); std::ofstream os (name.c_str (), std::ios::binary | std::ios::out); + if (! os.is_open()) + throw ErrFileWrite; // Blassic signature. - if (! os) - return; os.write (signature, lsig); // Endian mark. @@ -1228,6 +1228,7 @@ void ProgramImpl::save (const std::string & name) const // Program body. os.write ( (char *) program, size); + os.close(); if (! os) throw ErrFileWrite; } diff --git a/runner.cpp b/runner.cpp index 546b660..bbabad9 100644 --- a/runner.cpp +++ b/runner.cpp @@ -1,5 +1,5 @@ // runner.cpp -// Revision 24-apr-2009 +// Revision 14-mar-2012 #include "runner.h" @@ -2043,7 +2043,7 @@ void welcome (BlFile & f) version::Minor << '.' << version::Release; f.endline (); - f << "(C) 2001-2009 Julian Albo"; + f << "(C) 2001-2012 Julian Albo"; f.endline (); f.endline (); } diff --git a/version.cpp b/version.cpp index c41f295..33bdad8 100644 --- a/version.cpp +++ b/version.cpp @@ -8,6 +8,6 @@ const unsigned short version::Major= 0, version::Minor= 10, - version::Release= 2; + version::Release= 3; // End of version.cpp -- cgit v1.2.3