From 58da93d05cd015b94c2ce1e921443f96d9bda32e Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Sat, 26 Mar 2022 11:02:47 -0700 Subject: [PATCH] Fixes #1928 quiet when editing root folder files --- src/system/path.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system/path.ts b/src/system/path.ts index fd1036c..e25475d 100644 --- a/src/system/path.ts +++ b/src/system/path.ts @@ -177,7 +177,10 @@ export function normalizePath(path: string): string { path = path.replace(pathNormalizeRegex, '/'); if (path.charCodeAt(path.length - 1) === slash) { - path = path.slice(0, -1); + // Don't remove the trailing slash on Windows root folders, such as z:\ + if (path.length != 3 || (path.length == 3 && path.charCodeAt(1) != ':')) { + path = path.slice(0, -1); + } } if (isWindows) {