aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-rwxr-xr-xthird_party/ijar/test/zip_test.sh1
-rw-r--r--third_party/ijar/zip_main.cc2
2 files changed, 2 insertions, 1 deletions
diff --git a/third_party/ijar/test/zip_test.sh b/third_party/ijar/test/zip_test.sh
index b3247fd60b..83ca3f5e0a 100755
--- a/third_party/ijar/test/zip_test.sh
+++ b/third_party/ijar/test/zip_test.sh
@@ -52,6 +52,7 @@ function assert_zipper_same_after_unzip() {
function test_zipper() {
mkdir -p ${TEST_TMPDIR}/test/path/to/some
mkdir -p ${TEST_TMPDIR}/test/some/other/path
+ touch ${TEST_TMPDIR}/test/path/to/some/empty_file
echo "toto" > ${TEST_TMPDIR}/test/path/to/some/file
echo "titi" > ${TEST_TMPDIR}/test/path/to/some/other_file
chmod +x ${TEST_TMPDIR}/test/path/to/some/other_file
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