Because std::istream::operator bool() returns false AFTER FAILING get(),
the function importOptions read the final character TWICE.
Giving empty file for --options=... told me this error.
In this commit, std::istream::peek() is used instead. This member
function returns the next character without proceeding the file pointer,
which you can compare to EOF without any side-effects.
Because
std::istream::operator bool()
returns false AFTER FAILINGget()
, the functionimportOptions
read the final character TWICE. Giving empty file for--options=...
told me this error.In this commit,
std::istream::peek()
is used instead. This member function returns the next character without proceeding the file pointer, which you can compare to EOF without any side-effects.