@@ -2520,16 +2520,16 @@ zend_string *phar_create_default_stub(const char *index_php, const char *web_ind
2520
2520
}
2521
2521
/* }}} */
2522
2522
2523
- int phar_flush (phar_archive_data * phar , char * * error ) {
2524
- return phar_flush_ex (phar , NULL , false, error );
2523
+ void phar_flush (phar_archive_data * phar , char * * error ) {
2524
+ phar_flush_ex (phar , NULL , false, error );
2525
2525
}
2526
2526
2527
2527
/**
2528
2528
* Save phar contents to disk
2529
2529
*
2530
2530
* if user_stub is NULL the default or existing stub should be used
2531
2531
*/
2532
- int phar_flush_ex (phar_archive_data * phar , zend_string * user_stub , bool is_default_stub , char * * error ) /* {{{ */
2532
+ void phar_flush_ex (phar_archive_data * phar , zend_string * user_stub , bool is_default_stub , char * * error ) /* {{{ */
2533
2533
{
2534
2534
static const char halt_stub [] = "__HALT_COMPILER();" ;
2535
2535
@@ -2557,29 +2557,31 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2557
2557
if (error ) {
2558
2558
spprintf (error , 0 , "internal error: attempt to flush cached zip-based phar \"%s\"" , phar -> fname );
2559
2559
}
2560
- return EOF ;
2560
+ return ;
2561
2561
}
2562
2562
2563
2563
if (error ) {
2564
2564
* error = NULL ;
2565
2565
}
2566
2566
2567
2567
if (!zend_hash_num_elements (& phar -> manifest ) && !user_stub ) {
2568
- return EOF ;
2568
+ return ;
2569
2569
}
2570
2570
2571
2571
zend_hash_clean (& phar -> virtual_dirs );
2572
2572
2573
2573
if (phar -> is_zip ) {
2574
- return phar_zip_flush (phar , user_stub , is_default_stub , error );
2574
+ phar_zip_flush (phar , user_stub , is_default_stub , error );
2575
+ return ;
2575
2576
}
2576
2577
2577
2578
if (phar -> is_tar ) {
2578
- return phar_tar_flush (phar , user_stub , is_default_stub , error );
2579
+ phar_tar_flush (phar , user_stub , is_default_stub , error );
2580
+ return ;
2579
2581
}
2580
2582
2581
2583
if (PHAR_G (readonly )) {
2582
- return EOF ;
2584
+ return ;
2583
2585
}
2584
2586
2585
2587
if (phar -> fp && !phar -> is_brandnew ) {
@@ -2598,7 +2600,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2598
2600
if (must_close_old_file ) {
2599
2601
php_stream_close (oldfile );
2600
2602
}
2601
- return EOF ;
2603
+ return ;
2602
2604
}
2603
2605
2604
2606
if (user_stub ) {
@@ -2612,7 +2614,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2612
2614
if (error ) {
2613
2615
spprintf (error , 0 , "illegal stub for phar \"%s\" (__HALT_COMPILER(); is missing)" , phar -> fname );
2614
2616
}
2615
- return EOF ;
2617
+ return ;
2616
2618
}
2617
2619
2618
2620
size_t len = pos - ZSTR_VAL (user_stub ) + strlen (halt_stub );
@@ -2630,7 +2632,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2630
2632
if (error ) {
2631
2633
spprintf (error , 0 , "unable to create stub from string in new phar \"%s\"" , phar -> fname );
2632
2634
}
2633
- return EOF ;
2635
+ return ;
2634
2636
}
2635
2637
phar -> halt_offset = len + end_sequence_len ;
2636
2638
} else {
@@ -2660,7 +2662,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2660
2662
if (new_stub ) {
2661
2663
zend_string_free (new_stub );
2662
2664
}
2663
- return EOF ;
2665
+ return ;
2664
2666
}
2665
2667
if (new_stub ) {
2666
2668
zend_string_free (new_stub );
@@ -2756,7 +2758,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2756
2758
if (error ) {
2757
2759
spprintf (error , 0 , "unable to seek to start of file \"%s\" while creating new phar \"%s\"" , entry -> filename , phar -> fname );
2758
2760
}
2759
- return EOF ;
2761
+ return ;
2760
2762
}
2761
2763
newcrc32 = php_crc32_bulk_init ();
2762
2764
php_crc32_stream_bulk_update (& newcrc32 , file , entry -> uncompressed_filesize );
@@ -2782,7 +2784,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2782
2784
spprintf (error , 0 , "unable to bzip2 compress file \"%s\" to new phar \"%s\"" , entry -> filename , phar -> fname );
2783
2785
}
2784
2786
}
2785
- return EOF ;
2787
+ return ;
2786
2788
}
2787
2789
2788
2790
/* create new file that holds the compressed versions */
@@ -3105,7 +3107,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
3105
3107
php_stream_close (oldfile );
3106
3108
}
3107
3109
php_stream_close (newfile );
3108
- return EOF ;
3110
+ return ;
3109
3111
}
3110
3112
3111
3113
php_stream_write (newfile , digest , digest_len );
@@ -3157,7 +3159,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
3157
3159
if (error ) {
3158
3160
spprintf (error , 4096 , "unable to open new phar \"%s\" for writing" , phar -> fname );
3159
3161
}
3160
- return EOF ;
3162
+ return ;
3161
3163
}
3162
3164
3163
3165
if (phar -> flags & PHAR_FILE_COMPRESSED_GZ ) {
@@ -3173,7 +3175,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
3173
3175
if (error ) {
3174
3176
spprintf (error , 4096 , "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib" , phar -> fname );
3175
3177
}
3176
- return EOF ;
3178
+ return ;
3177
3179
}
3178
3180
3179
3181
php_stream_filter_append (& phar -> fp -> writefilters , filter );
@@ -3203,10 +3205,9 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
3203
3205
if (error ) {
3204
3206
spprintf (error , 0 , "unable to seek to __HALT_COMPILER(); in new phar \"%s\"" , phar -> fname );
3205
3207
}
3206
- return EOF ;
3207
3208
}
3208
3209
3209
- return EOF ;
3210
+ return ;
3210
3211
3211
3212
cleanup :
3212
3213
if (shared_cfp != NULL ) {
@@ -3218,8 +3219,6 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
3218
3219
entry -> header_offset = 0 ;
3219
3220
}
3220
3221
} ZEND_HASH_FOREACH_END ();
3221
-
3222
- return EOF ;
3223
3222
}
3224
3223
/* }}} */
3225
3224
0 commit comments