diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 52687043f5..64f0a3bc8f 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -98,7 +98,7 @@ SWords shellCommands[] = { {"describe ", 0, 0, NULL}, {"delete from where ", 0, 0, NULL}, {"drop database ", 0, 0, NULL}, - {"drop index ", 0, 0, NULL}, + {"drop index ", 0, 0, NULL}, {"drop table ", 0, 0, NULL}, {"drop dnode ", 0, 0, NULL}, {"drop mnode on dnode ;", 0, 0, NULL}, @@ -577,8 +577,11 @@ void parseCommand(SWords* command, bool pattern) { while (word->next) { word = word->next; } - word->next = addWord(p + start, i - start, pattern); - command->count++; + int len = i - start; + if (len > 0) { + word->next = addWord(p + start, len, pattern); + command->count++; + } } start = i + 1; } else {