未验证 提交 ae18d55b 编写于 作者: H haojun Liao 提交者: GitHub

Merge pull request #5824 from taosdata/hotfix/TD-3780

[TD-3780]taos crash on windows issue
......@@ -199,15 +199,19 @@ void updateBuffer(Command *cmd) {
}
int isReadyGo(Command *cmd) {
char total[MAX_COMMAND_SIZE];
char *total = malloc(MAX_COMMAND_SIZE);
memset(total, 0, MAX_COMMAND_SIZE);
sprintf(total, "%s%s", cmd->buffer, cmd->command);
char *reg_str =
"(^.*;\\s*$)|(^\\s*$)|(^\\s*exit\\s*$)|(^\\s*q\\s*$)|(^\\s*quit\\s*$)|(^"
"\\s*clear\\s*$)";
if (regex_match(total, reg_str, REG_EXTENDED | REG_ICASE)) return 1;
if (regex_match(total, reg_str, REG_EXTENDED | REG_ICASE)) {
free(total);
return 1;
}
free(total);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册