Skip to content

fix(path): handle case expansion in windows relative() - #7369

Open
Fire162 wants to merge 1 commit into
denoland:mainfrom
Fire162:fix/windows-relative-case-expansion
Open

Fire162 wants to merge 1 commit into
denoland:mainfrom
Fire162:fix/windows-relative-case-expansion

Conversation

@Fire162

@Fire162 Fire162 commented Oct 24, 2026

Copy link
Copy Markdown

Fixes #7336.

When from or to contains characters whose length changes upon lowercasing (such as "İ" expanding to "i̇"), slicing the original path with offsets computed from the lowercased path drops characters.

Fall back to comparing paths segment-by-segment when fromOrig.length !== from.length || toOrig.length !== to.length, matching the fix in Node.js (nodejs/node#53991).

Fixes denoland#7336. Compare paths segment-by-segment when lowercasing alters string length, avoiding incorrect slice offsets for characters like 'İ'.
@github-actions github-actions Bot added the path label Oct 24, 2026
@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.83871% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.00%. Comparing base (f834d02) to head (eb7304c).

Files with missing lines Patch % Lines
path/windows/relative.ts 54.83% 9 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7369      +/-   ##
==========================================
- Coverage   95.04%   95.00%   -0.04%     
==========================================
  Files         619      619              
  Lines       52012    52043      +31     
  Branches     9450     9463      +13     
==========================================
+ Hits        49434    49444      +10     
- Misses       2031     2040       +9     
- Partials      547      559      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CLAassistant

CLAassistant commented Oct 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

path: relative() on Windows drops leading characters when a path contains "İ"

2 participants