shell: Fix prompt length not updated in shell_prompt_change

Prompt length is used when printing log messages to erase
prompt. If length is not updated and new prompt is longer
than default one then only part of the prompt is erased
which looks like data corruption.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2019-02-11 14:45:43 +01:00 committed by Kumar Gala
commit 3a879deecc

View file

@ -1359,6 +1359,7 @@ int shell_prompt_change(const struct shell *shell, const char *prompt)
return -EINVAL;
}
shell->ctx->prompt = prompt;
shell->ctx->vt100_ctx.cons.name_len = shell_strlen(prompt);
return 0;
}