Skip to content

Fix DirAccessWindows::make_dir() choking on ".." - #66467

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
nikitalita:fix-make-dir-windows
Sep 28, 2022
Merged

akien-mga merged 1 commit into
godotengine:masterfrom
nikitalita:fix-make-dir-windows

Conversation

@nikitalita

@nikitalita nikitalita commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

CreateDirectoryW() chokes on absolute paths that contain "..". It returns an error 123: "The filename, directory name, or volume label syntax is incorrect."

Example: C:\\workspace\\..\\games\\assets

This causes DirAccessWindows::make_dir() to fail.
Simplifying the path before creating the dir fixes this.

`CreateDirectoryW()` chokes on absolute paths that contain `..`
example: "C:\\workspace\\..\\games\\assets"
Simplifying the path before creating the dir fixes this.
@nikitalita
nikitalita requested a review from a team as a code owner September 26, 2022 19:25
@Calinou Calinou added this to the 4.0 milestone Sep 26, 2022
@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release labels Sep 26, 2022

@bruvzg bruvzg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In case of make_dir, we are using \\?\ prefixed paths to avoid path length limitations, and automatic expansion is disabled for these, so part need to be absolute.

@akien-mga
akien-mga merged commit ff8e240 into godotengine:master Sep 28, 2022
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@akien-mga

Copy link
Copy Markdown
Member

Cherry-picked for 3.6.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 30, 2022
@timothyqiu

Copy link
Copy Markdown
Member

Cherry-picked for 3.5.2

@timothyqiu timothyqiu removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Dec 5, 2022
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
wangshucheng pushed a commit to wangshucheng/godot that referenced this pull request Aug 27, 2026
Shane-Gadsby pushed a commit to Shane-Gadsby/godotwebgpu that referenced this pull request Sep 21, 2026
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.

5 participants