From 9647d459c7ecf1750ffe7c9c7f27c0b3c5f1cb41 Mon Sep 17 00:00:00 2001
From: Mark Jenkinson <mark@fmrib.ox.ac.uk>
Date: Tue, 1 Jul 2003 13:55:58 +0000
Subject: [PATCH] Tried to fix problem of reading a single line with no CR

---
 miscmaths.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/miscmaths.cc b/miscmaths.cc
index 82021f7..dc27aec 100644
--- a/miscmaths.cc
+++ b/miscmaths.cc
@@ -143,7 +143,10 @@ namespace MISCMATHS {
     cmax--;
     RowVector newrow(cmax);
 
-    while (!fs.eof()) {
+    cerr << "FOUND " << cmax << " COLUMNS!" << endl; // MJTEST
+
+     do {
+      cerr << "READING LINE" << endl;  // MJTEST
       getline(fs,cline);
       cline += " "; // force extra entry in parsing
       istrstream ss(cline.c_str());
@@ -161,7 +164,7 @@ namespace MISCMATHS {
   
       if (rcount>1) mat = mat & newrow;
       else mat = newrow;
-    }
+     } while (!fs.eof());
     
     mat.Release();
     return mat;
-- 
GitLab