Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 2, 2022

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.
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 on lines 1143 to 1146
#ifdef ZEND_WIN32
if (errno != EACCES)
#endif
errno = ENOENT;
Copy link
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
Copy link
Member Author

cmb69 commented Aug 16, 2022

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