Merge pull request #933 from vcaputo/readfiletostring_clearfirst

libchrome: Fix append bug in file_util::ReadFileToString()
This commit is contained in:
Vito Caputo 2014-10-21 18:04:29 -07:00
commit c60f3b2faa
3 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- a/file_util.cc 2014-10-21 19:09:47.052101527 -0400
+++ b/file_util.cc 2014-10-21 19:22:00.619134259 -0400
@@ -152,6 +152,8 @@
}
bool ReadFileToString(const FilePath& path, std::string* contents) {
+ if (contents)
+ contents->clear();
if (path.ReferencesParent())
return false;
FILE* file = OpenFile(path, "rb");

View File

@ -42,6 +42,7 @@ src_prepare() {
epatch "${FILESDIR}"/base-125070-no-X.patch epatch "${FILESDIR}"/base-125070-no-X.patch
epatch "${FILESDIR}"/base-125070-x32.patch epatch "${FILESDIR}"/base-125070-x32.patch
epatch "${FILESDIR}"/readfiletostring_clearfirst.patch
} }
src_configure() { src_configure() {