nodejs / nodejs/node

`path.win32.isAbsolute` considers relative paths absolute

Open
#56,766 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

path
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

Version

22.11.0

Platform
Linux pc 6.8.0-48-generic #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem

No response

What steps will reproduce the bug?
require('path').win32.isAbsolute('\\foo') === true
How often does it reproduce? Is there a required condition?

Yes. No.

What is the expected behavior? Why is that the expected behavior?

Here's a behavior of cd on Windows:

C:\Users\user> cd \Windows
C:\Windows>

\Windows is relative to drive name.

Expected output for isAbsolute() is false.

What do you see instead?

isAbsolute() is true.

Additional information

(Edited to prevent the issue from deletion by dumb AI.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the reported require('path').win32.isAbsolute entry point and trace its implementation and existing path tests. Reproduce the '\foo' case, add regression coverage for the expected Windows behavior, and verify that the relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.