fix the line too long issue

This commit is contained in:
bernard 2013-10-09 18:06:40 +09:00
parent 09b105ecf7
commit 6c5e34fa70
3 changed files with 11 additions and 13 deletions

View File

@ -25,6 +25,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2010-03-22 Bernard first version * 2010-03-22 Bernard first version
* 2013-10-09 Bernard fix the command line too long issue.
*/ */
#include <finsh.h> #include <finsh.h>
@ -987,6 +988,10 @@ void finsh_parser_run(struct finsh_parser* self, const u_char* string)
break; break;
} }
/* no root found, break out */
if (self->root == NULL) break;
/* get next token */ /* get next token */
next_token(token, &(self->token)); next_token(token, &(self->token));
} }

View File

@ -164,7 +164,6 @@ static void token_run(struct finsh_token* self)
{ {
self->current_token = finsh_token_type_identifier; self->current_token = finsh_token_type_identifier;
} }
return;
} }
else/*It is a operator character.*/ 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) static void token_trim_space(struct finsh_token* self)
{ {
char ch; char ch;
#if 0
while ( (ch = token_next_char(self)) ==' ' || while ( (ch = token_next_char(self)) ==' ' ||
ch == '\t' || ch == '\t' ||
ch == '\r' || ch == '\r');
ch == '\n');
#else
while ( (ch = token_next_char(self)) ==' ' ||
ch == '\t');
#endif
token_prev_char(self); token_prev_char(self);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Virtual machine finsh shell. * Virtual machine of finsh shell.
* *
* COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team
* *
@ -43,13 +43,13 @@ u_char* finsh_pc; /* PC */
/* syscall list, for dynamic system call register */ /* syscall list, for dynamic system call register */
struct finsh_syscall_item* global_syscall_list = NULL; struct finsh_syscall_item* global_syscall_list = NULL;
// #define VM_DISASSEMBLE // #define FINSH_VM_DISASSEMBLE
void finsh_vm_run() void finsh_vm_run()
{ {
u_char op; u_char op;
/* if want to disassemble the bytecode, please define VM_DISASSEMBLE */ /* if you want to disassemble the byte code, please define FINSH_VM_DISASSEMBLE */
#ifdef VM_DISASSEMBLE #ifdef FINSH_VM_DISASSEMBLE
void finsh_disassemble(); void finsh_disassemble();
finsh_disassemble(); finsh_disassemble();
#endif #endif
@ -146,7 +146,7 @@ struct finsh_syscall* finsh_syscall_lookup(const char* name)
return NULL; return NULL;
} }
#ifdef VM_DISASSEMBLE #ifdef FINSH_VM_DISASSEMBLE
void finsh_disassemble() void finsh_disassemble()
{ {
u_char *pc, op; u_char *pc, op;