提交 3052a549 编写于 作者: B bernard.xiong

add prompt output when start and remove the empty history

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@562 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 bd5399d0
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE * http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE * http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* 2006-09-24 Bernard remove the code related with hardware * 2006-09-24 Bernard remove the code related with hardware
* 2010-01-18 Bernard fix down then up key bug. * 2010-01-18 Bernard fix down then up key bug.
* 2010-03-19 Bernard fix backspace issue and fix device read in shell. * 2010-03-19 Bernard fix backspace issue and fix device read in shell.
* 2010-04-01 Bernard add prompt output when start and remove the empty history
*/ */
#include <rtthread.h> #include <rtthread.h>
...@@ -236,12 +237,14 @@ void finsh_thread_entry(void* parameter) ...@@ -236,12 +237,14 @@ void finsh_thread_entry(void* parameter)
unsigned short current_history, use_history; unsigned short current_history, use_history;
#endif #endif
pos = 0;
stat = WAIT_NORMAL; stat = WAIT_NORMAL;
current_history = 0; current_history = 0;
use_history = 0; use_history = 0;
memset(line, 0, sizeof(line)); memset(line, 0, sizeof(line));
finsh_init(&parser); finsh_init(&parser);
rt_kprintf("finsh>>");
while (1) while (1)
{ {
...@@ -350,7 +353,7 @@ void finsh_thread_entry(void* parameter) ...@@ -350,7 +353,7 @@ void finsh_thread_entry(void* parameter)
line[pos] = ';'; line[pos] = ';';
#ifdef FINSH_USING_HISTORY #ifdef FINSH_USING_HISTORY
if (use_history == 0) if ((use_history == 0) && (pos != 0))
{ {
/* push history */ /* push history */
if (finsh_history_count >= FINSH_HISTORY_LINES) if (finsh_history_count >= FINSH_HISTORY_LINES)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册