Get position in correct file. Set zip error on failure.
diff --git a/lib/zip_close.c b/lib/zip_close.c
index 2fad07b..a46cc4c 100644
--- a/lib/zip_close.c
+++ b/lib/zip_close.c
@@ -202,6 +202,7 @@
#ifdef _WIN32
printf("close error case 2: off = %llu\n", off);
#endif
+ _zip_error_set_from_source(&za->error, za->src);
error = 1;
break;
}
diff --git a/lib/zip_open.c b/lib/zip_open.c
index e886987..c2ddedc 100644
--- a/lib/zip_open.c
+++ b/lib/zip_open.c
@@ -384,7 +384,7 @@
if (i != cd->nentry || left > 0) {
zip_error_set(error, ZIP_ER_INCONS, 0);
#ifdef _WIN32
- printf("open inconsistency 5: i = %llu, nentry = %llu, left = %llu\n, size = %llu", i, cd->nentry, left, cd->size);
+ printf("open inconsistency 5: i = %llu, nentry = %llu, left = %llu, size = %llu\n", i, cd->nentry, left, cd->size);
#endif
_zip_buffer_free(cd_buffer);
_zip_cdir_free(cd);
diff --git a/lib/zip_source_file_win32.c b/lib/zip_source_file_win32.c
index a21d7d1..1e83bcb 100644
--- a/lib/zip_source_file_win32.c
+++ b/lib/zip_source_file_win32.c
@@ -150,13 +150,11 @@
LARGE_INTEGER new_offset;
zero.QuadPart = 0;
- if (!SetFilePointerEx((HANDLE)ctx->f, zero, &new_offset, FILE_CURRENT)) {
- printf("SetFilePointerEx failed\n");
+ if (!SetFilePointerEx((HANDLE)f, zero, &new_offset, FILE_CURRENT)) {
zip_error_set(&ctx->error, ZIP_ER_SEEK, _zip_win32_error_to_errno(GetLastError()));
return -1;
}
- printf("SetFilePointerEx returned %llu\n", new_offset.QuadPart);
return (zip_int64_t)new_offset.QuadPart;
}
diff --git a/lib/zip_source_file_win32_write.c b/lib/zip_source_file_win32_write.c
index 371cc08..ed36b2f 100644
--- a/lib/zip_source_file_win32_write.c
+++ b/lib/zip_source_file_win32_write.c
@@ -219,7 +219,7 @@
/* TODO: fill in ctx->attributes */
- wprintf(L"stat(%s) = { size = %llu }\n", (wchar_t *)ctx->fname, st->size);
+ //wprintf(L"stat(%s) = { size = %llu }\n", (wchar_t *)ctx->fname, st->size);
return true;
}