diff --git a/ext/phar/tests/gh17808.phpt b/ext/phar/tests/gh17808.phpt index 03e54ff264bf..28cb9a2e2279 100644 --- a/ext/phar/tests/gh17808.phpt +++ b/ext/phar/tests/gh17808.phpt @@ -2,7 +2,6 @@ GH-17808 (PharFileInfo refcount bug) --EXTENSIONS-- phar -zlib --FILE-- is_persistent) { @@ -1254,12 +1245,16 @@ phar_entry_info *phar_get_entry_info(phar_archive_data *phar, const char *path, * valid pre-existing empty directory entries */ // TODO: convert this to use zend_string too -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) /* {{{ */ +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) /* {{{ */ { const char *pcr_error; phar_entry_info *entry; int is_dir; +#ifdef PHP_WIN32 + phar_unixify_path_separators(path, path_len); +#endif + is_dir = (path_len && (path[path_len - 1] == '/')) ? 1 : 0; if (error) { @@ -1406,19 +1401,6 @@ static phar_entry_info *phar_get_entry_info_dir_ex(phar_archive_data *phar, cons } /* }}} */ -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) -{ -#ifdef PHP_WIN32 - char *path_dup = estrndup(path, path_len); - phar_unixify_path_separators(path_dup, path_len); - phar_entry_info *ret = phar_get_entry_info_dir_ex(phar, path_dup, path_len, dir, error, security); - efree(path_dup); - return ret; -#else - return phar_get_entry_info_dir_ex(phar, path, path_len, dir, error, security); -#endif -} - static const char hexChars[] = "0123456789ABCDEF"; static int phar_hex_str(const char *digest, size_t digest_len, char **signature) /* {{{ */