Skip to content

Commit fe4aa54

Browse files
committed
Fall back to old input reading when using stdin
The seekg/tellg was not working for me with stdin and reporting "error reading testdata".
1 parent 7e6134c commit fe4aa54

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

libchecktestdata.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ void readtestdata(istream &in)
164164
data = databuffer(std::move(buffer));
165165
return;
166166
}
167+
} else {
168+
in.clear();
169+
stringstream ss;
170+
ss << in.rdbuf();
171+
if (!in.fail()) {
172+
data = databuffer(ss.str());
173+
return;
174+
}
167175
}
168176

169177
cerr << "error reading testdata" << endl;

0 commit comments

Comments
 (0)