Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] WAIT_COMMAND does not work correctly #77

Closed
WagnerPMC opened this issue Sep 21, 2023 · 1 comment
Closed

[BUG] WAIT_COMMAND does not work correctly #77

WagnerPMC opened this issue Sep 21, 2023 · 1 comment

Comments

@WagnerPMC
Copy link
Contributor

WagnerPMC commented Sep 21, 2023

Hello,

I notice that the executable command is inserted into the arguments of the same executable command:

let argv = shell_words::split(&command_string)?;
Ok(Some((
Command {
program: argv[0].clone(),
argv,
},
command_string,
)))

In this way, it turns out that the conditional "hello man" command turns into the "hello hello man" command.
To prevent this from happening, we need to remove the first element of the vector from the argv variable, in the same place.

Quick fix:

let mut argv = shell_words::split(&command_string)?;

Ok(Some((
    Command {
        program: argv.remove(0),
        argv,
    },
    command_string,
)))

If it's a hassle, I can create a PR for a quick fix - just let me know.

@ufoscout
Copy link
Owner

Fixed by #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants