summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-26 05:54:32 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-26 05:54:32 -0500
commit6313827df2a9a0067132626a886e628990715064 (patch)
tree9c456f283d6f08def156cc7dcb8d8319207e454d /drivers.c
parent1d6838febd124fad50f70cf39b5fb43d7da44828 (diff)
downloadgpsd-6313827df2a9a0067132626a886e628990715064.tar.gz
Prevent multiple path rewrites in gpsmon.
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers.c b/drivers.c
index 96387cad..6b993c4f 100644
--- a/drivers.c
+++ b/drivers.c
@@ -1417,6 +1417,7 @@ const struct gps_type_t driver_aivdm = {
static void path_rewrite(struct gps_device_t *session, char *prefix)
/* prepend the session path to the value of a specified attribute */
{
+
/*
* Hack the packet to reflect its origin. This code is supposed
* to insert the path naming the remote gpsd instance into the
@@ -1424,6 +1425,11 @@ static void path_rewrite(struct gps_device_t *session, char *prefix)
* from the device.
*/
char *prefloc;
+
+ /* possibly the rewrite has been done already, this comw up in gpsmon */
+ if (strstr((char *)session->lexer.outbuffer, session->gpsdata.dev.path) != NULL)
+ return;
+
for (prefloc = (char *)session->lexer.outbuffer;
prefloc < (char *)session->lexer.outbuffer+session->lexer.outbuflen;
prefloc++)