All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier Guiter <olivier.guiter@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 1/1] gatserver: Add ATS5 command feature
Date: Thu, 10 Feb 2011 14:59:42 +0100	[thread overview]
Message-ID: <1297346382-20135-1-git-send-email-olivier.guiter@linux.intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 863 bytes --]

---
 gatchat/gatserver.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index be9f79a..25b7ba4 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -796,6 +796,7 @@ static char *extract_line(GAtServer *p, struct ring_buffer *rbuf)
 	int line_length = 0;
 	gboolean in_string = FALSE;
 	char s3 = p->v250.s3;
+	char s5 = p->v250.s5;
 	char *line;
 	int i;
 
@@ -837,7 +838,11 @@ static char *extract_line(GAtServer *p, struct ring_buffer *rbuf)
 		if (*buf == '"')
 			in_string = !in_string;
 
-		if ((*buf == ' ' || *buf == '\t') && in_string == FALSE)
+		if (*buf == s5) {
+			if (i != 0)
+				i -= 1;
+		}
+		else if ((*buf == ' ' || *buf == '\t') && in_string == FALSE)
 			; /* Skip */
 		else if (*buf != s3)
 			line[i++] = *buf;
-- 
1.7.1


             reply	other threads:[~2011-02-10 13:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 13:59 Olivier Guiter [this message]
2011-02-14 15:53 ` [PATCH 1/1] gatserver: Add ATS5 command feature Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1297346382-20135-1-git-send-email-olivier.guiter@linux.intel.com \
    --to=olivier.guiter@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.