diff options
Diffstat (limited to 'cpp/src/IceGrid/FileCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/FileCache.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/FileCache.cpp b/cpp/src/IceGrid/FileCache.cpp index 98d4030f2e6..b09b5dcbf9f 100644 --- a/cpp/src/IceGrid/FileCache.cpp +++ b/cpp/src/IceGrid/FileCache.cpp @@ -79,6 +79,11 @@ FileCache::getOffsetFromEnd(const string& file, int originalCount) { streampos beg = is.tellg(); getline(is, line); + if(is.eof() && line.empty()) // Don't count the last line if it's empty. + { + continue; + } + lines.push_back(make_pair(beg, line)); ++totalCount; if(lines.size() == static_cast<unsigned int>(count + 1)) |