From c3aebf04d6561c2f8db950129c6dd6cc6afc68de Mon Sep 17 00:00:00 2001 From: nemu Date: Fri, 16 Oct 2009 07:04:16 +0000 Subject: [PATCH] fixed 'unwanted empty line problem of mlog-files' see MUSR-95 --- src/classes/PMsrHandler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 4fe455fc..de19c0bf 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -876,7 +876,11 @@ int PMsrHandler::WriteMsrLogFile(const bool messages) cout << endl << "*** FIT DID NOT CONVERGE ***" << endl; } } else { - fout << str.Data() << endl; + if (str.Length() > 0) + fout << str.Data() << endl; + else // only write endl if not eof is reached. This is preventing growing msr-files, i.e. more and more empty lines at the end of the file + if (!fin.eof()) + fout << endl; } break; default: