forked from extern/nushell
bugfix for when pathext ends in ';' (#2723)
This commit is contained in:
parent
0f7e1d4d01
commit
50dd56d3c4
@ -65,6 +65,8 @@ fn pathext() -> Option<Vec<String>> {
|
|||||||
std::env::var_os("PATHEXT").map(|v| {
|
std::env::var_os("PATHEXT").map(|v| {
|
||||||
v.to_string_lossy()
|
v.to_string_lossy()
|
||||||
.split(';')
|
.split(';')
|
||||||
|
// Filter out empty tokens and ';' at the end
|
||||||
|
.filter(|f| f.len() > 1)
|
||||||
// Cut off the leading '.' character
|
// Cut off the leading '.' character
|
||||||
.map(|ext| ext[1..].to_string())
|
.map(|ext| ext[1..].to_string())
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
|
Loading…
Reference in New Issue
Block a user