From 4dadef2ca9a663bf0c7fd85d8c07c07e7fed7c3b Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Thu, 7 Jun 2012 18:07:05 +0000 Subject: [PATCH] parse_qc: don't double-add TCPIP* in path git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@422 3ce903b1-3385-4e86-93cd-f9a4a239f7ac --- src/parse_qc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parse_qc.c b/src/parse_qc.c index a9f6325..adad77d 100644 --- a/src/parse_qc.c +++ b/src/parse_qc.c @@ -524,7 +524,11 @@ int q_process(struct client_t *c, char *new_q, int new_q_size, char *via_start, } } else if (originated_by_client) { /* FROMCALL matches the login */ - return snprintf(new_q, new_q_size, ",TCPIP*,qAC,%s", mycall); + /* Add TCPIP* in the end of the path only if it's not there already */ + if (pathlen > 7 && strncmp(*path_end-7, ",TCPIP*", 7) == 0) + return snprintf(new_q, new_q_size, ",qAC,%s", mycall); + else + return snprintf(new_q, new_q_size, ",TCPIP*,qAC,%s", mycall); } else { /* Append ,qAS,login */ new_q_len = snprintf(new_q, new_q_size, ",qAS,%s", c->username);