diff options
| author | bernard <[email protected]> | 2014-04-08 15:49:16 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2014-04-08 15:49:16 +0800 |
| commit | b2f35dcf3f930087104e2bb36845d50a6931a15d (patch) | |
| tree | 40e1e3389ceebb6e18919ce0750a880cacb6e9cc /components/finsh/shell.c | |
| parent | 412d548f9cfb3bb89efe2828013eeb3e264fc0c1 (diff) | |
Merge remote-tracking branch 'origin/master' into stable-v1.2.xv1.2.1
Diffstat (limited to 'components/finsh/shell.c')
| -rw-r--r-- | components/finsh/shell.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 4313fcf6b2..393d68713c 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -54,8 +54,10 @@ ALIGN(RT_ALIGN_SIZE) static char finsh_thread_stack[FINSH_THREAD_STACK_SIZE]; struct finsh_shell* shell; -#if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR) +#if defined(FINSH_USING_MSH) || (defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)) +#if defined(RT_USING_DFS) #include <dfs_posix.h> +#endif const char* finsh_get_prompt() { #define _MSH_PROMPT "msh " @@ -68,8 +70,10 @@ const char* finsh_get_prompt() #endif strcpy(finsh_prompt, _PROMPT); +#ifdef DFS_USING_WORKDIR /* get current working directory */ getcwd(&finsh_prompt[rt_strlen(finsh_prompt)], RT_CONSOLEBUF_SIZE - rt_strlen(finsh_prompt)); +#endif strcat(finsh_prompt, ">"); return finsh_prompt; |
