| 69 | |
| 70 | #ifdef RT_USING_HEAP |
| 71 | int finsh_set_prompt(const char *prompt) |
| 72 | { |
| 73 | if (finsh_prompt_custom) |
| 74 | { |
| 75 | rt_free(finsh_prompt_custom); |
| 76 | finsh_prompt_custom = RT_NULL; |
| 77 | } |
| 78 | |
| 79 | /* strdup */ |
| 80 | if (prompt) |
| 81 | { |
| 82 | finsh_prompt_custom = (char *)rt_malloc(strlen(prompt) + 1); |
| 83 | if (finsh_prompt_custom) |
| 84 | { |
| 85 | strcpy(finsh_prompt_custom, prompt); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return 0; |
| 90 | } |
| 91 | #endif /* RT_USING_HEAP */ |
| 92 | |
| 93 | #define _MSH_PROMPT "msh " |