- Notifications
You must be signed in to change notification settings - Fork3.8k
win: handle win32 namespaces#4910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:v1.x
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This commit introduces a comprehensive path parser that handles:- Win32 file namespace: \?\C:\path- Win32 device namespace: \.\C:- NT namespace: \??\C:\path- UNC paths: \server\share and \?\UNC\server\share- Volume GUID paths: \?\Volume{...}- Special paths: \?\GLOBALROOT\...The implementation also adds validation for:- NULL and empty input strings- Path length limits (32767 characters for Win32 namespace)- Forward slash rejection in Win32 namespaces (which don't support normalization)- Explicit rejection of GLOBALROOT pathsUh oh!
There was an error while loading.Please reload this page.
savashn commentedOct 18, 2025
All done as requested. |
bnoordhuis left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Tell me it's ai-generated code without telling me it's ai-generated code. The comments all have that strong "add 1 to i" vibe that llms are infamous for.
Superfluous comments are distracting. Libuv's house style is comments should be added only when it's not obviouswhy code does what it does.
Stress onwhy; if it's not obviouswhat code does, that's a clear sign it's bad code.
Uh oh!
There was an error while loading.Please reload this page.
savashn commentedOct 18, 2025
I just wanted to help out with this great project you're working on. Respectfully. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
savashn commentedOct 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you for your time. I’m not sure if I should close this PR. I’ve implemented your suggestions, so I'll leave it open. But feel free to close it if you prefer. |
The
uv_chdirfunction has a TODO comment asking win32 namespaces to be handled.This PR implements comprehensive Windows path format handling by introducing a new
uv__extract_drive_letterhelper function that parses all Windows path formats:C:\Windows\\?\C:\LongPath\\.\C:\??\C:\Path\\server\share(returns 0, no drive letter)\\?\UNC\server\share(returns 0)\\?\Volume{...}(returns 0)\\?\GLOBALROOT\...(explicitly rejected)Additionally, path length validation (32767 character limit) and forward slash handling have been added.