Skip to content

path: fix win32.relative() for some Unicode paths

Fixes: https://github.com/nodejs/node/issues/27534

This is an alternative to https://github.com/nodejs/node/pull/27644 that avoids any performance regressions in cases where lowercased versions of paths do not differ in length to the original.

The only minor issue (in practice it may not really matter) is that return values are always returned normalized using canonical composition if the lowercased version differed in length to the original, which may be unexpected if you passed in a path that was normalized using canonical decomposition for example.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading