All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] gatserver: Add ATS5 command feature
@ 2011-02-10 13:59 Olivier Guiter
  2011-02-14 15:53 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Guiter @ 2011-02-10 13:59 UTC (permalink / raw)
  To: ofono

[-- 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] gatserver: Add ATS5 command feature
  2011-02-10 13:59 [PATCH 1/1] gatserver: Add ATS5 command feature Olivier Guiter
@ 2011-02-14 15:53 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-02-14 15:53 UTC (permalink / raw)
  To: ofono

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

Hi Olivier,

On 02/10/2011 07:59 AM, Olivier Guiter wrote:
> ---
>  gatchat/gatserver.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 

<snip>

> @@ -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)

Please note that we follow the Linux kernel coding style, and in fact
the closing brace should be on the same line as the else if.  See
CodingStyle document in the linux kernel git for more details.

I've fixed this for you.  Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-14 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 13:59 [PATCH 1/1] gatserver: Add ATS5 command feature Olivier Guiter
2011-02-14 15:53 ` Denis Kenzior

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.