From a0ae611a9947ad75bdb3aa48a2904fc42287e71b Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 27 Feb 2023 16:39:45 +0800 Subject: [PATCH] fix: fix can not scroll enum item with blank --- tools/shell/src/shellAuto.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 64f0a3bc8f..a8986351b7 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -536,7 +536,7 @@ SWord* addWord(const char* p, int32_t len, bool pattern) { word->len = len; // check format - if (pattern) { + if (pattern && len > 0) { word->type = wordType(p, len); } else { word->type = WT_TEXT; @@ -577,11 +577,8 @@ void parseCommand(SWords* command, bool pattern) { while (word->next) { word = word->next; } - int len = i - start; - if (len > 0) { - word->next = addWord(p + start, len, pattern); - command->count++; - } + word->next = addWord(p + start, i - start, pattern); + command->count++; } start = i + 1; } else { -- GitLab