os: fix is_abs_path() panic, when path is only one letter on windows (#10071)
parent
159ee00563
commit
e9c84ce154
|
@ -422,7 +422,7 @@ pub fn is_abs_path(path string) bool {
|
||||||
}
|
}
|
||||||
$if windows {
|
$if windows {
|
||||||
return path[0] == `/` || // incase we're in MingGW bash
|
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] == `/`
|
return path[0] == `/`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue