gatchat: Fix parsing fields with odd number of quotation marks

Events like +CLCC and +CCWA can have contact name attached to the
end of line. If this field contains odd number of quotation marks,
parser will eventually reject such message as malformatted.
This commit is contained in:
Kuba Pawlak 2016-11-10 10:22:44 +01:00 committed by Denis Kenzior
parent f750366261
commit 5a6fe84ec0
1 changed files with 6 additions and 0 deletions

View File

@ -309,6 +309,12 @@ static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax,
case GSM_PERMISSIVE_STATE_RESPONSE_STRING:
if (byte == '"')
syntax->state = GSM_PERMISSIVE_STATE_RESPONSE;
else if (byte == '\r') {
syntax->state = GSM_PERMISSIVE_STATE_IDLE;
i += 1;
res = G_AT_SYNTAX_RESULT_LINE;
goto out;
}
break;
case GSM_PERMISSIVE_STATE_GUESS_PDU: