author | Michael Krelin <hacker@klever.net> | 2013-02-13 22:43:26 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2013-02-13 22:43:26 (UTC) |
commit | 2a5950df692f8a2c9d51a2a3e0c4d41fe0d3e7c9 (patch) (side-by-side diff) | |
tree | 9c8a49a1bd96177abdc9cd13435b66a3aea783e2 /src/eyetil.cc | |
parent | d6545bd95153a5e41cdae441643f4e4a0af94a49 (diff) | |
download | iii-2a5950df692f8a2c9d51a2a3e0c4d41fe0d3e7c9.zip iii-2a5950df692f8a2c9d51a2a3e0c4d41fe0d3e7c9.tar.gz iii-2a5950df692f8a2c9d51a2a3e0c4d41fe0d3e7c9.tar.bz2 |
stream mime attachments directly to disk
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | src/eyetil.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eyetil.cc b/src/eyetil.cc index fba8724..5bceec7 100644 --- a/src/eyetil.cc +++ b/src/eyetil.cc @@ -143,31 +143,31 @@ tmpdir_t::~tmpdir_t() { } } std::string tmpdir_t::get_file(const std::string& f) { std::string::size_type ls = f.rfind('/'); return dir+'/'+( (ls==std::string::npos) ? f : f.substr(ls+1) ); } -tarchive_t::tarchive_t(void *p,size_t s) : a(archive_read_new()), e(0) { +tarchive_t::tarchive_t(const char *fn) : a(archive_read_new()), e(0) { if(!a) throw std::runtime_error("failed to archive_read_new()"); if(archive_read_support_format_tar(a)) { archive_read_finish(a); throw std::runtime_error("failed to archive_read_support_format_tar()"); } - if(archive_read_open_memory(a,p,s)) { + if(archive_read_open_filename(a,fn,16384)) { archive_read_finish(a); throw std::runtime_error("failed to archive_read_open_memory()"); } } tarchive_t::~tarchive_t() { assert(a); archive_read_finish(a); } bool tarchive_t::read_next_header() { assert(a); return archive_read_next_header(a,&e)==ARCHIVE_OK; |