Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-11-15 16:00:15 +0400
committerKenneth Heafield <github@kheafield.com>2012-11-15 16:00:15 +0400
commitd653d45abc182e71c25a5b6545db0abf2312631f (patch)
treec7728519617ac7ea84a7216d7a9101caf66b63ab /util/read_compressed.cc
parent5e3726eb90d68599fbe145211630b04cef1a1322 (diff)
KenLM 85e5fe4: mostly fixes for cygwin/windows
Diffstat (limited to 'util/read_compressed.cc')
-rw-r--r--util/read_compressed.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/read_compressed.cc b/util/read_compressed.cc
index cfb94d3a5..4ec94c4e1 100644
--- a/util/read_compressed.cc
+++ b/util/read_compressed.cc
@@ -343,6 +343,8 @@ ReadBase *ReadFactory(int fd, uint64_t &raw_amount) {
scoped_fd hold(fd);
unsigned char header[ReadCompressed::kMagicSize];
raw_amount = ReadOrEOF(fd, header, ReadCompressed::kMagicSize);
+ if (!raw_amount)
+ return new Uncompressed(hold.release());
if (raw_amount != ReadCompressed::kMagicSize)
return new UncompressedWithHeader(hold.release(), header, raw_amount);
switch (DetectMagic(header)) {