fix: last is blank have bug
This commit is contained in:
parent
64243a2127
commit
4976c80e2f
|
@ -98,7 +98,7 @@ SWords shellCommands[] = {
|
||||||
{"describe <all_table>", 0, 0, NULL},
|
{"describe <all_table>", 0, 0, NULL},
|
||||||
{"delete from <all_table> where ", 0, 0, NULL},
|
{"delete from <all_table> where ", 0, 0, NULL},
|
||||||
{"drop database <db_name>", 0, 0, NULL},
|
{"drop database <db_name>", 0, 0, NULL},
|
||||||
{"drop index ", 0, 0, NULL},
|
{"drop index <anyword>", 0, 0, NULL},
|
||||||
{"drop table <all_table>", 0, 0, NULL},
|
{"drop table <all_table>", 0, 0, NULL},
|
||||||
{"drop dnode <dnode_id>", 0, 0, NULL},
|
{"drop dnode <dnode_id>", 0, 0, NULL},
|
||||||
{"drop mnode on dnode <dnode_id> ;", 0, 0, NULL},
|
{"drop mnode on dnode <dnode_id> ;", 0, 0, NULL},
|
||||||
|
@ -577,9 +577,12 @@ void parseCommand(SWords* command, bool pattern) {
|
||||||
while (word->next) {
|
while (word->next) {
|
||||||
word = word->next;
|
word = word->next;
|
||||||
}
|
}
|
||||||
word->next = addWord(p + start, i - start, pattern);
|
int len = i - start;
|
||||||
|
if (len > 0) {
|
||||||
|
word->next = addWord(p + start, len, pattern);
|
||||||
command->count++;
|
command->count++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
start = i + 1;
|
start = i + 1;
|
||||||
} else {
|
} else {
|
||||||
lastBlank = false;
|
lastBlank = false;
|
||||||
|
|
Loading…
Reference in New Issue