Index: /trunk/BNC/src/bncrinex.cpp
===================================================================
--- /trunk/BNC/src/bncrinex.cpp	(revision 5529)
+++ /trunk/BNC/src/bncrinex.cpp	(revision 5530)
@@ -330,16 +330,15 @@
   // Append to existing file and return
   // ----------------------------------
-  if ( QFile::exists(_fName) ) {
-    if (_reconnectFlag ||
-        Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
-      _out.open(_fName.data(), ios::app);
-      _out.setf(ios::showpoint | ios::fixed);
-      _headerWritten = true;
-      _reconnectFlag = false;
-      return;
-    }
-  }
-
-  _out.open(_fName.data());
+  if ( QFile::exists(_fName) &&
+       (_reconnectFlag || Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) ) {
+    _out.open(_fName.data(), ios::app);
+    _out.setf(ios::showpoint | ios::fixed);
+    _headerWritten = true;
+    _reconnectFlag = false;
+  }
+  else {
+    _out.open(_fName.data());
+  }
+
   _out.setf(ios::showpoint | ios::fixed);
 
@@ -428,5 +427,8 @@
 
   outHlp.flush();
-  _out << headerLines.data();
+
+  if (!_headerWritten) {
+    _out << headerLines.data();
+  }
 
   _headerWritten = true;
