aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/zip_main.cc
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2015-07-01 17:20:02 +0000
committerGravatar Florian Weikert <fwe@google.com>2015-07-02 09:23:13 +0000
commit5bf02b34cb96a97cb6a8fa383d5c6eab3c34f8da (patch)
treeb0f8b6abb2636048760cfd73f562f7bbbb115d82 /third_party/ijar/zip_main.cc
parent1b9123646e21b05ed1ff8706f4b0f32c7d2efd60 (diff)
Fix zipper for empty files
It was erroring out because it could not mmap an empty file. -- MOS_MIGRATED_REVID=97338974
Diffstat (limited to 'third_party/ijar/zip_main.cc')
-rw-r--r--third_party/ijar/zip_main.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/ijar/zip_main.cc b/third_party/ijar/zip_main.cc
index cd5c2f39be..aeda2370e2 100644
--- a/third_party/ijar/zip_main.cc
+++ b/third_party/ijar/zip_main.cc
@@ -218,7 +218,7 @@ int create(char *zipfile, char **files, bool flatten, bool verbose) {
}
u1 *buffer = builder->NewFile(path, mode_to_zipattr(statst.st_mode));
- if (isdir) {
+ if (isdir || statst.st_size == 0) {
builder->FinishFile(0);
} else {
// mmap the input file and memcpy