Skip to content

Fix GH-9227: Trailing dots and spaces in filenames are ignored - #9229

Closed
cmb69 wants to merge 4 commits into
php:masterfrom
cmb69:cmb/gh9227
Closed

cmb69 wants to merge 4 commits into
php:masterfrom
cmb69:cmb/gh9227

Conversation

@cmb69

@cmb69 cmb69 commented Aug 2, 2022

Copy link
Copy Markdown
Member

Given that Windows ignores trailing dots and spaces in filenames, we
catch that ourselves to avoid confusion with the respective filenames
without these characters.

Given that Windows ignores trailing dots and spaces in filenames, we
catch that ourselves to avoid confusion with the respective filenames
without these characters.
Comment thread Zend/zend_virtual_cwd.c Resolved
We split the failing SPL test, and exclude testing the trailing dot.

We adapt the test expectations for the file tests; while the former
error message was more suitable, we now get the file not found due to

https://github.com/php/php-src/blob/150456eaa22ea11e25331f9d0d0645281fc98f03/Zend/zend_virtual_cwd.c#L1142
Comment thread Zend/zend_virtual_cwd.c
Comment on lines +1143 to 1146
#ifdef ZEND_WIN32
if (errno != EACCES)
#endif
errno = ENOENT;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quick hack, but I wonder whether that wouldn't make sense on non Windows systems, too.

@cmb69
cmb69 marked this pull request as ready for review August 3, 2022 10:20
@cmb69

cmb69 commented Aug 16, 2022

Copy link
Copy Markdown
Member Author

If there are no objections, I'll merge this by the end of the week.

@cmb69 cmb69 closed this in a1f5c8a Aug 19, 2022
@cmb69
cmb69 deleted the cmb/gh9227 branch August 19, 2022 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trailing dots and spaces in filenames are ignored

2 participants