From ede6ea48ab8cab98e888b8ccdb329c066f5847ab Mon Sep 17 00:00:00 2001 From: Roger Light Date: Sat, 7 Dec 2013 23:43:45 +0000 Subject: [PATCH] Fix topic comparison. --- src/paho/mqtt/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index 7cfd1ca..47b23a4 100755 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -200,6 +200,11 @@ def topic_matches_sub(sub, topic): if sub[spos] == topic[tpos]: spos += 1 tpos += 1 + + if tpos == tlen and spos == slen-1 and sub[spos] == '+': + spos += 1 + result = True + break else: if sub[spos] == '+': spos += 1 -- 2.39.5