summaryrefslogtreecommitdiff
path: root/std/path/win32.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/path/win32.ts')
-rw-r--r--std/path/win32.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/std/path/win32.ts b/std/path/win32.ts
index 2c262b1b6..401e572db 100644
--- a/std/path/win32.ts
+++ b/std/path/win32.ts
@@ -909,6 +909,6 @@ export function parse(path: string): ParsedPath {
*/
export function fromFileUrl(url: string | URL): string {
return new URL(url).pathname
- .replace(/^\/(?=[A-Za-z]:\/)/, "")
+ .replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/")
.replace(/\//g, "\\");
}