@@ -632,14 +632,18 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname
632
632
/**
633
633
* Create a new dummy file slot within a writeable phar for a newly created file
634
634
*/
635
- static phar_entry_data * phar_get_or_create_entry_data_ex (char * fname , size_t fname_len , const char * path , size_t path_len , const char * mode , char allow_dir , char * * error , int security ) /* {{{ */
635
+ phar_entry_data * phar_get_or_create_entry_data (char * fname , size_t fname_len , const char * path , size_t path_len , const char * mode , char allow_dir , char * * error , int security ) /* {{{ */
636
636
{
637
637
phar_archive_data * phar ;
638
638
phar_entry_info * entry , etemp ;
639
639
phar_entry_data * ret ;
640
640
const char * pcr_error ;
641
641
char is_dir ;
642
642
643
+ #ifdef PHP_WIN32
644
+ phar_unixify_path_separators (path , path_len );
645
+ #endif
646
+
643
647
is_dir = (path_len && path [path_len - 1 ] == '/' ) ? 1 : 0 ;
644
648
645
649
if (FAILURE == phar_get_archive (& phar , fname , fname_len , NULL , 0 , error )) {
@@ -727,19 +731,6 @@ static phar_entry_data *phar_get_or_create_entry_data_ex(char *fname, size_t fna
727
731
}
728
732
/* }}} */
729
733
730
- phar_entry_data * phar_get_or_create_entry_data (char * fname , size_t fname_len , const char * path , size_t path_len , const char * mode , char allow_dir , char * * error , int security )
731
- {
732
- #ifdef PHP_WIN32
733
- char * path_dup = estrndup (path , path_len );
734
- phar_unixify_path_separators (path_dup , path_len );
735
- phar_entry_data * ret = phar_get_or_create_entry_data_ex (fname , fname_len , path_dup , path_len , mode , allow_dir , error , security );
736
- efree (path_dup );
737
- return ret ;
738
- #else
739
- return phar_get_or_create_entry_data_ex (fname , fname_len , path , path_len , mode , allow_dir , error , security );
740
- #endif
741
- }
742
-
743
734
static inline void phar_set_pharfp (phar_archive_data * phar , php_stream * fp )
744
735
{
745
736
if (!phar -> is_persistent ) {
@@ -1254,12 +1245,16 @@ phar_entry_info *phar_get_entry_info(phar_archive_data *phar, const char *path,
1254
1245
* valid pre-existing empty directory entries
1255
1246
*/
1256
1247
// TODO: convert this to use zend_string too
1257
- static phar_entry_info * phar_get_entry_info_dir_ex (phar_archive_data * phar , const char * path , size_t path_len , char dir , char * * error , int security ) /* {{{ */
1248
+ phar_entry_info * phar_get_entry_info_dir (phar_archive_data * phar , const char * path , size_t path_len , char dir , char * * error , int security ) /* {{{ */
1258
1249
{
1259
1250
const char * pcr_error ;
1260
1251
phar_entry_info * entry ;
1261
1252
int is_dir ;
1262
1253
1254
+ #ifdef PHP_WIN32
1255
+ phar_unixify_path_separators (path , path_len );
1256
+ #endif
1257
+
1263
1258
is_dir = (path_len && (path [path_len - 1 ] == '/' )) ? 1 : 0 ;
1264
1259
1265
1260
if (error ) {
@@ -1406,19 +1401,6 @@ static phar_entry_info *phar_get_entry_info_dir_ex(phar_archive_data *phar, cons
1406
1401
}
1407
1402
/* }}} */
1408
1403
1409
- phar_entry_info * phar_get_entry_info_dir (phar_archive_data * phar , const char * path , size_t path_len , char dir , char * * error , int security )
1410
- {
1411
- #ifdef PHP_WIN32
1412
- char * path_dup = estrndup (path , path_len );
1413
- phar_unixify_path_separators (path_dup , path_len );
1414
- phar_entry_info * ret = phar_get_entry_info_dir_ex (phar , path_dup , path_len , dir , error , security );
1415
- efree (path_dup );
1416
- return ret ;
1417
- #else
1418
- return phar_get_entry_info_dir_ex (phar , path , path_len , dir , error , security );
1419
- #endif
1420
- }
1421
-
1422
1404
static const char hexChars [] = "0123456789ABCDEF" ;
1423
1405
1424
1406
static int phar_hex_str (const char * digest , size_t digest_len , char * * signature ) /* {{{ */
0 commit comments