diff options
Diffstat (limited to 'ext/zip/lib/zip_source_file.c')
-rw-r--r-- | ext/zip/lib/zip_source_file.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/ext/zip/lib/zip_source_file.c b/ext/zip/lib/zip_source_file.c index 204fa1d5a3..a42be670e9 100644 --- a/ext/zip/lib/zip_source_file.c +++ b/ext/zip/lib/zip_source_file.c @@ -1,6 +1,6 @@ /* zip_source_file.c -- create data source from file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -43,9 +43,6 @@ ZIP_EXTERN(struct zip_source *) zip_source_file(struct zip *za, const char *fname, off_t start, off_t len) { - struct zip_source *zs; - FILE *fp; - if (za == NULL) return NULL; @@ -54,15 +51,5 @@ zip_source_file(struct zip *za, const char *fname, off_t start, off_t len) return NULL; } - if ((fp=fopen(fname, "rb")) == NULL) { - _zip_error_set(&za->error, ZIP_ER_OPEN, errno); - return NULL; - } - - if ((zs=zip_source_filep(za, fp, start, len)) == NULL) { - fclose(fp); - return NULL; - } - - return zs; + return _zip_source_file_or_p(za, fname, NULL, start, len); } |