os: fix is_abs_path() panic, when path is only one letter on windows (#10071)

pull/10065/head
kevin70g 2021-05-10 15:01:32 +08:00 committed by GitHub
parent 159ee00563
commit e9c84ce154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -422,7 +422,7 @@ pub fn is_abs_path(path string) bool {
}
$if windows {
return path[0] == `/` || // incase we're in MingGW bash
(path[0].is_letter() && path[1] == `:`)
(path[0].is_letter() && path.len > 1 && path[1] == `:`)
}
return path[0] == `/`
}