mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
Добавляем экранирование в строки сценария \\" и \\n
This commit is contained in:
@@ -707,7 +707,16 @@ int IoTScenario::gettok() {
|
||||
IdentifierStr = "";
|
||||
LastChar = getLastChar();
|
||||
while (LastChar != '"' && LastChar != EOF) {
|
||||
IdentifierStr += (char)LastChar;
|
||||
if (LastChar == '\\') { // обработка экранированных символов в строке
|
||||
LastChar = getLastChar();
|
||||
if (LastChar == '"') {
|
||||
IdentifierStr += '"';
|
||||
} else if (LastChar == 'n') {
|
||||
IdentifierStr += '\n';
|
||||
}
|
||||
} else {
|
||||
IdentifierStr += (char)LastChar;
|
||||
}
|
||||
LastChar = getLastChar();
|
||||
}
|
||||
LastChar = getLastChar();
|
||||
|
||||
Reference in New Issue
Block a user