summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-03-22 12:58:04 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-03-22 12:59:04 -0500
commita8a720d983e32f839b3a237caff2513781ab68b2 (patch)
treedd09ee5e032e9c92ce52d4bbfdec4e499ed1c28c
parent2583ff626b53104e9c9761e0798525da04cf0040 (diff)
downloadofono-a8a720d983e32f839b3a237caff2513781ab68b2.tar.bz2
Fix: extract line should use S3, not hardcode CR
-rw-r--r--gatchat/gatserver.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index efc2f3d0..6579b389 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -425,6 +425,7 @@ static char *extract_line(GAtServer *p)
int strip_front = 0;
int line_length = 0;
gboolean in_string = FALSE;
+ char s3 = p->v250.s3;
char *line;
int i;
@@ -445,7 +446,7 @@ static char *extract_line(GAtServer *p)
buf = ring_buffer_read_ptr(p->read_buf, pos);
}
- /* We will strip AT and \r */
+ /* We will strip AT and S3 */
line_length -= 3;
line = g_try_new(char, line_length + 1);
@@ -469,7 +470,7 @@ static char *extract_line(GAtServer *p)
if ((*buf == ' ' || *buf == '\t') && in_string == FALSE)
; /* Skip */
- else if (*buf != '\r')
+ else if (*buf != s3)
line[i++] = *buf;
buf += 1;
@@ -479,7 +480,7 @@ static char *extract_line(GAtServer *p)
buf = ring_buffer_read_ptr(p->read_buf, pos);
}
- /* Strip \r */
+ /* Strip S3 */
ring_buffer_drain(p->read_buf, p->read_so_far - strip_front - 2);
line[i] = '\0';