Skip to content

Commit

Permalink
[src/parser.rs] Loosen parse validation so that just the executable p…
Browse files Browse the repository at this point in the history
…ath suffices
  • Loading branch information
SamuelMarks committed Jul 19, 2024
1 parent 06f3751 commit a6714a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a6714a4

Please sign in to comment.