Skip to content
Snippets Groups Projects
Commit 7db0ff5f authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

Put in a fix in skip_alpha to allow it to cope with eof conditions and hence...

Put in a fix in skip_alpha to allow it to cope with eof conditions and hence read one line files correctly
parent 1bc800f6
No related branches found
No related tags found
No related merge requests found
......@@ -71,13 +71,14 @@ namespace MISCMATHS {
{
string cline;
while (!fs.eof()) {
streampos curpos = fs.tellg();
getline(fs,cline);
cline += " "; // force extra entry in parsing
istringstream ss(cline.c_str());
string cc="";
ss >> cc;
if (isnum(cc)) {
fs.seekg(-((int)cline.size()),ios::cur);
if (!fs.eof()) { fs.seekg(curpos); } else { fs.clear(); fs.seekg(0,ios::beg); }
return cline;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment