Read and write attachments in binary mode so they don't get mutilated on Windows

Originally committed to SVN as r6704.
This commit is contained in:
Thomas Goyne 2012-04-16 23:54:59 +00:00
parent d83507c816
commit 8a03e3a374
1 changed files with 2 additions and 2 deletions

View File

@ -119,11 +119,11 @@ const wxString AssAttachment::GetEntryData() const {
}
void AssAttachment::Extract(wxString const& filename) const {
agi::io::Save(STD_STR(filename)).Get().write(&(*data)[0], data->size());
agi::io::Save(STD_STR(filename), true).Get().write(&(*data)[0], data->size());
}
void AssAttachment::Import(wxString const& filename) {
agi::scoped_ptr<std::istream> file(agi::io::Open(STD_STR(filename)));
agi::scoped_ptr<std::istream> file(agi::io::Open(STD_STR(filename), true));
file->seekg(0, std::ios::end);
data->resize(file->tellg());
file->seekg(0, std::ios::beg);