Opened 12 years ago

Closed 12 years ago

#4554 closed Bugs (invalid)

[MSVC] gzip_decompressor in filtering_istream returns empty strings | doesn't indicate EOF correctly

Reported by: ulidtko@… Owned by:
Milestone: To Be Determined Component: iostreams
Version: Boost 1.44.0 Severity: Problem
Keywords: MSVC, filtering_istream, gzip Cc:

Description

The attached is a classical zcat example. It constructs a filtering_istream out of std::cin and gzip_decompressor(), and clones its contents to std::cout. Being built with GCC on unices, this works flawlessly. Being build with MSVC 10, this fails on the attached files.

With the first file, 1.gz, the example enters infinite loop, continuously printing empty lines on stdout; getline() returns empty strings.

With the second file, 2.gz, the example successfully dumps decompressed content, but in the end of the stream enters infinite loop again, this time for the reason of stream_in.eof() always returning false.

Attachments (1)

test.cpp (462 bytes ) - added by ulidtko@… 12 years ago.
classical zcat example

Download all attachments as: .zip

Change History (2)

by ulidtko@…, 12 years ago

Attachment: test.cpp added

classical zcat example

comment:1 by ulidtko@…, 12 years ago

Component: Noneiostreams
Resolution: invalid
Status: newclosed

I'm apologizing for inconvenience. The issue was not a Boost bug, rather an attempt to read a gzipped file in windows text mode. The solution is to use std::ios_base::binary flag.

Note: See TracTickets for help on using tickets.