From: Stephen Warren Date: Sat, 6 Feb 2016 01:04:42 +0000 (-0700) Subject: test/py: fix off-by-one error in spawn matching code X-Git-Tag: v2016.03-rc2~35 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d8926811fd8b0d48e3bc99627c95544013bd3a7b;p=u-boot test/py: fix off-by-one error in spawn matching code A regex match object's .end() value is already the index after the match, not the index of the last character in the match, so there's no need to add 1 to point past the match. Signed-off-by: Stephen Warren --- diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 4b9e81af3e..3d9cde5ee0 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -142,7 +142,7 @@ class Spawn(object): earliest_pi = pi if earliest_m: pos = earliest_m.start() - posafter = earliest_m.end() + 1 + posafter = earliest_m.end() self.before = self.buf[:pos] self.after = self.buf[pos:posafter] self.buf = self.buf[posafter:]