summaryrefslogtreecommitdiff
path: root/ext/zip/lib/zip_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/lib/zip_open.c')
-rw-r--r--ext/zip/lib/zip_open.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 0a14abda5..60526e8c9 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -2,7 +2,7 @@
$NiH: zip_open.c,v 1.38 2006/05/04 00:01:26 dillo Exp $
zip_open.c -- open zip archive
- Copyright (C) 1999-2006 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <nih@giga.or.at>
@@ -100,7 +100,6 @@ zip_open(const char *fn, int flags, int *zep)
return NULL;
}
-
/* ZIP_CREATE gets ignored if file exists and not ZIP_EXCL,
just like open() */
if ((fp=fopen(fn, "rb")) == NULL) {
@@ -108,6 +107,10 @@ zip_open(const char *fn, int flags, int *zep)
return NULL;
}
+#ifdef PHP_WIN32
+ _setmode(_fileno(fp), _O_BINARY );
+#endif
+
clearerr(fp);
fseek(fp, 0, SEEK_END);
len = ftell(fp);