From 50dd56d3c44f9c7921592ae32733b533b44b0100 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Mon, 2 Nov 2020 13:00:47 -0600 Subject: [PATCH] bugfix for when pathext ends in ';' (#2723) --- crates/nu-cli/src/completion/command.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/nu-cli/src/completion/command.rs b/crates/nu-cli/src/completion/command.rs index 6b609eb9bb..b0ad5137ed 100644 --- a/crates/nu-cli/src/completion/command.rs +++ b/crates/nu-cli/src/completion/command.rs @@ -65,6 +65,8 @@ fn pathext() -> Option> { 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::>()