Skip to content

Commit 18f97ab

Browse files
committed
Drop dead Windows code
TODO: squash into commit if comfirmed good
1 parent d737dd4 commit 18f97ab

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

ext/phar/phar.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,21 +2220,12 @@ zend_string* phar_split_fname_ex(const char *filename, size_t filename_len, char
22202220
if (entry) {
22212221
if (ext_str[ext_len]) {
22222222
size_t computed_entry_len = filename_len - arch_len;
2223-
#ifdef PHP_WIN32
2224-
/* TODO: can we handle the unixify path in phar_fix_filepath() directly ? */
2225-
char *fixed_path_for_windows = estrndup(ext_str+ext_len, computed_entry_len);
2226-
phar_unixify_path_separators(fixed_path_for_windows, computed_entry_len);
2227-
zend_string *entry_str = phar_fix_filepath(fixed_path_for_windows, computed_entry_len, false);
2228-
*entry = estrndup(ZSTR_VAL(entry_str), ZSTR_LEN(entry_str));
2229-
*entry_len = ZSTR_LEN(entry_str);
2230-
zend_string_release_ex(entry_str, false);
2231-
efree(fixed_path_for_windows);
2232-
#else
2223+
/* We don't need to unixify the path on Windows,
2224+
* as ext_str is derived from filename that was already unixify */
22332225
zend_string *entry_str = phar_fix_filepath(ext_str+ext_len, computed_entry_len, false);
22342226
*entry = estrndup(ZSTR_VAL(entry_str), ZSTR_LEN(entry_str));
22352227
*entry_len = ZSTR_LEN(entry_str);
22362228
zend_string_release_ex(entry_str, false);
2237-
#endif
22382229
} else {
22392230
*entry_len = 1;
22402231
*entry = estrndup("/", 1);

0 commit comments

Comments
 (0)