@@ -496,17 +496,11 @@ static zend_long php_zip_status(ze_zip_object *obj) /* {{{ */
496496 int zep = obj -> err_zip ; /* saved err if closed */
497497
498498 if (obj -> za ) {
499- #if LIBZIP_VERSION_MAJOR < 1
500- int syp ;
501-
502- zip_error_get (obj -> za , & zep , & syp );
503- #else
504499 zip_error_t * err ;
505500
506501 err = zip_get_error (obj -> za );
507502 zep = zip_error_code_zip (err );
508503 zip_error_fini (err );
509- #endif
510504 }
511505 return zep ;
512506}
@@ -523,17 +517,11 @@ static zend_long php_zip_status_sys(ze_zip_object *obj) /* {{{ */
523517 int syp = obj -> err_sys ; /* saved err if closed */
524518
525519 if (obj -> za ) {
526- #if LIBZIP_VERSION_MAJOR < 1
527- int zep ;
528-
529- zip_error_get (obj -> za , & zep , & syp );
530- #else
531520 zip_error_t * err ;
532521
533522 err = zip_get_error (obj -> za );
534523 syp = zip_error_code_system (err );
535524 zip_error_fini (err );
536- #endif
537525 }
538526 return syp ;
539527}
@@ -1529,18 +1517,12 @@ PHP_METHOD(ZipArchive, close)
15291517 if (err ) {
15301518 php_error_docref (NULL , E_WARNING , "%s" , zip_strerror (intern ));
15311519 /* Save error for property reader */
1532- #if LIBZIP_VERSION_MAJOR < 1
1533- zip_error_get (intern , & ze_obj -> err_zip , & ze_obj -> err_sys );
1534- #else
1535- {
1536- zip_error_t * ziperr ;
1537-
1538- ziperr = zip_get_error (intern );
1539- ze_obj -> err_zip = zip_error_code_zip (ziperr );
1540- ze_obj -> err_sys = zip_error_code_system (ziperr );
1541- zip_error_fini (ziperr );
1542- }
1543- #endif
1520+ zip_error_t * ziperr ;
1521+
1522+ ziperr = zip_get_error (intern );
1523+ ze_obj -> err_zip = zip_error_code_zip (ziperr );
1524+ ze_obj -> err_sys = zip_error_code_system (ziperr );
1525+ zip_error_fini (ziperr );
15441526 zip_discard (intern );
15451527 } else {
15461528 ze_obj -> err_zip = 0 ;
@@ -1601,10 +1583,6 @@ PHP_METHOD(ZipArchive, clearError)
16011583PHP_METHOD (ZipArchive , getStatusString )
16021584{
16031585 zval * self = ZEND_THIS ;
1604- #if LIBZIP_VERSION_MAJOR < 1
1605- int zep , syp , len ;
1606- char error_string [128 ];
1607- #endif
16081586 ze_zip_object * ze_obj ;
16091587
16101588 if (zend_parse_parameters_none () == FAILURE ) {
@@ -1613,15 +1591,6 @@ PHP_METHOD(ZipArchive, getStatusString)
16131591
16141592 ze_obj = Z_ZIP_P (self ); /* not ZIP_FROM_OBJECT as we can use saved error after close */
16151593
1616- #if LIBZIP_VERSION_MAJOR < 1
1617- if (ze_obj -> za ) {
1618- zip_error_get (ze_obj -> za , & zep , & syp );
1619- len = zip_error_to_str (error_string , 128 , zep , syp );
1620- } else {
1621- len = zip_error_to_str (error_string , 128 , ze_obj -> err_zip , ze_obj -> err_sys );
1622- }
1623- RETVAL_STRINGL (error_string , len );
1624- #else
16251594 if (ze_obj -> za ) {
16261595 zip_error_t * err ;
16271596
@@ -1636,7 +1605,6 @@ PHP_METHOD(ZipArchive, getStatusString)
16361605 RETVAL_STRING (zip_error_strerror (& err ));
16371606 zip_error_fini (& err );
16381607 }
1639- #endif
16401608}
16411609/* }}} */
16421610
0 commit comments