summaryrefslogtreecommitdiff
path: root/std/path/posix.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/path/posix.ts')
-rw-r--r--std/path/posix.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/std/path/posix.ts b/std/path/posix.ts
index afbc9303f..33b94a916 100644
--- a/std/path/posix.ts
+++ b/std/path/posix.ts
@@ -436,5 +436,7 @@ export function fromFileUrl(url: string | URL): string {
if (url.protocol != "file:") {
throw new TypeError("Must be a file URL.");
}
- return decodeURIComponent(url.pathname);
+ return decodeURIComponent(
+ url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"),
+ );
}