Skip to content

tool_doswin: recognize superscript numbers as reserved - #23011

Closed
bagder wants to merge 7 commits into
masterfrom
bagder/windows-superscript
Closed

bagder wants to merge 7 commits into
masterfrom
bagder/windows-superscript

Conversation

@bagder

@bagder bagder commented Sep 21, 2026

Copy link
Copy Markdown
Member

Windows recognizes the 8-bit superscript digits 1, 2, and 3 as digits and treats them as valid parts of COM# and LPT# device names. Both when provided as ISO8859-1 as well as UTF-8.

Reported-by: Joshua Rogers

Windows recognizes the 8-bit *superscript* digits 1, 2, and 3 as digits
and treats them as valid parts of COM# and LPT# device names. Both when
provided as ISO8859-1 as well as UTF-8.

Reported-by: Joshua Rogers
@bagder bagder added the Windows Windows-specific label Sep 21, 2026
@bagder
bagder requested a balanced review from Copilot September 21, 2026 07:38
@bagder
bagder marked this pull request as ready for review September 21, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Three test expectations incorrectly include a leading underscore and will fail against the sanitizer’s existing extension behavior.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Extends Windows filename sanitization to recognize superscript digits in reserved COM/LPT device names.

Changes:

  • Adds reserved-prefix detection for ISO-8859-1 and UTF-8 superscript digits.
  • Expands sanitizer test coverage.
File Description
src/​tool_doswin.c Adds centralized reserved device-prefix detection.
tests/​tunit/​tool1604.c Adds COM/LPT digit and superscript cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/tunit/tool1604.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation correctly handles both encodings and the updated tests cover the introduced behavior.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@bagder bagder closed this in 1ac826a Sep 21, 2026
@bagder
bagder deleted the bagder/windows-superscript branch September 21, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants