From a6714a4726bac4e054eea6f90a3ba4657622780b Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:45:20 -0400 Subject: [PATCH] [src/parser.rs] Loosen parse validation so that just the executable path suffices --- src/parser.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index f9716c3..d8b7292 100755 --- a/src/parser.rs +++ b/src/parser.rs @@ -149,8 +149,14 @@ fn parse_command(command_line: &Vec<&str>, spec: &CliSpec) -> (bool, usize) { && OsStr::new(&command_strings[0]) == root_command_file_name { let mut found = true; - for index in 1..command_strings.len() { + for index in 0..command_strings.len() { if command_strings[index] != command_line[index] { + { + let base = OsStr::new(&command_strings[index]); + if base == root_command_file_name { + return (true, index + base.len()); + } + } found = false; break; }