[TD-5466]<fix> handle invalid Escapes

This commit is contained in:
yihaoDeng 2021-08-24 12:12:14 +08:00
parent 0594c5c64c
commit 98a5ad09f0
2 changed files with 7 additions and 2 deletions

View File

@ -254,9 +254,13 @@ int32_t shellRunCommand(TAOS* con, char* command) {
}
if (c == '\\') {
if (quote != 0 && (*command == '_' || *command == '\\')) {
//DO nothing
} else {
esc = true;
continue;
}
}
if (quote == c) {
quote = 0;

View File

@ -262,6 +262,7 @@ int patternMatch(const char *patterStr, const char *str, size_t size, const SPat
c1 = str[j++];
if (j <= size) {
if (c == '\\' && patterStr[i] == '_' && c1 == '_') { i++; continue; }
if (c == c1 || tolower(c) == tolower(c1) || (c == pInfo->matchOne && c1 != 0)) {
continue;
}