[ruby-core:95987] [Ruby master Bug#9790] Zlib::GzipReader only decompressed the first of concatenated files

[email protected]
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.journal-82820.20191127153839.08c8c5450bbd8cde@ruby-lang.org>
Issue #9790 has been updated by jeremyevans0 (Jeremy Evans).

File zlib-gzreader-each_file-9790.patch added

Attached is a patch that adds `Zlib::GzipReader.each_file` will which handle multiple concatenated gzip streams in the same file, similar to common tools that operate on `.gz` files.  `Zlib::GzipReader.each_file` yields one `Zlib::GzipReader` instance per gzip stream in the file.

----------------------------------------
Bug #9790: Zlib::GzipReader only decompressed the first of concatenated files
https://bugs.ruby-lang.org/issues/9790#change-82820

* Author: quainjn (Jake Quain)
* Status: Assigned
* Priority: Normal
* Assignee: drbrain (Eric Hodel)
* Target version: 
* ruby -v: 2.1.1
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
There is a similar old issue in Node that I came across that perfectly describes the situation in ruby:

https://github.com/joyent/node/issues/6032

In ruby given the following setup:

```
echo "1" > 1.txt
echo "2" > 2.txt
gzip 1.txt
gzip 2.txt
cat 1.txt.gz 2.txt.gz > 3.txt.gz
```

Calling:
    
```
Zlib::GzipReader.open("3.txt.gz") do |gz|
  print gz.read
end
```

would just print:

```
1
```


---Files--------------------------------
zlib-gzreader-each_file-9790.patch (3.47 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.