Skip to content

Better Windows' volume detection#1802

Open
oldergod wants to merge 1 commit into
masterfrom
bquenaudon.2026-04-20.windowspath
Open

Better Windows' volume detection#1802
oldergod wants to merge 1 commit into
masterfrom
bquenaudon.2026-04-20.windowspath

Conversation

@oldergod

Copy link
Copy Markdown
Member

Windows accepts both / and \ !


@Suppress("NOTHING_TO_INLINE")
internal inline fun Path.commonVolumeLetter(): Char? {
if (bytes.indexOf(SLASH) != -1) return null

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was preventing forward slashes from being accepted

@JakeWharton

Copy link
Copy Markdown
Collaborator

I'm not comfortable deciding if this is valid or not. Deferring to Jesse.

@JakeWharton JakeWharton removed their request for review May 6, 2026 14:48

@swankjesse swankjesse left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What’s the motivation here?

Unfortunately we’re in a small bind here because our API behaves the same regardless of what the host platform is, and treating C:/Windows as a drive letter also means we further aggravate this bug: #1460

@oldergod

Copy link
Copy Markdown
Member Author

This came up through this ticket on Wire square/wire#3215
If Windows does accept both slashes, I thought it'd make sense to support both

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants