From: Roger Light Date: Sat, 7 Dec 2013 23:43:45 +0000 (+0000) Subject: Fix topic comparison. X-Git-Tag: v0.9~40 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ede6ea48ab8cab98e888b8ccdb329c066f5847ab;p=packages%2Fp%2Fpaho-mqtt.git Fix topic comparison. --- 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