Skip to content

Commit 983eed2

Browse files
committed
Fix assertion error when a drive letter path is passed to command line
1 parent 6c1d184 commit 983eed2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/edit/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ fn handle_args(state: &mut State) -> apperr::Result<bool> {
250250
break;
251251
}
252252
let p = cwd.join(Path::new(&arg));
253-
let p = path::normalize(&p);
253+
// `p` is not absolute when `arg` is a drive letter path like `C:`
254+
let p = if p.is_absolute() { path::normalize(&p) } else { p };
254255
if !p.is_dir() {
255256
paths.push(p);
256257
}

0 commit comments

Comments
 (0)