diff --git a/src/proto/protoio.cc b/src/proto/protoio.cc index 72e463b8ea..acf04de522 100644 --- a/src/proto/protoio.cc +++ b/src/proto/protoio.cc @@ -37,6 +37,8 @@ #include "proto/protoio.hh" +#include + #include "base/logging.hh" using namespace google::protobuf; @@ -53,7 +55,7 @@ ProtoOutputStream::ProtoOutputStream(const std::string& filename) : // wrapped in a gzip stream if the filename ends with .gz. The // latter stream is in turn wrapped in a coded stream wrappedFileStream = new io::OstreamOutputStream(&fileStream); - if (filename.find_last_of('.') != string::npos && + if (filename.find_last_of('.') != std::string::npos && filename.substr(filename.find_last_of('.') + 1) == "gz") { gzipStream = new io::GzipOutputStream(wrappedFileStream); zeroCopyStream = gzipStream;