未验证 提交 b7a04138 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #7541 from taosdata/fix/TD-5466

[TD-5466]<fix> handle invalid Escapes
...@@ -254,9 +254,13 @@ int32_t shellRunCommand(TAOS* con, char* command) { ...@@ -254,9 +254,13 @@ int32_t shellRunCommand(TAOS* con, char* command) {
} }
if (c == '\\') { if (c == '\\') {
if (quote != 0 && (*command == '_' || *command == '\\')) {
//DO nothing
} else {
esc = true; esc = true;
continue; continue;
} }
}
if (quote == c) { if (quote == c) {
quote = 0; quote = 0;
......
...@@ -262,6 +262,7 @@ int patternMatch(const char *patterStr, const char *str, size_t size, const SPat ...@@ -262,6 +262,7 @@ int patternMatch(const char *patterStr, const char *str, size_t size, const SPat
c1 = str[j++]; c1 = str[j++];
if (j <= size) { if (j <= size) {
if (c == '\\' && patterStr[i] == '_' && c1 == '_') { i++; continue; }
if (c == c1 || tolower(c) == tolower(c1) || (c == pInfo->matchOne && c1 != 0)) { if (c == c1 || tolower(c) == tolower(c1) || (c == pInfo->matchOne && c1 != 0)) {
continue; continue;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册