提交 f1e92c63 编写于 作者: haojialeishumy's avatar haojialeishumy

finsh: check echo_mode before print '\n' when excute msh command

Signed-off-by: haojialeishumy's avatarSchumyHao <bob-hjl@126.com>
上级 856db6ea
...@@ -200,7 +200,8 @@ void finsh_run_line(struct finsh_parser *parser, const char *line) ...@@ -200,7 +200,8 @@ void finsh_run_line(struct finsh_parser *parser, const char *line)
{ {
const char *err_str; const char *err_str;
rt_kprintf("\n"); if(shell->echo_mode)
rt_kprintf("\n");
finsh_parser_run(parser, (unsigned char *)line); finsh_parser_run(parser, (unsigned char *)line);
/* compile node root */ /* compile node root */
...@@ -489,7 +490,8 @@ void finsh_thread_entry(void *parameter) ...@@ -489,7 +490,8 @@ void finsh_thread_entry(void *parameter)
#ifdef FINSH_USING_MSH #ifdef FINSH_USING_MSH
if (msh_is_used() == RT_TRUE) if (msh_is_used() == RT_TRUE)
{ {
rt_kprintf("\n"); if (shell->echo_mode)
rt_kprintf("\n");
msh_exec(shell->line, shell->line_position); msh_exec(shell->line, shell->line_position);
} }
else else
...@@ -500,7 +502,8 @@ void finsh_thread_entry(void *parameter) ...@@ -500,7 +502,8 @@ void finsh_thread_entry(void *parameter)
shell->line[shell->line_position] = ';'; shell->line[shell->line_position] = ';';
if (shell->line_position != 0) finsh_run_line(&shell->parser, shell->line); if (shell->line_position != 0) finsh_run_line(&shell->parser, shell->line);
else rt_kprintf("\n"); else
if (shell->echo_mode) rt_kprintf("\n");
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册