-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix invalid file path handling in Windows when there is dot in the file name #88144
Conversation
This is exactly what the Lines 4800 to 4807 in 94dbf69
Are you sure there's nothing else missing here? This shouldn't be needed Also with Lines 4692 to 4699 in 94dbf69
This code would also change The current code correctly turns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Therefore "con.png" etc. becomes "con." and this still froze the editor.
I can't reproduce it, it's correctly returning "con" in this case.
In addition to being redundant, this logic is wrong since it's searching for the dot from the left instead of doing it from the right (like get_basename
do), so it will reject a completely valid con.con.con
file for example.
Actually, according to the Windows docs,
|
So you commented faster than me, but I will post this anyway... :) Did some more testing with debug-prints:
Output with BBCode "[img]con.[/img]" BBCode "[img]res://con.png[/img]": BBCode "[img]res://con.png.tmp[/img]": BBCode "[img]con.png[/img]": Those ".remap" and ".import" extensions confure me a bit. And I was wrong about ""con.png" etc. becomes "con."". Not sure why I came to that conclusion... Reverted my changes and tried with some strings (same as above + "bare" con): None of these freeze the editor with this PR. PC has windows 10. |
Looks good! Could you squash the commits? See PR workflow for instructions. Edit: Done myself. |
…le name This basically re-adds dot-removal removed by the previous commit.
Thanks! |
This basically re-adds the dot-removal removed by the previous commit (PR #88129). It looks like get_basename() (that was meant to replace the old "dot-removal" part?) doesn't actually remove the dot from the filename. Therefore "con.png" etc. becomes "con." and this still froze the editor.
Not sure if the dot-removal should be actually done in get_basename() instead(?) If so, feel free to discard this PR.
@bruvzg