Skip to content

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

Description

@bobtista

Prerequisites

  • I have searched for similar issues and confirmed this is not a duplicate

Game Version

  • Command & Conquer Generals
  • Command & Conquer Generals: Zero Hour

Bug Description

On non-Windows builds, opening a file for writing under a directory that does not exist yet creates the file in the working directory under its leaf name instead of at the requested path. The requested directory is never created.

Reproduction Steps

  1. On a non-Windows build, open a file for writing with File::CREATE at a path whose parent directory does not exist yet. A map received through a network transfer reaches this.
  2. Observe the requested directory is not created.
  3. Observe the file in the working directory, named only its leaf.

Additional Context

The non-Windows case-insensitive path fixup replaces the resolved prefix with the unmatched component instead of appending to it, discarding everything matched so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions