summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2013-04-03 05:31:29 -0400
committerBernard Xiong <[email protected]>2013-04-03 05:31:29 -0400
commitb68e34c9311fde0acd12fcb2fdc2763e63dce188 (patch)
tree8f55bdcfb09afcbdafd736209c7ddb978c9f0f42 /components
parentedef109d76c3a66cc0139745cb28556d28794118 (diff)
strip more characters in finsh token
Diffstat (limited to 'components')
-rw-r--r--components/finsh/finsh_token.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/finsh/finsh_token.c b/components/finsh/finsh_token.c
index 9bc808fc9e..d4b1b70d79 100644
--- a/components/finsh/finsh_token.c
+++ b/components/finsh/finsh_token.c
@@ -25,6 +25,7 @@
* Change Logs:
* Date Author Notes
* 2010-03-22 Bernard first version
+ * 2013-04-03 Bernard strip more characters.
*/
#include <finsh.h>
@@ -328,7 +329,10 @@ static int token_match_name(struct finsh_token* self, const char* str)
static void token_trim_space(struct finsh_token* self)
{
char ch;
- while ( (ch = token_next_char(self)) ==' ' || ch == '\t');
+ while ( (ch = token_next_char(self)) ==' ' ||
+ ch == '\t' ||
+ ch == '\r' ||
+ ch == '\n');
token_prev_char(self);
}