mirror of https://github.com/YosysHQ/yosys.git
gzip: uphold rules for basic_streambuf::underflow overrides
This commit is contained in:
parent
00071c1cd1
commit
fa8642be02
|
@ -62,8 +62,13 @@ std::istream::int_type gzip_istream::ibuf::underflow() {
|
|||
log_assert(gzf && "No gzfile opened\n");
|
||||
int bytes_read = Zlib::gzread(gzf, buffer, buffer_size);
|
||||
if (bytes_read <= 0) {
|
||||
if (Zlib::gzeof(gzf))
|
||||
if (Zlib::gzeof(gzf)) {
|
||||
// "On failure, the function ensures that either
|
||||
// gptr() == nullptr or gptr() == egptr."
|
||||
// Let's set gptr to egptr
|
||||
setg(eback(), egptr(), egptr());
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
int err;
|
||||
const char* error_msg = Zlib::gzerror(gzf, &err);
|
||||
|
|
Loading…
Reference in New Issue