We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00071c1 commit fa8642bCopy full SHA for fa8642b
kernel/gzip.cc
@@ -62,8 +62,13 @@ std::istream::int_type gzip_istream::ibuf::underflow() {
62
log_assert(gzf && "No gzfile opened\n");
63
int bytes_read = Zlib::gzread(gzf, buffer, buffer_size);
64
if (bytes_read <= 0) {
65
- if (Zlib::gzeof(gzf))
+ if (Zlib::gzeof(gzf)) {
66
+ // "On failure, the function ensures that either
67
+ // gptr() == nullptr or gptr() == egptr."
68
+ // Let's set gptr to egptr
69
+ setg(eback(), egptr(), egptr());
70
return traits_type::eof();
71
+ }
72
73
int err;
74
const char* error_msg = Zlib::gzerror(gzf, &err);
0 commit comments