[TD-5466]<fix> handle invalid Escapes
This commit is contained in:
parent
0594c5c64c
commit
98a5ad09f0
|
@ -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
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue