Skip to content

Commit 58da93d

Browse files
rasaeamodio
authored andcommitted
Fixes #1928 quiet when editing root folder files
1 parent c0c495a commit 58da93d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/system/path.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ export function normalizePath(path: string): string {
177177

178178
path = path.replace(pathNormalizeRegex, '/');
179179
if (path.charCodeAt(path.length - 1) === slash) {
180-
path = path.slice(0, -1);
180+
// Don't remove the trailing slash on Windows root folders, such as z:\
181+
if (path.length != 3 || (path.length == 3 && path.charCodeAt(1) != ':')) {
182+
path = path.slice(0, -1);
183+
}
181184
}
182185

183186
if (isWindows) {

0 commit comments

Comments
 (0)