Fix/dos relative path regression#2174
Merged
Merged
Conversation
…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.
Contributor
There was a problem hiding this comment.
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. |
kevinferrare
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.