diff options
Diffstat (limited to 'src/gsmd')
-rw-r--r-- | src/gsmd/usock.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c index 5e5b5c3..13c3bb1 100644 --- a/src/gsmd/usock.c +++ b/src/gsmd/usock.c @@ -961,6 +961,7 @@ static int network_oper_n_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) static int network_opers_parse(const char *str, struct gsmd_msg_oper **out) { int len = 0; + int in_quote = 0; struct gsm_extrsp *er; char buf[64]; char *head, *tail, *ptr; @@ -995,9 +996,11 @@ static int network_opers_parse(const char *str, struct gsmd_msg_oper **out) str = ptr; while (*str) { - if ( *str == '(' ) + if (*str == '"') + in_quote = !in_quote; + if (!in_quote && *str == '(') head = (char *) str; - else if ( *str == ')' ) { + else if (!in_quote && *str == ')') { tail = (char *) str; memset(buf, '\0', sizeof(buf)); |