提交 04b5a461 编写于 作者: B bernard

[Finsh] fix the shell prompt issue.

上级 444b928d
...@@ -60,14 +60,16 @@ const char* finsh_get_prompt() ...@@ -60,14 +60,16 @@ const char* finsh_get_prompt()
{ {
#define _MSH_PROMPT "msh " #define _MSH_PROMPT "msh "
#define _PROMPT "finsh " #define _PROMPT "finsh "
static char finsh_prompt[RT_CONSOLEBUF_SIZE + 1] = {_PROMPT}; static char finsh_prompt[RT_CONSOLEBUF_SIZE + 1] = {0};
#ifdef FINSH_USING_MSH #ifdef FINSH_USING_MSH
if (msh_is_used()) strcpy(finsh_prompt, _MSH_PROMPT); if (msh_is_used()) strcpy(finsh_prompt, _MSH_PROMPT);
else
#endif #endif
strcpy(finsh_prompt, _PROMPT);
/* get current working directory */ /* get current working directory */
getcwd(&finsh_prompt[rt_strlen(finsh_prompt)], RT_CONSOLEBUF_SIZE - 8); getcwd(&finsh_prompt[rt_strlen(finsh_prompt)], RT_CONSOLEBUF_SIZE - rt_strlen(finsh_prompt));
strcat(finsh_prompt, ">"); strcat(finsh_prompt, ">");
return finsh_prompt; return finsh_prompt;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册