aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/testing/file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/testing/file.cc')
-rw-r--r--src/google/protobuf/testing/file.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc
index 26cb0a67..def92a00 100644
--- a/src/google/protobuf/testing/file.cc
+++ b/src/google/protobuf/testing/file.cc
@@ -69,9 +69,9 @@ bool File::Exists(const string& name) {
return access(name.c_str(), F_OK) == 0;
}
-bool File::ReadFileToString(const string& name, string* output) {
+bool File::ReadFileToString(const string& name, string* output, bool text_mode) {
char buffer[1024];
- FILE* file = fopen(name.c_str(), "rb");
+ FILE* file = fopen(name.c_str(), text_mode ? "rt" : "rb");
if (file == NULL) return false;
while (true) {