summaryrefslogtreecommitdiffabout
path: root/src/eyetil.cc
Unidiff
Diffstat (limited to 'src/eyetil.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--src/eyetil.cc4
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
@@ -149,19 +149,19 @@ std::string tmpdir_t::get_file(const std::string& f) {
149 (ls==std::string::npos) 149 (ls==std::string::npos)
150 ? f 150 ? f
151 : f.substr(ls+1) 151 : f.substr(ls+1)
152 ); 152 );
153} 153}
154 154
155tarchive_t::tarchive_t(void *p,size_t s) : a(archive_read_new()), e(0) { 155tarchive_t::tarchive_t(const char *fn) : a(archive_read_new()), e(0) {
156 if(!a) throw std::runtime_error("failed to archive_read_new()"); 156 if(!a) throw std::runtime_error("failed to archive_read_new()");
157 if(archive_read_support_format_tar(a)) { 157 if(archive_read_support_format_tar(a)) {
158 archive_read_finish(a); 158 archive_read_finish(a);
159 throw std::runtime_error("failed to archive_read_support_format_tar()"); 159 throw std::runtime_error("failed to archive_read_support_format_tar()");
160 } 160 }
161 if(archive_read_open_memory(a,p,s)) { 161 if(archive_read_open_filename(a,fn,16384)) {
162 archive_read_finish(a); 162 archive_read_finish(a);
163 throw std::runtime_error("failed to archive_read_open_memory()"); 163 throw std::runtime_error("failed to archive_read_open_memory()");
164 } 164 }
165} 165}
166tarchive_t::~tarchive_t() { 166tarchive_t::~tarchive_t() {
167 assert(a); 167 assert(a);