sys_fs: Fix ENOTDIR check for paths ending with /dot or /dotdot#19028
Merged
Conversation
Contributor
|
is maybe #18781 also affected by this PR? |
Contributor
Author
|
@digant73 Updated, please retest. |
They must be directories, even file-path/dot points to itself.
Contributor
Megamouse
reviewed
Jul 14, 2026
| // Takes virtual path only | ||
| bool ends_with_delim_dot_or_dotdot(std::string_view vpath) | ||
| { | ||
| if (vpath.find_last_not_of('/') != vpath.size() - 1) |
Contributor
There was a problem hiding this comment.
Isn't this the same as vpath.endsWith(/)
Contributor
There was a problem hiding this comment.
Weird spaghetti code man
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19021
Adds special ENOTDIR checks for when paths end with /. or /..
In Middle Earth Shadow of Mordor, the path "/dev_hdd0/game/BLUS31059/USRDIR/KeyFile.EDAT/./" is sent to the filesystem pretending that it is a file, but bacause of ./ it cannot be. Therefore ENOTDIR should be returned.
Confirned fixed per #19021 (comment)
