Skip to content

Commit 9f6c339

Browse files
committed
Revert "Drop dead Windows code"
This reverts commit 7f370f8.
1 parent 7f370f8 commit 9f6c339

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ext/phar/phar.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,9 +2220,15 @@ zend_string* phar_split_fname_ex(const char *filename, size_t filename_len, zend
22202220
if (entry) {
22212221
if (ext_str[ext_len]) {
22222222
size_t computed_entry_len = filename_len - arch_len;
2223-
/* We don't need to unixify the path on Windows,
2224-
* as ext_str is derived from filename that was already unixify */
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+
*entry = phar_fix_filepath(fixed_path_for_windows, computed_entry_len, false);
2228+
efree(fixed_path_for_windows);
2229+
#else
22252230
*entry = phar_fix_filepath(ext_str+ext_len, computed_entry_len, false);
2231+
#endif
22262232
} else {
22272233
*entry = ZSTR_CHAR('/');
22282234
}

0 commit comments

Comments
 (0)