Skip to content

bugfix(file): Keep the resolved prefix when a write path has a missing directory - #3104

Draft
bobtista wants to merge 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/write-path-prefix
Draft

bugfix(file): Keep the resolved prefix when a write path has a missing directory#3104
bobtista wants to merge 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/write-path-prefix

Conversation

@bobtista

Copy link
Copy Markdown

On an unmatched component during a write the fixup does pathFixed = p, replacing everything matched so far, and the following pathFixed /= pathFixedPart appends nothing because pathFixedPart is empty:

requested:  /home/user/GeneralsData/Maps/MyMap/MyMap.tga
before:     MyMap.tga
after:      /home/user/GeneralsData/Maps/MyMap/MyMap.tga

Now the component is appended to the resolved prefix instead of replacing it. The comment above the line already said to use the last known good path.

Todo:

  • A file written through a directory that does not exist yet is created at the requested path
  • Replicate to Generals — N/A, it's in Core

@bobtista bobtista self-assigned this Aug 11, 2026
@bobtista bobtista added the Platform Work towards platform support, such as Linux, MacOS label Aug 11, 2026
@bobtista
bobtista marked this pull request as draft August 11, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform Work towards platform support, such as Linux, MacOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Writing through a directory that does not exist yet creates the file in the working directory on non-Windows builds

1 participant