MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / finsh_set_prompt

Function finsh_set_prompt

components/finsh/shell.c:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70#ifdef RT_USING_HEAP
71int 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 "

Callers

nothing calls this directly

Calls 2

rt_freeFunction · 0.85
rt_mallocFunction · 0.85

Tested by

no test coverage detected