[PATCH] Handle right bracket in g_at_result_iter_next_unquoted_string

Zhang, Zhenhua zhenhua.zhang at intel.com
Wed Oct 21 19:58:24 PDT 2009


Allow g_at_result_iter_next_unquoted_string to handle the bracket when parsing
string like chld (1, 2). Original, it returns '1' and '2)'. Now it returns '1'
and '2'. g_at_result_iter_close_list handles the right bracket later.
---
 gatchat/gatresult.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c
index 1436ae3..3d07e13 100644
--- a/gatchat/gatresult.c
+++ b/gatchat/gatresult.c
@@ -131,12 +131,12 @@ gboolean g_at_result_iter_next_unquoted_string(GAtResultIter *iter,
 		goto out;
 	}
 
-	if (line[pos] == '"')
+	if (line[pos] == '"' || line[pos] == ')')
 		return FALSE;
 
 	end = pos;
 
-	while (end < len && line[end] != ',')
+	while (end < len && line[end] != ',' && line[end] != ')')
 		end += 1;
 
 	iter->buf[end] = '\0';

Regards,
Zhenhua
 


More information about the ofono mailing list