From 6c5e34fa703bcbd7e82232d035f00b94aa8bd38e Mon Sep 17 00:00:00 2001 From: bernard Date: Wed, 9 Oct 2013 18:06:40 +0900 Subject: [PATCH] fix the line too long issue --- components/finsh/finsh_parser.c | 5 +++++ components/finsh/finsh_token.c | 9 +-------- components/finsh/finsh_vm.c | 10 +++++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/components/finsh/finsh_parser.c b/components/finsh/finsh_parser.c index 7f4dc822d..ffa8ee0d9 100644 --- a/components/finsh/finsh_parser.c +++ b/components/finsh/finsh_parser.c @@ -25,6 +25,7 @@ * Change Logs: * Date Author Notes * 2010-03-22 Bernard first version + * 2013-10-09 Bernard fix the command line too long issue. */ #include @@ -987,6 +988,10 @@ void finsh_parser_run(struct finsh_parser* self, const u_char* string) break; } + + /* no root found, break out */ + if (self->root == NULL) break; + /* get next token */ next_token(token, &(self->token)); } diff --git a/components/finsh/finsh_token.c b/components/finsh/finsh_token.c index 2486988a4..895b15d96 100644 --- a/components/finsh/finsh_token.c +++ b/components/finsh/finsh_token.c @@ -164,7 +164,6 @@ static void token_run(struct finsh_token* self) { self->current_token = finsh_token_type_identifier; } - return; } else/*It is a operator character.*/ { @@ -331,15 +330,9 @@ static int token_match_name(struct finsh_token* self, const char* str) static void token_trim_space(struct finsh_token* self) { char ch; -#if 0 while ( (ch = token_next_char(self)) ==' ' || ch == '\t' || - ch == '\r' || - ch == '\n'); -#else - while ( (ch = token_next_char(self)) ==' ' || - ch == '\t'); -#endif + ch == '\r'); token_prev_char(self); } diff --git a/components/finsh/finsh_vm.c b/components/finsh/finsh_vm.c index 66da5a14b..b474966e4 100644 --- a/components/finsh/finsh_vm.c +++ b/components/finsh/finsh_vm.c @@ -1,5 +1,5 @@ /* - * Virtual machine finsh shell. + * Virtual machine of finsh shell. * * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team * @@ -43,13 +43,13 @@ u_char* finsh_pc; /* PC */ /* syscall list, for dynamic system call register */ struct finsh_syscall_item* global_syscall_list = NULL; -// #define VM_DISASSEMBLE +// #define FINSH_VM_DISASSEMBLE void finsh_vm_run() { u_char op; - /* if want to disassemble the bytecode, please define VM_DISASSEMBLE */ -#ifdef VM_DISASSEMBLE + /* if you want to disassemble the byte code, please define FINSH_VM_DISASSEMBLE */ +#ifdef FINSH_VM_DISASSEMBLE void finsh_disassemble(); finsh_disassemble(); #endif @@ -146,7 +146,7 @@ struct finsh_syscall* finsh_syscall_lookup(const char* name) return NULL; } -#ifdef VM_DISASSEMBLE +#ifdef FINSH_VM_DISASSEMBLE void finsh_disassemble() { u_char *pc, op; -- GitLab