mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 23:49:44 +01:00
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| {
|
||||
v.to_string_lossy()
|
||||
.split(';')
|
||||
// Filter out empty tokens and ';' at the end
|
||||
.filter(|f| f.len() > 1)
|
||||
// Cut off the leading '.' character
|
||||
.map(|ext| ext[1..].to_string())
|
||||
.collect::<Vec<_>>()
|
||||
|
Loading…
Reference in New Issue
Block a user