am 8a28e16c: Merge "Update ziparchive usage to the new API."

* commit '8a28e16cd346bf28d00d8d5935ed092ffb59e5c9':
  Update ziparchive usage to the new API.
This commit is contained in:
Piotr Jastrzebski
2014-08-18 09:04:08 +00:00
committed by Android Git Automerger

View File

@@ -50,8 +50,7 @@ public:
ZipEntryName name; ZipEntryName name;
void *cookie; void *cookie;
_ZipEntryRO() : cookie(NULL) { _ZipEntryRO() : cookie(NULL) {}
}
~_ZipEntryRO() { ~_ZipEntryRO() {
EndIteration(cookie); EndIteration(cookie);
@@ -87,15 +86,15 @@ ZipFileRO::~ZipFileRO() {
ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const
{ {
_ZipEntryRO* data = new _ZipEntryRO; _ZipEntryRO* data = new _ZipEntryRO;
const int32_t error = FindEntry(mHandle, entryName, &(data->entry));
data->name = ZipEntryName(entryName);
const int32_t error = FindEntry(mHandle, data->name, &(data->entry));
if (error) { if (error) {
delete data; delete data;
return NULL; return NULL;
} }
data->name.name = entryName;
data->name.name_length = strlen(entryName);
return (ZipEntryRO) data; return (ZipEntryRO) data;
} }