shell: history feature optimization
When history feature is not compiled in it makes no sense to trim the command. In addition when history feature is not active the shell will not call function history_put. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
parent
fe3bf7b227
commit
0e91aada4a
1 changed files with 5 additions and 4 deletions
|
@ -599,10 +599,11 @@ static int execute(const struct shell *shell)
|
|||
|
||||
memset(&shell->ctx->active_cmd, 0, sizeof(shell->ctx->active_cmd));
|
||||
|
||||
shell_cmd_trim(shell);
|
||||
|
||||
history_put(shell, shell->ctx->cmd_buff,
|
||||
shell->ctx->cmd_buff_len);
|
||||
if (IS_ENABLED(CONFIG_SHELL_HISTORY)) {
|
||||
shell_cmd_trim(shell);
|
||||
history_put(shell, shell->ctx->cmd_buff,
|
||||
shell->ctx->cmd_buff_len);
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_SHELL_WILDCARD)) {
|
||||
shell_wildcard_prepare(shell);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue