Skip to content

Fix/dos relative path regression#2174

Merged
maximilien-noal merged 3 commits into
masterfrom
fix/dos_relative_path_regression
May 14, 2026
Merged

Fix/dos relative path regression#2174
maximilien-noal merged 3 commits into
masterfrom
fix/dos_relative_path_regression

Conversation

@maximilien-noal
Copy link
Copy Markdown
Member

@maximilien-noal maximilien-noal commented May 14, 2026

Description of Changes

Two bug fixes and standards compliance: aligns DOS path and file name handling with authentic DOS/FreeDOS canonicalization rules.

First commit fixes regression from 424217c and was fixed with TDD and checked against FreeDOS. It made The Summonning work again.

Second commit fixes regression from 53b9fe4 and was fixed with TDD and checked against FreeDOS. It made Alone in the Dark intro launch again.

Rationale behind Changes

This PR updates DOS path and file name parsing to correctly handle trailing whitespace and dots, matching real DOS/FreeDOS behavior, and adds comprehensive tests for these cases.

  • DosPathBuilder.cs: Implements stripping of trailing whitespace and single trailing dots, rejects multiple trailing dots, and updates special file name parsing.
  • DosFileManagerTests.cs: Adds tests for trailing dot/space handling and double-dot rejection.
  • DosPathBuilderTests.cs: Updates and expands tests to cover new canonicalization logic.

Suggested Testing Steps

Already tested. Unit tests and integration tests in place. They were failing before the fixes.

Each commit was not done until the corresponding game worked again.

…e Dark)

Update path canonicalization to strip trailing whitespace and a single empty-extension dot, matching FreeDOS/DOS behavior. Allow space-padded file names as valid, update special name parsing, and add tests for FCB-style buffers and canonicalization edge cases.
@maximilien-noal maximilien-noal self-assigned this May 14, 2026
Copilot AI review requested due to automatic review settings May 14, 2026 12:56
@maximilien-noal maximilien-noal added DOS Related to DOS bugfix fixes a bug labels May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates DOS path canonicalization to better match DOS/FreeDOS behavior for trailing spaces and single trailing dots, with regression tests for affected game launch paths.

Changes:

  • Canonicalizes trailing whitespace and single trailing empty-extension dots in DOS path segments.
  • Preserves rejection for multiple trailing dots.
  • Adds regression coverage for file open and path builder behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Spice86.Core/Emulator/OperatingSystem/Structures/DosPathBuilder.cs Updates DOS path segment validation and canonicalization rules.
tests/Spice86.Tests/Dos/DosFileManagerTests.cs Adds file-open regression tests for trailing dots/spaces and double-dot rejection.
tests/Spice86.Tests/Dos/Structures/DosPathBuilderTests.cs Expands path builder tests for new canonicalization behavior.

@maximilien-noal maximilien-noal merged commit 472a995 into master May 14, 2026
4 of 5 checks passed
@maximilien-noal maximilien-noal deleted the fix/dos_relative_path_regression branch May 14, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes a bug DOS Related to DOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants