[TD-5466]<fix> handle invalid Escapes
This commit is contained in:
parent
0594c5c64c
commit
98a5ad09f0
|
@ -254,8 +254,12 @@ int32_t shellRunCommand(TAOS* con, char* command) {
|
|||
}
|
||||
|
||||
if (c == '\\') {
|
||||
esc = true;
|
||||
continue;
|
||||
if (quote != 0 && (*command == '_' || *command == '\\')) {
|
||||
//DO nothing
|
||||
} else {
|
||||
esc = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (quote == c) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue