]> git.pld-linux.org Git - packages/libzip.git/commitdiff
- add php changes patch auto/th/libzip-0_10-3
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 26 Sep 2011 18:36:50 +0000 (18:36 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    libzip-0.10-php-changes.patch -> 1.1
    libzip.spec -> 1.15

libzip-0.10-php-changes.patch [new file with mode: 0644]
libzip.spec

diff --git a/libzip-0.10-php-changes.patch b/libzip-0.10-php-changes.patch
new file mode 100644 (file)
index 0000000..aef57b2
--- /dev/null
@@ -0,0 +1,97 @@
+diff -up libzip-0.10/lib/zip_close.c.php libzip-0.10/lib/zip_close.c
+--- libzip-0.10/lib/zip_close.c.php    2011-07-20 11:27:34.081252871 -0400
++++ libzip-0.10/lib/zip_close.c        2011-07-20 11:30:50.176682999 -0400
+@@ -337,6 +337,8 @@ zip_close(struct zip *za)
+     umask(mask);
+     chmod(za->zn, 0666&~mask);
+ #endif
++    if (za->ch_comment)
++        free(za->ch_comment);
+     _zip_free(za);
+     free(temp);
+@@ -602,13 +604,15 @@ _zip_create_temp_output(struct zip *za, 
+     char *temp;
+     int tfd;
+     FILE *tfp;
++
++    int len = strlen(za->zn) + 8;
+     
+-    if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) {
++    if ((temp=(char *)malloc(len)) == NULL) {
+       _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+       return NULL;
+     }
+-    sprintf(temp, "%s.XXXXXX", za->zn);
++    snprintf(temp, len, "%s.XXXXXX", za->zn);
+     if ((tfd=mkstemp(temp)) == -1) {
+       _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno);
+diff -up libzip-0.10/lib/zip_fclose.c.php libzip-0.10/lib/zip_fclose.c
+--- libzip-0.10/lib/zip_fclose.c.php   2011-07-20 11:38:05.883077282 -0400
++++ libzip-0.10/lib/zip_fclose.c       2011-07-20 11:38:10.452025182 -0400
+@@ -47,12 +47,14 @@ zip_fclose(struct zip_file *zf)
+     if (zf->src)
+       zip_source_free(zf->src);
+-    for (i=0; i<zf->za->nfile; i++) {
+-      if (zf->za->file[i] == zf) {
+-          zf->za->file[i] = zf->za->file[zf->za->nfile-1];
+-          zf->za->nfile--;
+-          break;
+-      }
++    if (zf->za) {
++        for (i=0; i<zf->za->nfile; i++) {
++          if (zf->za->file[i] == zf) {
++              zf->za->file[i] = zf->za->file[zf->za->nfile-1];
++              zf->za->nfile--;
++              break;
++          }
++        }
+     }
+     ret = 0;
+diff -up libzip-0.10/lib/zip.h.php libzip-0.10/lib/zip.h
+--- libzip-0.10/lib/zip.h.php  2011-07-20 11:39:40.732027472 -0400
++++ libzip-0.10/lib/zip.h      2011-07-20 11:40:28.626521627 -0400
+@@ -59,7 +59,7 @@ extern "C" {
+ #define ZIP_CREATE           1
+ #define ZIP_EXCL             2
+ #define ZIP_CHECKCONS        4
+-
++#define ZIP_OVERWRITE        8
+ /* flags for zip_name_locate, zip_fopen, zip_stat, ... */
+diff -up libzip-0.10/lib/zipint.h.php libzip-0.10/lib/zipint.h
+diff -up libzip-0.10/lib/zip_open.c.php libzip-0.10/lib/zip_open.c
+--- libzip-0.10/lib/zip_open.c.php     2011-07-20 11:44:01.270451036 -0400
++++ libzip-0.10/lib/zip_open.c 2011-07-20 11:45:33.877629039 -0400
+@@ -61,10 +61,16 @@ ZIP_EXTERN struct zip *
+ zip_open(const char *fn, int flags, int *zep)
+ {
+     FILE *fp;
++
++    if (flags & ZIP_OVERWRITE) {
++      return _zip_allocate_new(fn, zep);
++    }
+     
+     switch (_zip_file_exists(fn, flags, zep)) {
+     case -1:
+-      return NULL;
++        if (!(flags & ZIP_OVERWRITE)) {
++            return NULL;
++        }
+     case 0:
+       return _zip_allocate_new(fn, zep);
+     default:
+@@ -482,7 +488,7 @@ _zip_file_exists(const char *fn, int fla
+     }
+     
+     if (stat(fn, &st) != 0) {
+-      if (flags & ZIP_CREATE)
++      if (flags & ZIP_CREATE || flags & ZIP_OVERWRITE)
+           return 0;
+       else {
+           set_error(zep, NULL, ZIP_ER_OPEN);
index dafce1ee85335e56a8f287621bfff03955e69852..c69afaa083b90e1049e7a4eea63d2a7c9db644e8 100644 (file)
@@ -2,12 +2,14 @@ Summary:      C library for reading, creating, and modifying zip archives
 Summary(pl.UTF-8):     Biblioteka C do odczytu, zapisu i modyfikacji archiwów zip
 Name:          libzip
 Version:       0.10
-Release:       2
+Release:       3
 License:       BSD
 Group:         Libraries
 Source0:       http://www.nih.at/libzip/%{name}-%{version}.tar.bz2
 # Source0-md5: 663d79a9d299a61026d1860d52cdf6fc
 Patch0:                %{name}-fix_headers.patch
+# https://bugs.php.net/bug.php?id=39388
+Patch1:                http://spot.fedorapeople.org/%{name}-0.10-php-changes.patch
 URL:           http://www.nih.at/libzip/
 BuildRequires: autoconf >= 2.57
 BuildRequires: automake
@@ -67,7 +69,6 @@ Statyczna biblioteka libzip.
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
This page took 0.17966 seconds and 4 git commands to generate.