diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index dc0d7c9..3e3a0ff 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -466,9 +466,19 @@ static void have_line(GAtChat *p, gboolean strip_preceding) cmd = g_queue_peek_head(p->command_queue); - if (cmd && p->cmd_bytes_written == strlen(cmd->cmd) && - g_at_chat_handle_command_response(p, cmd, str)) - return; + if (cmd) { + char *cr; + + if (p->cmd_bytes_written == strlen(cmd->cmd) && + g_at_chat_handle_command_response(p, cmd, str)) + return; + + cr = strchr(cmd->cmd, '\r'); + + if (cr && p->cmd_bytes_written == (cr - cmd->cmd) && + g_at_chat_handle_command_response(p, cmd, str)) + return; + } if (g_at_chat_match_notify(p, str) == TRUE) return;